Represents the skeleton of an avatar. Contains functions to map the information from one avatar to the another base on T pose.
More...
Inherits MonoBehaviour.
|
|
virtual void | Awake () |
| | Use this for initialization.
|
| |
| string | boneIndex2Name (int boneIndex) |
| | Converts a bone index to its corresponding name in the Mecanim humanoid model.
|
| |
| Transform | boneIndex2Transform (int boneIndex) |
| | Retrieves the Transform of a bone based on its index.
|
| |
| int | boneIndexCount () |
| | Returns the number of bone indexes in the AvatarSkeleton.
|
| |
| EnableBody | GetSkeletonData (bool global) |
| | Gets avatar's joint positions and orientations relative to initial T-Pose. Needs to cache ebody so only calculated if needed.
|
| |
| void | SetFromBody (EnableBody body, float duration, float speed=1.0f, bool usePositionData=false, bool mirror=false) |
| | Sets the Avatar's joints using EnableBody as relative-to-Tpose rotation data.
|
| |
|
| static void | GetAvatarSkeleton (GameObject mygameObject, ref AvatarSkeleton avatarSkeleton) |
| | Retrieves an instance of the AvatarSkeleton component attached to the given GameObject or adds the component if it is not found.
|
| |
|
|
bool | globalData = true |
| | Boolean indicates whether using global data in the AvatarSkeleton class.
|
| |
|
Animator | animatorComponent |
| | The animator component attached to the AvatarSkeleton.
|
| |
|
GameObject | offsetNode |
| | Avatar's offset/parent object that may be used to rotate and position the model in space.
|
| |
|
BoneControllerInterface | boneControllerInterface |
| | Represents the interface for controlling bone operations in the AvatarSkeleton class.
|
| |
|
|
static readonly Dictionary< int, HumanBodyBones > | boneIndex2MecanimMap |
| | Dictionary for looking up which avatar bones we are interested in. For now, we are only interested in the ones that kinect provides.
|
| |
|
|
virtual void | MapBones () |
| | If the bones to be mapped have been declared, map that bone to the model.
|
| |
|
void | GetInitialRotations () |
| | Capture the initial rotations of the bones.
|
| |
|
|
Transform[] | bones |
| | Variable to hold all them bones. It will initialize the same size as initialRotations.
|
| |
|
Quaternion[] | initialRotations |
| | Rotations of the bones when in T-Pose.
|
| |
|
Vector3 | initialPosition |
| | Initial position and rotation of the body.
|
| |
Represents the skeleton of an avatar. Contains functions to map the information from one avatar to the another base on T pose.
◆ boneIndex2Name()
| string Enablegames.AvatarSkeleton.boneIndex2Name |
( |
int | boneIndex | ) |
|
|
inline |
Converts a bone index to its corresponding name in the Mecanim humanoid model.
- Parameters
-
| boneIndex | The index of the bone. |
- Returns
- The name of the bone.
◆ boneIndex2Transform()
| Transform Enablegames.AvatarSkeleton.boneIndex2Transform |
( |
int | boneIndex | ) |
|
|
inline |
Retrieves the Transform of a bone based on its index.
- Parameters
-
| boneIndex | The index of the bone. |
- Returns
- The Transform of the bone.
◆ boneIndexCount()
| int Enablegames.AvatarSkeleton.boneIndexCount |
( |
| ) |
|
|
inline |
Returns the number of bone indexes in the AvatarSkeleton.
- Returns
- The count of bone indexes in the AvatarSkeleton.
◆ GetAvatarSkeleton()
| static void Enablegames.AvatarSkeleton.GetAvatarSkeleton |
( |
GameObject | mygameObject, |
|
|
ref AvatarSkeleton | avatarSkeleton ) |
|
inlinestatic |
Retrieves an instance of the AvatarSkeleton component attached to the given GameObject or adds the component if it is not found.
- Parameters
-
| mygameObject | The GameObject to search for the AvatarSkeleton component. |
| avatarSkeleton | A reference to the AvatarSkeleton component. |
◆ GetSkeletonData()
| EnableBody Enablegames.AvatarSkeleton.GetSkeletonData |
( |
bool | global | ) |
|
|
inline |
Gets avatar's joint positions and orientations relative to initial T-Pose. Needs to cache ebody so only calculated if needed.
- Parameters
-
| global | Only global is currently supported |
- Returns
◆ SetFromBody()
| void Enablegames.AvatarSkeleton.SetFromBody |
( |
EnableBody | body, |
|
|
float | duration, |
|
|
float | speed = 1::0f, |
|
|
bool | usePositionData = false, |
|
|
bool | mirror = false ) |
|
inline |
Sets the Avatar's joints using EnableBody as relative-to-Tpose rotation data.
- Parameters
-
| body | T-pose offset rotation data |
| duration | How quickly to get to final pose |
| speed | Multiplier to duration |
| usePositionData | Whether to use or ignore joint positions (and only use orientations) |
The documentation for this class was generated from the following file:
- /Users/yiyangshang/egdl2/Assets/eag/Scripts/enablegames/Avatar/AvatarSkeleton.cs