Gravity Engine 2 3.0
Loading...
Searching...
No Matches
GravityEngine2.TransferShip Class Reference

Class to determine the maneuvers required to get a ship at an existing position in orbit around a center body to a specified orbit. More...

Public Types

enum  LambertTimeType { RELATIVE_TO_NOMINAL , WORLD_TIME }
 
enum  Status {
  OK , FAILED , DEST_NOT_CIRCULAR , SHIP_NOT_CIRCULAR ,
  HIT_PLANET
}
 
enum  TargetMode {
  SHIP_TO_ORBIT , TARGET_ORBIT , TARGET_RDVS , TARGET_INTERCEPT ,
  SHIP_TO_POINT , CIRCULARIZE
}
 

Public Member Functions

 TransferShip (GEBodyState shipState, Orbital.COE toOrbit, double mu, double circleThreshold=Orbital.SMALL_E, bool checkHit=false, double planetRadius=0.0, bool retrograde=false)
 Constructor for case with a target orbit.
 
Status Compute (TargetMode targetMode)
 
double GetDvTotal ()
 
List< GEManeuverManeuvers (int centerId=-1)
 Return the list of maneuvers. These will be relative maneuvers and will be set to begin at t=0.
 
void SetTargetPoint (double3 p)
 Set the transfer point in GE internal units.
 
void SetTimeFactor (double tf)
 
void SetTimeMode (LambertTimeType timeMode)
 
void SetTimeTransfer (double t)
 
double TimeComplete ()
 The relative time from start of maneuvers when the sequence will be complete. This will always be the time of the last maneuver.
 

Public Attributes

bool lambertAlways = false
 

Detailed Description

Class to determine the maneuvers required to get a ship at an existing position in orbit around a center body to a specified orbit.

There are two general classes of ship transfers: SHIP_TO_ORBIT: Transfer the ship to a designated target orbit, but do not care which exact point the target orbit is entered.

SHIP_TO_TARGET: Transfer the ship to the position of a target object or a target point in physics space. This can be either a rendezvous (in which a second maneuver will match the target's velocity) or intercept in which there is no second maneuver.

SHIP_TO_POINT: Determine a transfer that gets the ship to the point specified. The point must be set with SetTransferPoint()

The specific transfer mode can be one of: BEST: If the orbits are circular, do Hohmann. Otherwise do a LAMBERT. CIRCULARIZE: HOHMANN: Explicitly request a Hohmann transfer. May fail if orbits are not circular. LAMBERT: Perform a LAMBERT transfer using the timeFactor * t_minimumEnergy for the indicated start and end points.

Q: What is end point for a Lambert to a target orbit??

In all cases (except to a target point) the constructor is given the state of the ship and the COE of the target.

These algorithms all assume the ship and target are in orbit around the same central body. This is not explicitly verified.

This code is not a Monobehaviour. To use in an object in a scene see GSTransferShip which is the "in scene" wrapper.

The maneuvers are computed via a call to Compute() and once done maneuvers can be retrieved via Maneuvers(). The caller then needs to add these to GE (using the correct bodyId and time offset)

Constructor & Destructor Documentation

◆ TransferShip()

GravityEngine2.TransferShip.TransferShip ( GEBodyState shipState,
Orbital::COE toOrbit,
double mu,
double circleThreshold = Orbital::SMALL_E,
bool checkHit = false,
double planetRadius = 0::0,
bool retrograde = false )

Constructor for case with a target orbit.

Parameters
shipStateShip state relative to the central body
toOrbit
mumu for the central body (from ge.GetMu() or G*M)

Member Function Documentation

◆ Maneuvers()

List< GEManeuver > GravityEngine2.TransferShip.Maneuvers ( int centerId = -1)

Return the list of maneuvers. These will be relative maneuvers and will be set to begin at t=0.

The calling function will provide the timeOffset

Returns

◆ SetTargetPoint()

void GravityEngine2.TransferShip.SetTargetPoint ( double3 p)

Set the transfer point in GE internal units.

Parameters
p

◆ TimeComplete()

double GravityEngine2.TransferShip.TimeComplete ( )

The relative time from start of maneuvers when the sequence will be complete. This will always be the time of the last maneuver.

Returns

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