Documentation

Unity Engine

Download Unity

Unity Engine

GetLocalToCharacterTRS(int, out float3, out quaternion, out float3)

Returns the local to character translation, rotation and scale of the bone at the specified index.
Read time 1 minuteLast updated 5 hours ago

Definition

GetLocalToCharacterTRS(int, float3, quaternion, float3)

public readonly void GetLocalToCharacterTRS(int index, out float3 translation, out quaternion rotation, out float3 scale)

Parameters

index

The index of the bone in Skeleton.Ids, for example from Skeleton.FindBoneIndex.

translation

The local to character translation.

rotation

The local to character rotation of the bone.

scale

The local to character scale of the bone.

Remarks

The index must be at least 0 and less than AnimationStream.BoneCount.
When a bone above this bone has a non-uniform scale, the rotation and the scale in character space are approximations. The translation is exact. The combined transform shears, and a rotation with a scale can't represent a shear. To get the exact transform, use AnimationStream.GetLocalToCharacterMatrix.