KSPWheel ‐ Part Modules - shadowmage45/KSPWheel GitHub Wiki
Part Modules
Base Module
The base module is responsible for organizing and linking together of wheel sub-modules. Each sub-module is responsible for a single function for one or more wheel colliders that are defined in the base module.
KSPWheelBase
- Manages a group of submodules
- Controls spring and damper ratio for all wheels that it manages
- Handles physics updating of wheel collider instances
- Multiple KSPWheelBase may be present on a part, each responsible for its own group of sub-modules
Per-Wheel Modules
These modules use the 'wheelIndex' defined in the sub-module to determine which wheel-collider from their base module they use for data (suspension, steering, rotation, motor). Uses the 'baseModuleIndex' to determine which base-module to be linked to.
KSPWheelSuspension
- Updates a visible suspension mesh to follow the wheel position as determined by the wheel collider.
- Also manages lerping of suspension meshes during deployment animations.
- Manages landing-leg 'locked suspension' mechanics.
KSPWheelSteering
- Queries raw input state for steering, manipulates input from limit and response values, determines resultant wheel steering angle, and updates a single wheel collider with that steering information.
KSPWheelRotation
- Manages the wheel rotation for a single wheel-collider. Rotates a visible wheel mesh according to the calculated RPM of the wheel collider.
KSPWheelMotor
- Queries raw input state for motor, manipulates input from limit and response values, determines resultant torque output for a single wheel and updates wheel collider with that information, as well as managing EC draw for that wheel.
KSPWheelBrakes
- Queries raw input state for brakes, manipulates input from limit and response values, determines resultant torque output for a single wheel, and updates wheel collider with that information.
KSPWheelBogey
- Manages a wheel or landing legs 'foot'. Points it at the ground.
KSPWheelRepulsor
- Special module intended for KF repulsors.
- Updates suspension length and spring force based on power state and user configuration.
- Animates the repulsor grid texture
- Handles repulsor sound-effects based on power use.
- Handles force application when floating on water.
- Handles EC use based on current supported mass.
Per-Base Modules
These modules manage the entire set of wheel-colliders that are defined in the base module. It should not be necessary to add more than one of these per base module.
KSPWheelDeployment
- Manages the animation(s) for base module. Can link together multiple animations to be played simultaneously.
- Manages temporary 'stand-in-colliders' to enable smooth deployment of wheels and landing legs prior to wheel collider physics being enabled.
KSPWheelTracks
- Special sub-class extension of motor-module.
- Manages updating of tracks textures
- Manages averaging of motor and brake input across multiple wheel collider instances, keeping torque and RPM in synch across the entire set.
KSPWheelDamage
- Checks for load and speed, updates wheel damage state.
- Manages both 'simple' and 'advanced' damage models.
KSPWheelWaterPropulsion
- Manages water-propulsion for each wheel in a base module.
- Uses submersion depth and wheel inertia and a configurable efficiency factor to determine force output for a wheel while in the splashed state.