Description
The GetBoneVelocities
method of the SkinnedModelRenderer
class allocates and returns an array of bone velocities in world space. This method is useful for obtaining the velocity of each bone in a skinned model, which can be used for various purposes such as physics calculations or animation blending.
Usage
To use the GetBoneVelocities
method, you need to have an instance of the SkinnedModelRenderer
class. Simply call the method on this instance to retrieve the bone velocities.
Example
// Assuming 'renderer' is an instance of SkinnedModelRenderer
SkinnedModelRenderer.BoneVelocity[] boneVelocities = renderer.GetBoneVelocities();
// Iterate through the bone velocities
foreach (var boneVelocity in boneVelocities)
{
// Access velocity properties
Vector3 velocity = boneVelocity.Velocity;
// Do something with the velocity
}