Kerbal Space Program  1.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
KSPWheelController Class Reference
Inheritance diagram for KSPWheelController:

Public Member Functions

void Awake ()
void Initialize ()
void SetRigidbodyTarget (Rigidbody tgt)
void SetWheelTransform (Vector3 position, Quaternion rotation)
- Public Member Functions inherited from VehiclePhysics.VehicleBase
virtual object GetInternalObject (Type type)
Vector2 GetWheelAdherentSlip (int wheelIndex)
float GetWheelAngularVelocityForSlip (int wheelIndex, float slip)
virtual int GetWheelIndex (int axle, WheelPos position=WheelPos.Default)
Vector3 GetWheelLocalPosition (VPWheelCollider wheelCol)
Vector2 GetWheelPeakSlip (int wheelIndex)
float GetWheelRadius (int wheelIndex)
TireFriction GetWheelTireFriction (int wheelIndex)
void NotifyCollidersChanged ()
void OnCollision (Collision collision, bool forceImpact)
void RegisterVehicleBehaviour (VehicleBehaviour vb)
void Reposition (Vector3 position, Quaternion rotation)
void SetWheelRadius (int wheelIndex, float radius)
void SetWheelTireFriction (int wheelIndex, TireFriction friction)
void SingleStep ()
void UnregisterVehicleBehaviour (VehicleBehaviour vb)

Static Public Member Functions

static KSPWheelController Create (Rigidbody rb, GameObject host, GameObject wheelColliderHost)

Public Attributes

float brakeInput = 0.0f
float brakeResponse = 0f
float brakeState = 0.0f
float driveInput = 0.0f
float driveResponse = 0f
float driveState = 0.0f
bool keyboardBrakes
bool keyboardDrive
bool keyboardSteering
float maxBrakeTorque = 0f
float maxDriveTorque = 0f
float maxRpm = 0f
float maxSteerAngle = 0f
Func< WheelState, bool > OnShouldIgnoreForces = (ws) => { return true; }
float steeringResponse = 0f
float steerInput = 0.0f
float steerState = 0.0f
Rigidbody tgtRb
TireFriction tireFriction = new TireFriction()
Transform wcTransform
 The direct drive motor that will power the wheel. More...
VPWheelCollider wheelCollider
float wheelDamping = 0.95f
 I assume this one works as a scalar, so a value of 1 would mean no damping, while zero would be a jammed wheel. In any case, default from the core code is 0.95 – Harv More...
- Public Attributes inherited from VehiclePhysics.VehicleBase
bool accurateSuspensionForces = true
bool advancedSuspensionDamper = false
Transform centerOfMass
bool contactAngleAffectsTireForce = true
DataBus data = new DataBus()
bool disableContactProcessing = false
KSPWheelGravity gravity = new KSPWheelGravity()
float impactInterval = 0.2f
float impactIntervalRandom = 0.4f
float impactMinSpeed = 2.0f
float impactThreeshold = 0.6f
int integrationSteps = 2
bool integrationUseRK4 = false
bool invertVisualWheelSpinDirection = false
Action onBeforeUpdateBlocks
Action onImpact
Action onPreDynamicsStep
Action onPreVisualUpdate
Action onRawCollision
float scaleFactor = 1.0f
bool showContactGizmos = true
float suspensionDamperLimitFactor = 2.0f
float suspensionForceSharpness = 5f
bool suspensionForceSmoothing = true
float tireForceSharpness = 5f
bool tireForceSmoothing = true
float tireImpulseRatio = 0.5f
bool tireSideDeflection = false
float tireSideDeflectionRate = 10.0f
VehicleSleepCriteria vehicleSleepCriteria = VehicleSleepCriteria.Strict
float wheelSleepVelocity = 0.2f

Protected Member Functions

override void DoUpdateBlocks ()
override void OnInitialize ()
override void OnUpdate ()
- Protected Member Functions inherited from VehiclePhysics.VehicleBase
virtual void DoUpdateData ()
virtual void OnFinalize ()
void SetNumberOfWheels (int numberOfWheels)

Protected Attributes

DirectDrive m_directDrive


