Gravity Engine 12.0
Unity Asset for Gravity
Loading...
Searching...
No Matches
OneStageEngine Class Reference
Inheritance diagram for OneStageEngine:
RocketEngine GEExternalAcceleration

Public Member Functions

override void SetThrottlePercent (float throttlePercent)
 Set the engine throttle level (as a percent).
 
override void SetEngine (bool on)
 Set engine state to on.
 
override double[] acceleration (double time, GravityState gravityState, ref double massKg)
 Determine the acceleration at the specified time. The accleration returned must be in the physical units used by the integrators. For GE units other than DIMENSIONLESS this will involve some use of GravityScalar conversion functions. See the MultiStageEngine implementation for an example.
 
override float GetFuel ()
 Get the current fuel remaining.
 
override void SetThrustAxis (Vector3 thrustAxis)
 Set the thrust axis. May be over-ridden to update internals if they exist.
 
override float GetThrottlePercent ()
 
- Public Member Functions inherited from RocketEngine
abstract void SetThrustAxis (Vector3 thrustAxis)
 Set the thrust axis. May be over-ridden to update internals if they exist.
 
abstract double[] acceleration (double time, GravityState gravityState, ref double massKg)
 Determine the acceleration at the specified time. The accleration returned must be in the physical units used by the integrators. For GE units other than DIMENSIONLESS this will involve some use of GravityScalar conversion functions. See the MultiStageEngine implementation for an example.
 
abstract void SetEngine (bool state)
 Set engine state to on.
 
bool IsEngineOn ()
 
abstract void SetThrottlePercent (float throttle)
 Set the engine throttle level (as a percent).
 
abstract float GetThrottlePercent ()
 
abstract float GetFuel ()
 Get the current fuel remaining.
 
void SetRotation (Quaternion rotation)
 
double[] acceleration (double time, GravityState gravityState, ref double massKg)
 Determine the acceleration at the specified time for the provided gravity state.
 

Public Attributes

double massEmpty
 Implementation for a chemical rocket engine. Inputs are in the SI units indicated.

 
double massFuel
 mass of fuel in kg
 
double burnRate
 burn rate in kg/sec
 
double thrust
 thrust of engine in N
 
- Public Attributes inherited from RocketEngine
bool engineOn
 state of engine (or the active stage of a multi-stage engine)
 
Vector3 thrustAxis
 direction of thrust. Must be unit length.
 

Additional Inherited Members

- Protected Attributes inherited from RocketEngine
Vector3 accelDirection
 "live" thrust vector reflecting orientation of ship model
 

Member Function Documentation

◆ acceleration()

override double[] OneStageEngine.acceleration ( double  time,
GravityState  gravityState,
ref double  massKg 
)
virtual

Determine the acceleration at the specified time. The accleration returned must be in the physical units used by the integrators. For GE units other than DIMENSIONLESS this will involve some use of GravityScalar conversion functions. See the MultiStageEngine implementation for an example.

When used in trajectory mode, this function may be called more than once for a given time, and as thrust changes. It will also be called for future times to determine the future path of the rocket.

Parameters
timetime for which the thrust should be determined.
Returns
acceleration in [0..2], mass in [3]

Implements RocketEngine.

◆ GetFuel()

override float OneStageEngine.GetFuel ( )
virtual

Get the current fuel remaining.

Returns
Amount of fuel in the current stage

Implements RocketEngine.

◆ GetThrottlePercent()

override float OneStageEngine.GetThrottlePercent ( )
virtual

Implements RocketEngine.

◆ SetEngine()

override void OneStageEngine.SetEngine ( bool  state)
virtual

Set engine state to on.

Parameters
state

Implements RocketEngine.

◆ SetThrottlePercent()

override void OneStageEngine.SetThrottlePercent ( float  throttle)
virtual

Set the engine throttle level (as a percent).

Parameters
throttle

Implements RocketEngine.

◆ SetThrustAxis()

override void OneStageEngine.SetThrustAxis ( Vector3  thrustAxis)
virtual

Set the thrust axis. May be over-ridden to update internals if they exist.

Parameters
thrustAxis

Implements RocketEngine.

Member Data Documentation

◆ massEmpty

double OneStageEngine.massEmpty

Implementation for a chemical rocket engine. Inputs are in the SI units indicated.

mass of empty ship (no fuel) in kg


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