Kerbal Space Program  1.12.4
 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:
VehiclePhysics.VehicleBase

Public Member Functions

void Awake ()
 
void Initialize ()
 
void SetRigidbodyTarget (Rigidbody tgt)
 
void SetWheelTransform (Vector3 position, Quaternion rotation)
 
- Public Member Functions inherited from VehiclePhysics.VehicleBase
void AddWheelBrakeTorque (int wheelIndex, float torque)
 
void DebugLogError (string message)
 
void DebugLogWarning (string message)
 
virtual int GetAxleCount ()
 
virtual object GetInternalObject (Type type)
 
Type[] GetSolverBlockTypes ()
 
SolverState GetSolverState ()
 
VehicleStateVars GetVehicleStateVars ()
 
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)
 
virtual int GetWheelsInAxle (int axle)
 
WheelStateVars[] GetWheelStateVars ()
 
TireFriction GetWheelTireFriction (int wheelIndex)
 
void NotifyCollidersChanged ()
 
void OnCollision (Collision collision, bool isCollisionEnter)
 
void RegisterVehicleBehaviour (VehicleBehaviour vb)
 
void Reposition (Vector3 position, Quaternion rotation)
 
void SetVehicleStateVars (VehicleStateVars stateVars)
 
void SetWheelRadius (int wheelIndex, float radius)
 
void SetWheelStateVars (WheelStateVars[] stateVars)
 
void SetWheelTireFriction (int wheelIndex, TireFriction friction)
 
void SetWheelTireFrictionMultiplier (int wheelIndex, float frictionMultiplier)
 
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 maxBrakeTorqueRest = 1000f
 
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
 
bool inhibitWheelSleep = false
 
int integrationSteps = 4
 
bool integrationUseRK4 = false
 
bool invertVisualWheelSpinDirection = false
 
float minimumdownForce
 
Action onBeforeIntegrationStep
 
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
 

Properties

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]
 
float time [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 bool isCollisionEnter = false
 
static VehicleBase vehicle = null
 

Member Function Documentation

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

< 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 ( )
inline
override void KSPWheelController.OnInitialize ( )
inlineprotectedvirtual

< 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 ( )
inlineprotectedvirtual

Reimplemented from VehiclePhysics.VehicleBase.

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

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
protected
float KSPWheelController.maxBrakeTorque = 0f
float KSPWheelController.maxBrakeTorqueRest = 1000f
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
get
bool KSPWheelController.IsGrounded
getset
float KSPWheelController.LegacyWheelLoad
get
Rigidbody KSPWheelController.rb
get
Rigidbody KSPWheelController.RbTgt
get
Vector3 KSPWheelController.SuspensionAxis
get
Vector3 KSPWheelController.WheelBase
get
Vector3 KSPWheelController.WheelCenter
get
Vector3 KSPWheelController.WheelDown
get
float KSPWheelController.WheelRadius
get

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