Interface IAvatarPose
- Namespace
- VMagicMirror.Buddy
アバターの姿勢情報に関するAPIです。
public interface IAvatarPose
Methods
GetBoneGlobalPosition(HumanBodyBones, bool)
指定したボーンの位置をワールド座標で取得します。
Vector3 GetBoneGlobalPosition(HumanBodyBones bone, bool useParentBone = true)
Parameters
bone
HumanBodyBonesボーン
useParentBone
booltrue
を指定した場合、bone
で指定したボーンが存在しないと親ボーンの値を代わりに返します。
Returns
- Vector3
ボーンの位置
Remarks
アバターがロードされていない場合、この関数は zero を返します。
また、任意ボーンがアバターに存在せず、かつ useParentBone
が false
だった場合にも、この関数は zero を返します。
useParentBone
が true
の場合、任意ボーンがなければ有効な親ボーンまで遡ってボーン姿勢を返します。
例えば、親指ボーンがないアバターに対して LeftThumbProximal を指定してこの関数を呼び出した場合、
左手首ボーンつまり LeftHand のボーン位置を返します。
GetBoneGlobalRotation(HumanBodyBones, bool)
指定したボーンの回転をワールド座標で取得します。
Quaternion GetBoneGlobalRotation(HumanBodyBones bone, bool useParentBone = true)
Parameters
bone
HumanBodyBonesボーン
useParentBone
booltrue
を指定した場合、bone
で指定したボーンが存在しないと親ボーンの値を代わりに返します。
Returns
- Quaternion
ボーンの回転
Remarks
アバターがロードされていない場合、この関数は identity を返します。
また、任意ボーンがアバターに存在せず、かつ useParentBone
が false
だった場合にも、この関数は identity を返します。
useParentBone
が true
の場合、任意ボーンがなければ有効な親ボーンまで遡ってボーン姿勢を返します。
例えば、親指ボーンがないアバターに対して LeftThumbProximal を指定してこの関数を呼び出した場合、
左手首ボーンつまり LeftHand のボーン回転を返します。
GetBoneLocalPosition(HumanBodyBones, bool)
指定したボーンの位置をローカル座標で取得します。
Vector3 GetBoneLocalPosition(HumanBodyBones bone, bool useParentBone = true)
Parameters
bone
HumanBodyBonesボーン
useParentBone
booltrue
を指定した場合、bone
で指定したボーンが存在しないと親ボーンの値を代わりに返します。
Returns
- Vector3
ボーンの位置
Remarks
ローカル座標は親ボーンに対しての姿勢になります。
useParentBone
が true
である場合の挙動の詳細は GetBoneGlobalPosition(HumanBodyBones, bool) も参照してください。
GetBoneLocalRotation(HumanBodyBones, bool)
指定したボーンの回転をローカル座標で取得します。
Quaternion GetBoneLocalRotation(HumanBodyBones bone, bool useParentBone = true)
Parameters
bone
HumanBodyBonesボーン
useParentBone
booltrue
を指定した場合、bone
で指定したボーンが存在しないと親ボーンの値を代わりに返します。
Returns
- Quaternion
ボーンの回転
Remarks
ローカル座標は親ボーンに対しての姿勢になります。
useParentBone
が true
である場合の挙動の詳細は GetBoneGlobalPosition(HumanBodyBones, bool) も参照してください。
GetRootPosition()
アバターの足元の位置をワールド座標の値として取得します。
Vector3 GetRootPosition()
Returns
- Vector3
アバターの足元の位置
GetRootRotation()
アバターの足元の回転をワールド座標の値として取得します。
Quaternion GetRootRotation()
Returns
- Quaternion
アバターの足元の回転
Remarks
この値は identity に近い値であることが多いですが、 ゲーム入力モードによってアバターが正面以外の方向を向いている場合には、ヨー軸方向の回転が適用されます。
HasBone(HumanBodyBones)
現在ロードされているアバターに、指定したボーンが存在するかどうかを取得します。
bool HasBone(HumanBodyBones bone)
Parameters
bone
HumanBodyBones
Returns
- bool
RightThumbProximal などのボーンはアバターによっては存在しない事があるため、そのボーンの存在判定が必要な場合にはこの関数を使用します。
アバターがロードされていない場合、この関数は
bone
の値と関係なくfalse
を返します。