Creates a new VRMSpringBonePhysicsStrategy instance.
Applies the calculated rotation to the spring bone based on the new tail position.
This method calculates the rotation needed to orient the bone from its head to the new tail position. It takes into account the parent's rotation and the bone's rest rotation to compute the final local rotation.
The new tail position in world space
The spring bone to apply rotation to
The calculated local rotation quaternion for the bone
Handles collision detection and response for the spring bone.
This method checks for collisions between the spring bone and all colliders in the provided collision groups. It supports both sphere and capsule colliders. When a collision is detected, the bone's tail position is adjusted to resolve the collision, and the bone length is re-normalized.
Array of collision groups containing colliders
The target tail position to check for collisions
The radius of the bone for collision detection
The spring bone being tested for collisions
The adjusted tail position after collision resolution
Gets the parent rotation of the specified scene graph component.
The scene graph component to get the parent rotation for
The parent's rotation quaternion, or identity quaternion if no parent exists
Normalizes the bone length to maintain the original bone length constraint.
This method ensures that the spring bone maintains its original length regardless of the forces applied during simulation. It calculates the direction from the bone's head to the target tail position and scales it to match the original bone length.
The target tail position before normalization
The spring bone to normalize
The normalized tail position maintaining the original bone length
Processes the physics simulation for a single spring bone.
This method performs the complete physics simulation pipeline:
Array of collision groups for collision detection
The spring bone to process
Optional
center: SceneGraphComponentOptional center transform for coordinate space conversion
Sets the VRM spring system to be managed by this physics strategy.
The VRM spring system containing bones and configuration
Internal update method that processes all spring bones in the system.
Array of VRM spring bones to update
The VRM spring system containing configuration and colliders
Physics strategy implementation for VRM spring bone simulation.
This class handles the physics simulation of VRM spring bones, which are used to create realistic secondary animation for hair, clothing, accessories, and other flexible parts of VRM models. The simulation includes:
The physics simulation runs per frame and updates the rotation of spring bone nodes based on physical forces and constraints.