Gravity Engine 12.0
Unity Asset for Gravity
Loading...
Searching...
No Matches
Maneuver Class Reference

Manuever. Holds a future course change for the spaceship. Will be triggered based on world time. More...

Inheritance diagram for Maneuver:

Public Types

enum  Mtype { vector , scalar , setv , none }
 Type of maneuver: vector: apply a dV vector scalar: apply the scalar dV amount to the vector at time of maneuver setv: set the absolute velocity at the time of the maneuver.
 
enum  RailsTransferMode { NONE , KEPLER , PKEPLER , SGP4 }
 

Public Member Functions

delegate void OnExecuted (Maneuver m)
 template for the callback to be run when the maneuver is executed
 
 Maneuver (NBody nbody, TrajectoryData.Intercept intercept)
 Create a vector maneuver at the intercept point to match trajectory that was intercepted.
 
 Maneuver (Maneuver m)
 
bool HasRelativePosVel ()
 
float GetDvScaled ()
 Return the dV in scaled units.
 
void SetDvScaled (float newDv)
 Set the deltaV for a scalar maneuver in world units (e.g. in ORBITAL units set velocity in km/hr)
 
void SetVelScaled (Vector3 newVel)
 Set the velocity change vector in world units (e.g. in ORBITAL units set velocity in km/hr)
 
void SetTimeScaled (float time)
 Set the maneuver time in world units (e.g. in ORBITAL units in hours).
 
void Execute (GravityState gs)
 Execute the maneuver. Called automatically by Gravity Engine for maneuvers that have been added to the GE via AddManeuver().
 
int Compare (Maneuver m1, Maneuver m2)
 
string LogString ()
 

Public Attributes

double worldTime
 time at which the maneuver is to occur (physical time in GE)
 
Vector3 velChange
 velocity change OR the velocity to be set (depending on the mtype: vector or setv). This field is BADLY named!
 
float dV
 scalar value of the velocity change in physics units (+ve means in-line with motion). Use GetDvScaled() for scaled value.

 
NBody nbody
 NBody to apply the course correction to.
 
Vector3d physPosition
 Position of the maneuver in internal physics units (used for error estimates and ManeuverRenderer)
 
Vector3d dVvector
 vector representing the change in velocity for the maneuver
 
NBody relativeTo
 RelativePos is used when a maneuver is relative to a body it is orbiting. This allows transfer code to program the relative maneuver without taking into account e.g. the velocity of the center body at time of arrival (which may have shifted over the duration of the transfer)
 
Vector3d relativePos
 RelativePos/Vel are used to define the r/v for use when a maneuver is mapped into a KeplerSequence or used to redefine a Kepler mode orbit.
 
Vector3d relativeVel
 
Mtype mtype = Mtype.vector
 Type of information about manuever provided.
 
string label = ""
 Label used in debug logging.
 
OnExecuted onExecuted
 Delegate to be called when the maneuver is executed (optional)
 
OnExecuted beforeExecuted
 Delegate to be called immediatly before the maneuver is executed (optional)
 
System.Object opaqueData
 generic pointer that can be used to hold data for callbacks
 
RailsTransferMode railsXferMode = RailsTransferMode.NONE
 

Detailed Description

Manuever. Holds a future course change for the spaceship. Will be triggered based on world time.

In some cases (orbital transfers) the value of the change will be recorded as a scalar. In trajectory intercept cases, a vector velocity change will be provided.

Manuevers are added to the GE. This allows them to be run at the closest possible time step (in general GE will do multiple time steps per FixedUpdate). Due to time precision the resulting trajectory may not be exactly as desired. More timesteps in the GE will reduce this error.

Manuevers support sorting based on earliest worldTime.

Maneuvers are always expressed in internal physics units of distance and velocity.

Member Enumeration Documentation

◆ RailsTransferMode

For SGP4/PKepler evolving ships, the transfer phase of the maneuver needs to be KEPLER to ensure Lambert etc. works properly. The ship then switches back to SGP4/Kepler evolution on the basis of the Sgp4TransferMode.

Constructor & Destructor Documentation

◆ Maneuver()

Maneuver.Maneuver ( NBody  nbody,
TrajectoryData::Intercept  intercept 
)

Create a vector maneuver at the intercept point to match trajectory that was intercepted.

Parameters
nbody
intercept

Member Function Documentation

◆ Execute()

void Maneuver.Execute ( GravityState  gs)

Execute the maneuver. Called automatically by Gravity Engine for maneuvers that have been added to the GE via AddManeuver().

Unusual to call this method directly.

Parameters
ge

◆ GetDvScaled()

float Maneuver.GetDvScaled ( )

Return the dV in scaled units.

Returns

◆ SetDvScaled()

void Maneuver.SetDvScaled ( float  newDv)

Set the deltaV for a scalar maneuver in world units (e.g. in ORBITAL units set velocity in km/hr)

Parameters
newDv

◆ SetTimeScaled()

void Maneuver.SetTimeScaled ( float  time)

Set the maneuver time in world units (e.g. in ORBITAL units in hours).

Parameters
time

◆ SetVelScaled()

void Maneuver.SetVelScaled ( Vector3  newVel)

Set the velocity change vector in world units (e.g. in ORBITAL units set velocity in km/hr)

Parameters
newVel

Member Data Documentation

◆ relativePos

Vector3d Maneuver.relativePos

RelativePos/Vel are used to define the r/v for use when a maneuver is mapped into a KeplerSequence or used to redefine a Kepler mode orbit.

If relativeTo is set and relativePos is zero can assume no relative pos/vel info present.


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