Gravity Engine 12.0
Unity Asset for Gravity
|
Rocket Engine Interface Used to update acceleration in the massless body engine on a per-integration step basis. More...
Public Member Functions | |
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 | |
bool | engineOn |
state of engine (or the active stage of a multi-stage engine) | |
Vector3 | thrustAxis |
direction of thrust. Must be unit length. | |
Protected Attributes | |
Vector3 | accelDirection |
"live" thrust vector reflecting orientation of ship model | |
Rocket Engine Interface Used to update acceleration in the massless body engine on a per-integration step basis.
Rocket engines are used for continuous application of force over a significant time (unlike Maneuver which is used for an impulse change).
Only one GEExternalAcceleration component can be added to an NBody. If a RocketEngine plus atmosphere drag is required, then a wrapper class (e.g. EarthRocket) is needed to combine the external acceleration from the engine and the atmosphere.
The acceleration provided the engine must be adjusted to the GE internal units.
Concept: By putting engine code deep in the integrator get several advantages:
Bear in mind that the acceleration function can be called for the live scene as well as for trajectory prediction. If the implementing class is supporting trajectory prediction then it needs to either be stateless or aware of when acceleration for trajectories are being computed.
|
pure 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.
time | time for which the thrust should be determined. |
Implements GEExternalAcceleration.
Implemented in MultiStageEngine, and OneStageEngine.
|
pure virtual |
Get the current fuel remaining.
Implemented in MultiStageEngine, and OneStageEngine.
|
pure virtual |
|
pure virtual |
Set the engine throttle level (as a percent).
throttle |
Implemented in MultiStageEngine, and OneStageEngine.
|
pure virtual |
Set the thrust axis. May be over-ridden to update internals if they exist.
thrustAxis |
Implemented in MultiStageEngine, and OneStageEngine.