Class RiggingModule
Module for animating rigged vehicle models through procedural bone manipulation.
Inherited Members
Namespace: NWH.VehiclePhysics2.Modules.Rigging
Assembly: NWH.VehiclePhysics2.dll
Syntax
[Serializable]
public class RiggingModule : VehicleComponent
Remarks
The RiggingModule provides procedural animation for vehicle models that have bone-based rigs, commonly used for suspension components, axles, and other mechanical parts that need to move in response to physics simulation. This module bridges the gap between the physics simulation and visual representation by manipulating bone transforms in real-time.
Key Features: - Automatic bone positioning based on wheel and suspension movement - Support for single and double-sided bone configurations - LookAt functionality for accurate directional alignment - Bone stretching to maintain connections between moving parts - Compatible with any rigged 3D model from 3D modeling software
Common Use Cases: - Animating suspension arms that track wheel movement - Rotating axles and driveshafts - Adjusting control arms and tie rods - Moving hydraulic pistons and shock absorbers - Any mechanical linkage that needs procedural animation
Setup: Each bone in the list represents a single animated element. Configure the bone's transform reference, target transform(s), and animation options. The module will automatically update bone positions and rotations each frame based on the target positions.
This module is particularly useful for vehicles with exposed mechanical components or when using high-quality vehicle models with pre-rigged suspension systems. It provides more realistic visual feedback than simple wheel movement alone.
For more information visit: https://nwhcoding.com/VehiclePhysics/manual/RiggingModule.html
Fields
bones
List of bones to be animated by the rigging system.
Declaration
public List<Bone> bones
Field Value
| Type | Description |
|---|---|
| List<Bone> |
Remarks
Each bone represents a single animatable element in the vehicle rig. Bones can be configured to track wheel positions, suspension movement, or any other dynamic vehicle component.
Add bones for: - Suspension arms (upper and lower control arms) - Axles and half-shafts - Steering linkages - Shock absorbers and springs - Any other mechanical component that needs animation
Methods
VC_Initialize()
Initializes all bones in the rigging system.
Declaration
protected override void VC_Initialize()
Overrides
Remarks
Calls Initialize() on each bone to cache initial distances and scales. This establishes the reference state for bone stretching calculations.
VC_Update(float)
Updates all bone transforms based on their target positions.
Declaration
public override void VC_Update(float DeltaTime)
Parameters
| Type | Name | Description |
|---|---|---|
| float | DeltaTime | Frame delta time in seconds. |
Overrides
Remarks
Called every frame to update the visual representation of the rigged components. Each bone is updated with the current vehicle orientation to maintain proper alignment relative to the vehicle body.
The update process for each bone: - Calculates target position based on wheel or component location - Applies LookAt rotation if enabled - Stretches or compresses the bone to match target distance - Handles double-sided bones by centering between two targets