book_4_sparkGenerated
code_blocksInput

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, simply call it on an instance of SkinnedModelRenderer. The method does not take any parameters and returns an array of BoneVelocity objects, each representing the velocity of a bone in the model.

Example

// Example usage of GetBoneVelocities
SkinnedModelRenderer skinnedModelRenderer = new SkinnedModelRenderer();
Sandbox.SkinnedModelRenderer.BoneVelocity[] boneVelocities = skinnedModelRenderer.GetBoneVelocities();

foreach (var boneVelocity in boneVelocities)
{
    // Process each bone velocity
    Vector3 velocity = boneVelocity.Velocity;
    // Use the velocity for further calculations or logic
}