Class LandingGear
Class for managing the landing gear of an aircraft, including steering and animation.
Inherited Members
Namespace: NWH.Aerodynamics.AircraftController
Assembly: NWH.Aerodynamics.dll
Syntax
[Serializable]
public class LandingGear : AircraftMonoBehaviour
Fields
| Edit this page View Sourceanimator
Landing gear retract / extend animator. Can be left empty if no animation is used.
Declaration
[Tooltip("Landing gear retract / extend animator. Can be left empty if no animation is used.")]
public Animator animator
Field Value
| Type | Description |
|---|---|
| Animator |
animatorRetractName
Name of the landing gear retract state in format of [LayerName].[StateName].
Declaration
[Tooltip("Name of the landing gear retract state in format of [LayerName].[StateName].")]
public string animatorRetractName
Field Value
| Type | Description |
|---|---|
| string |
brakeTorque
Brake torque of the WheelCollider when using brakes or parking brake.
Declaration
[Tooltip("Brake torque of the WheelCollider when using brakes or parking brake.")]
public float brakeTorque
Field Value
| Type | Description |
|---|---|
| float |
frictionForce
Rolling friction force applied when the landing gear wheel is touching the ground.
Declaration
[Tooltip("Rolling friction force applied when the landing gear wheel is touching the ground.")]
public float frictionForce
Field Value
| Type | Description |
|---|---|
| float |
isExtended
True if landing gear is extended. Does not take into account animation duration so will be toggled as soon as the input is pressed.
Declaration
[Tooltip(" True if landing gear is extended. Does not take into account animation duration\r\n so will be toggled as soon as the input is pressed.")]
public bool isExtended
Field Value
| Type | Description |
|---|---|
| bool |
lockBrakesOnSleep
Should the brakes be engaged when the vehicle is put to sleep?
Declaration
[Tooltip("Should the brakes be engaged when the vehicle is put to sleep?")]
public bool lockBrakesOnSleep
Field Value
| Type | Description |
|---|---|
| bool |
lowerSuspensionArm
Lower suspension arm transform. Requires proper rotation/pivot.
Declaration
[Tooltip("Lower suspension arm transform. Requires proper rotation/pivot.")]
public Transform lowerSuspensionArm
Field Value
| Type | Description |
|---|---|
| Transform |
maxSteerAngle
Maximum steer angle for the landing gear. Set to 0 to disable.
Declaration
[Tooltip("Maximum steer angle for the landing gear. Set to 0 to disable.")]
public float maxSteerAngle
Field Value
| Type | Description |
|---|---|
| float |
parkingBrakeActivateOnStart
Should parking brake be active on start?
Declaration
[Tooltip("Should parking brake be active on start?")]
public bool parkingBrakeActivateOnStart
Field Value
| Type | Description |
|---|---|
| bool |
parkingBrakeActive
Is the parking brake currently active?
Declaration
[Tooltip("Is the parking brake currently active?")]
public bool parkingBrakeActive
Field Value
| Type | Description |
|---|---|
| bool |
position
Position of the landing gear on an aircraft.
Declaration
[Tooltip("Position of the landing gear on an aircraft.")]
public LandingGear.LandingGearPosition position
Field Value
| Type | Description |
|---|---|
| LandingGear.LandingGearPosition |
releaseBrakesOnWake
Should brakes be released when the vehicle is woken up?
Declaration
[Tooltip("Should brakes be released when the vehicle is woken up?")]
public bool releaseBrakesOnWake
Field Value
| Type | Description |
|---|---|
| bool |
retractable
Does the landing gear retract?
Declaration
[Tooltip("Does the landing gear retract?")]
public bool retractable
Field Value
| Type | Description |
|---|---|
| bool |
staticTransform
Static transform that is kept at constant offset to the wheel position. Can be used for wheel hood, brake system or other objects that move but do not rotate with the wheel. Requires proper rotation/pivot.
Declaration
[Tooltip(" Static transform that is kept at constant offset to the wheel position. Can be used for wheel hood, brake system\r\n or other objects that move but do not rotate with the wheel. Requires proper rotation/pivot.")]
public Transform staticTransform
Field Value
| Type | Description |
|---|---|
| Transform |
steerSpeed
Speed of steering angle change for the WheelCollider.
Declaration
[Range(0, 1)]
[Tooltip("Speed of steering angle change for the WheelCollider.")]
public float steerSpeed
Field Value
| Type | Description |
|---|---|
| float |
upperSuspensionArm
Upper suspension arm transform. Requires proper rotation/pivot.
Declaration
[Tooltip("Upper suspension arm transform. Requires proper rotation/pivot.")]
public Transform upperSuspensionArm
Field Value
| Type | Description |
|---|---|
| Transform |
wheel
The transform representing the wheel. Correct pivot/rotation required.
Declaration
[Tooltip("The transform representing the wheel. Correct pivot/rotation required.")]
public Transform wheel
Field Value
| Type | Description |
|---|---|
| Transform |
wheelCollider
Target WheelCollider.
Declaration
[Tooltip("Target WheelCollider.")]
public WheelCollider wheelCollider
Field Value
| Type | Description |
|---|---|
| WheelCollider |
Methods
| Edit this page View SourceExtend()
Extends the landing gear by playing the retract animation in reverse. Called when gear extension is commanded. No effect if animator is not assigned.
Declaration
public void Extend()
FixedUpdate()
Declaration
public void FixedUpdate()
Retract()
Retracts the landing gear by playing the retract animation forward. Called when gear retraction is commanded. No effect if animator is not assigned.
Declaration
public void Retract()
Start()
Declaration
public void Start()