ComputeLocalToCharacter
Compute matrices in LocalToCharacter space with the specified offset. For example, if you want to compute the LocalToWorld matrices of the rig, pass in the LocalToWorld matrix of the root as the offset parameter.
Read time 1 minuteLast updated 4 hours ago
Definition
- Type: Method
- Namespace: Unity.Animations
- Assembly: UnityEngine.AnimationCoreModule
ComputeLocalToCharacter(AnimationStream, AffineTransform, NativeArray<AffineTransform>)
Compute matrices in LocalToCharacter space with the specified offset. For example, if you want to compute the LocalToWorld matrices of the rig, pass in the LocalToWorld matrix of the root as the offset parameter.
public static void ComputeLocalToCharacter(ref AnimationStream stream, AffineTransform offset, NativeArray<AffineTransform> outMatrices)
Parameters
Animation stream
An extra offset which applies to all matrices
Resulting matrix computation. This array must be preallocated with the same bone count specified by the RigDefinition.
ComputeLocalToCharacter(AnimationStream, AffineTransform, NativeArray<AffineTransform>, AffineTransform, NativeArray<AffineTransform>)
Compute two sets of matrices in LocalToCharacter space with specified offsets. For example, if you want to compute the LocalToWorld matrices of the rig, pass in the LocalToWorld matrix of the root as the offset parameter. This method is used to conveniently compute the LocalToCharacter and LocalToWorld matrices of an AnimationStream in one pass.
public static void ComputeLocalToCharacter(ref AnimationStream stream, AffineTransform offset1, NativeArray<AffineTransform> outMatrices1, AffineTransform offset2, NativeArray<AffineTransform> outMatrices2)
Parameters
Animation stream
An extra offset which applies to all matrices in outMatrices1
Resulting matrix computation using offset1. This array must be preallocated with the same bone count specified by the RigDefinition.
An extra offset which applies to all matrices in outMatrices2
Resulting matrix computation using offset2. This array must be preallocated with the same bone count specified by the RigDefinition.