Export (0) Print
Expand All

NuiSkeletonCalculateBoneOrientations

Calculates bone orientations for a skeleton.

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
[out] Pointer to an array of NUI_SKELETON_BONE_ORIENTATION 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 codeDescription
E_INVALIDARGThe pSkeletonData parameter is NULL.
E_POINTERThe pBoneOrientations parameter is NULL.
S_FALSEThe joints required to calculate the skeleton root are not visible. Hierarchical and absolute bone orientations are set to Identity.

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.

Header: Declared in NuiSkeleton.h, however, include NuiApi.h in your project.

Community Additions

Show:
© 2014 Microsoft