Module drag
This API is added by CC: VS and allows CC: Tweaked computers to access information from Valkyrien Skies' Drag Controller.
Functions
| getDragForce () | Gets the total drag force applied to this ship, in the form of a scaled vector |
| getLiftForce () | Gets the total lift force applied to this ship, in the form of a scaled vector |
| enableDrag () | Enables drag on this body if it were previously disabled |
| disableDrag () | Disables drag on this body, meaning it will not be affected by drag forces. |
| enableLift () | Enables lift on this body if it were previously disabled |
| disableLift () | Disables lift on this body, meaning it will not be affected by lift forces or torques |
| enableRotDrag () | Enables rotational drag on this body if it were previously disabled |
| disableRotDrag () | Disables rotational drag on this body, meaning it will not be affected by rotational drag forces or torques |
| setWindDirection (direction) | Sets the constant wind direction for this ship |
| setWindSpeed (speed) | Sets the constant wind speed for this ship |
| applyWindImpulse (direction, speed) | Applies a wind impulse to the ship in the specified direction with the given speed. |
Functions
- getDragForce ()
-
Gets the total drag force applied to this ship, in the form of a scaled vector
Returns:
-
vector
The total drag force applied to this ship
Raises:
This method errors if there is no Ship associated with the computer - getLiftForce ()
-
Gets the total lift force applied to this ship, in the form of a scaled vector
Returns:
-
vector
The total lift force applied to this ship
Raises:
This method errors if there is no Ship associated with the computer - enableDrag ()
-
Enables drag on this body if it were previously disabled
Raises:
This method errors if there is no Ship associated with the computer OR if the computer is not a Command Computer and the configuration disallows it. - disableDrag ()
-
Disables drag on this body, meaning it will not be affected by drag forces. Additionally, wind forces will default to the fallback Weather2 Compat implementation
Raises:
This method errors if there is no Ship associated with the computer OR if the computer is not a Command Computer and the configuration disallows it. - enableLift ()
-
Enables lift on this body if it were previously disabled
Raises:
This method errors if there is no Ship associated with the computer OR if the computer is not a Command Computer and the configuration disallows it. - disableLift ()
-
Disables lift on this body, meaning it will not be affected by lift forces or torques
Raises:
This method errors if there is no Ship associated with the computer OR if the computer is not a Command Computer and the configuration disallows it. - enableRotDrag ()
-
Enables rotational drag on this body if it were previously disabled
Raises:
This method errors if there is no Ship associated with the computer OR if the computer is not a Command Computer and the configuration disallows it. - disableRotDrag ()
-
Disables rotational drag on this body, meaning it will not be affected by rotational drag forces or torques
Raises:
This method errors if there is no Ship associated with the computer OR if the computer is not a Command Computer and the configuration disallows it. - setWindDirection (direction)
-
Sets the constant wind direction for this ship
Parameters:
- direction vector The new constant wind direction
Raises:
This method errors if there is no Ship associated with the computer OR if the computer is not a Command Computer and the configuration disallows it. - setWindSpeed (speed)
-
Sets the constant wind speed for this ship
Parameters:
- speed number The new constant wind speed, clamped to 0 minimum
Raises:
This method errors if there is no Ship associated with the computer OR if the computer is not a Command Computer and the configuration disallows it. - applyWindImpulse (direction, speed)
-
Applies a wind impulse to the ship in the specified direction with the given speed. Speed should not be negative. Please flip the direction vector instead
Parameters:
- direction vector The direction of the wind impulse, should be a normalized vector
- speed number The speed of the wind impulse, should be a positive value
Raises:
This method errors if there is no Ship associated with the computer OR if the computer is not a Command Computer and the configuration disallows it.