WheelState currentState [get]
bool IsGrounded [get, set]
float LegacyWheelLoad [get]
Rigidbody rb [get]
Rigidbody RbTgt [get]
Vector3 SuspensionAxis [get]
Vector3 WheelBase [get]
Vector3 WheelCenter [get]
Vector3 WheelDown [get]
float WheelRadius [get]
- Properties inherited from VehiclePhysics.VehicleBase
Rigidbody cachedRigidbody [get]
Transform cachedTransform [get]
GroundMaterialManagerBase groundMaterialManager [get, set]
bool initialized [get, set]
bool isHardDrag [get]
bool isHardImpact [get]
Collider lastContactedCollider [get, set]
Vector3 localAcceleration [get]
Vector3 localDragPosition [get]
Vector3 localDragVelocity [get]
Vector3 localImpactPosition [get]
Vector3 localImpactVelocity [get]
bool paused [get, set]
float speed [get]
float speedAngle [get]
int wheelCount [get]
Wheel[] wheels [get]
WheelState[] wheelState [get]

Additional Inherited Members

- Public Types inherited from VehiclePhysics.VehicleBase
enum  VehicleSleepCriteria { VehicleSleepCriteria.Strict, VehicleSleepCriteria.Relaxed }
enum  WheelPos { WheelPos.Default = 0, WheelPos.Left = 0, WheelPos.Right = 99 }
- Static Public Attributes inherited from VehiclePhysics.VehicleBase
static Collision currentCollision = null
static VehicleBase vehicle = null

Member Function Documentation

void KSPWheelController.Awake ( )
static KSPWheelController KSPWheelController.Create ( Rigidbody  rb,
GameObject  host,
GameObject  wheelColliderHost 
override void KSPWheelController.DoUpdateBlocks ( )

< Feed the DirectDrive with the values and input from the controller's properties

< Set the brakes at the VPWheel component

Reimplemented from VehiclePhysics.VehicleBase.

void KSPWheelController.Initialize ( )
override void KSPWheelController.OnInitialize ( )

< Our wheels never sleep, since they only have one wheel per vehicle anyway.

< Initialize the DirectDrive and connect its output to the wheel's input

Reimplemented from VehiclePhysics.VehicleBase.

override void KSPWheelController.OnUpdate ( )

Reimplemented from VehiclePhysics.VehicleBase.

void KSPWheelController.SetRigidbodyTarget ( Rigidbody  tgt)
void KSPWheelController.SetWheelTransform ( Vector3  position,
Quaternion  rotation 

Member Data Documentation

float KSPWheelController.brakeInput = 0.0f
float KSPWheelController.brakeResponse = 0f
float KSPWheelController.brakeState = 0.0f
float KSPWheelController.driveInput = 0.0f
float KSPWheelController.driveResponse = 0f
float KSPWheelController.driveState = 0.0f
bool KSPWheelController.keyboardBrakes
bool KSPWheelController.keyboardDrive
bool KSPWheelController.keyboardSteering
DirectDrive KSPWheelController.m_directDrive
float KSPWheelController.maxBrakeTorque = 0f
float KSPWheelController.maxDriveTorque = 0f
float KSPWheelController.maxRpm = 0f
float KSPWheelController.maxSteerAngle = 0f
Func<WheelState, bool> KSPWheelController.OnShouldIgnoreForces = (ws) => { return true; }
float KSPWheelController.steeringResponse = 0f
float KSPWheelController.steerInput = 0.0f
float KSPWheelController.steerState = 0.0f
Rigidbody KSPWheelController.tgtRb
TireFriction KSPWheelController.tireFriction = new TireFriction()
Transform KSPWheelController.wcTransform

The direct drive motor that will power the wheel.

VPWheelCollider KSPWheelController.wheelCollider
float KSPWheelController.wheelDamping = 0.95f

I assume this one works as a scalar, so a value of 1 would mean no damping, while zero would be a jammed wheel. In any case, default from the core code is 0.95 – Harv

Property Documentation

WheelState KSPWheelController.currentState
bool KSPWheelController.IsGrounded
float KSPWheelController.LegacyWheelLoad
Rigidbody KSPWheelController.rb
Rigidbody KSPWheelController.RbTgt
Vector3 KSPWheelController.SuspensionAxis
Vector3 KSPWheelController.WheelBase
Vector3 KSPWheelController.WheelCenter
Vector3 KSPWheelController.WheelDown
float KSPWheelController.WheelRadius

The documentation for this class was generated from the following file: