NuiSkeletonCalculateBoneOrientations
Kinect for Windows 1.5, 1.6, 1.7, 1.8
Calculates bone orientations for a skeleton.
Syntax
HRESULT NuiSkeletonCalculateBoneOrientations(
const NUI_SKELETON_DATA *pSkeletonData,
NUI_SKELETON_BONE_ORIENTATION *pBoneOrientations
)
Parameters
- pSkeletonData
Type: NUI_SKELETON_DATA
[in] Pointer to the skeleton data to calculate bone orientations for. - pBoneOrientations
Type: NUI_SKELETON_BONE_ORIENTATION
Pointer to an array of NUI_SKELETON_BONE_ORIENTATION structures of dimension NUI_SKELETON_POSITION_COUNT (20). This array must be allocated by the user before calling this function.
Return Value
Type: HRESULT
Returns S_OK if successful; otherwise, returns one of the failure codes in the following table.
Error code | Description |
---|---|
E_INVALIDARG | The pSkeletonData parameter is NULL. |
E_POINTER | The pBoneOrientations parameter is NULL. |
S_FALSE | The joints required to calculate the skeleton root are not visible. Hierarchical and absolute bone orientations are set to Identity. |
Remarks
This function calculates hierarchical and absolute bone orientations for the skeleton, which can be used when animating an avatar (see the Avateering C# Sample). For hierarchical orientations, the HipCenter joint is the root of the hierarchy, and describes an absolute rotation in skeleton space. All other joints describe rotations relative to their parent bone orientation. For absolute bone orientations, each bone describes its absolute/world rotation in skeleton space. Bone orientations are returned in the same order as the joints are defined; however, the orientation of a bone is stored at the end joint for the bone. For more information about bone orientations, see Joint Orientation.
Requirements
Header: Declared in NuiSkeleton.h; however, include NuiApi.h in your project.