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

Display objects and trajectories on XY plot of ascent/launch path. More...

Inheritance diagram for GravityEngine2.GSLaunchDisplay:
GravityEngine2.GSDisplay

Public Member Functions

override List< int > Init ()
 Initialize the objects for this display controller. This is called by GSController init as part of its Start()
 
override Vector3 MapToScene (Vector3 rWorldAbs, double time)
 Intended to only be called for the body being launched!
 
- Public Member Functions inherited from GravityEngine2.GSDisplay
void ActiveSet (bool value)
 Change the active status.
 
void DisplayBodyRemoveByBodyId (int id)
 Remove all GSDisplayObjects with the given bodyId.
 
delegate void DisplayInScene (GECore ge, MapToSceneFn mapToScene, double timeWorld, bool alwaysUpdate=false)
 
void DisplayObjectAdd (GSDisplayObject gdo)
 Add a GSDisplayObject (typically a GSDisplayBody or GSDisplayOrbit). Different display objects may have different update methods or choose to register custom display functions so they are asked to "add themselves" via AddToSceneDisplay(). As part of this they must call RegisterDisplayObject() [which is where the "book-keeping" is done.].
 
void DisplayObjectRemove (GSDisplayObject gdo)
 Remove a GSDisplayObject (e.g. GSDisplayBody, GSDisplayOrbit etc.)
 
virtual void DisplayUpdate (GECore ge, double elapsedWorldTime)
 Main update loop for display of bodies and orbits in the scene. (Internal)
 
string DumpAll ()
 
delegate Vector3 MapToSceneFn (Vector3 rWorld, double time=-1)
 
void ParticleSetup (double dt, double timeStart, GBUnits.GEScaler geScaler)
 
void ParticlesUpdate (double lenPhysToWorld)
 
List< GSParticlesParticleSystems ()
 
int RegisterDisplayObject (GSDisplayObject gdo, int bodyId, Transform transform=null, DisplayInScene displayInScene=null, bool trajectory=false, LineRenderer trajLine=null)
 
void UpdateDisplayObjectBody (long displayId, int bodyId)
 Update the internal state of GSDisplayObject. Can be used to designate a new bodyId to track.
 

Public Attributes

GSBody centerBody
 
float displayHeight = 50.0f
 
float displayWidth = 100.0f
 
LineRenderer lineR
 
Vector3 orbitNormal
 
GSBody ship
 
float worldHeight
 
float worldWidth
 
- Public Attributes inherited from GravityEngine2.GSDisplay
bool active = true
 
GSDisplayObject[] addBodies
 
AddMode addMode = AddMode.CHILDREN
 
CR3BP.ReferencePoint cr3bpRefPoint = CR3BP.ReferencePoint.NONE
 
DisplayMode displayMode = DisplayMode.INTERPOLATE
 
bool editorScalingFoldout = false
 
GSController gsController
 
float maxSceneDimension = 10000
 
float scale = 1.0f
 
GSBody wrtBody
 
bool xzOrbitPlane = true
 

Protected Member Functions

override void DisplayUpdateInit (GECore ge, double elapsedWorldTime)
 
override void TrajectoryUpdate (GECore geTrajectory)
 In a map display need to thread the trajectory under the map when we wrap off the edge (either horizontally or vertically). In this case we need to add more than one point for a given traj. point, hence the need to override the entire traj. update.
 

Additional Inherited Members

- Public Types inherited from GravityEngine2.GSDisplay
enum  AddMode { CHILDREN , LIST , SCENE }
 Mode the controller will use to find GSBody objects to add CHILDREN: Scan all children of this controller for GSBody LIST: Add objects explicitly listed SCENE: Find all objects in the scene with GSBody components.
 
enum  DisplayMode { DIRECT , INTERPOLATE }
 
- Protected Attributes inherited from GravityEngine2.GSDisplay
int[] displayIndices
 
GSDisplayObjectInfo[] displayObjects
 displayObjects may be sparsely filled. The empty slots are managed by a Stack and the allocated slots are listed in an array of indices.
 
Queue< int > displayOptQueue
 
Vector3 displayPosition
 
Quaternion displayRotation
 
bool maintainCoRo
 
int numDO
 
float queueConsumeRate
 
float queueConsumeTokens
 
Vector3 wrtWorldPosition
 

Detailed Description

Display objects and trajectories on XY plot of ascent/launch path.

This display is focused on the ascent of a single GSBody with respect to a planet in a given orbital plane.

NOTE: to have the usual Cartesian X, Y plane need to have the camera located at -Z looking toward the origin, since Unity has a LH coordinate system.

Member Function Documentation

◆ DisplayUpdateInit()

override void GravityEngine2.GSLaunchDisplay.DisplayUpdateInit ( GECore ge,
double elapsedWorldTime )
protectedvirtual
Parameters
ge
elapsedWorldTime

Reimplemented from GravityEngine2.GSDisplay.

◆ Init()

override List< int > GravityEngine2.GSLaunchDisplay.Init ( )
virtual

Initialize the objects for this display controller. This is called by GSController init as part of its Start()

  • find the GSDisplayObject implementations (mostly GSDisplayBody)
  • find the GSDisplayOrbit
  • arrange internal data structure by having above objects register with this class
  • determine if any bodies want trajectory recording and pass their ids back
Returns
List of trajectories

Reimplemented from GravityEngine2.GSDisplay.

◆ MapToScene()

override Vector3 GravityEngine2.GSLaunchDisplay.MapToScene ( Vector3 rWorldAbs,
double time )
virtual

Intended to only be called for the body being launched!

Parameters
rWorldAbs
time
Returns

Reimplemented from GravityEngine2.GSDisplay.

◆ TrajectoryUpdate()

override void GravityEngine2.GSLaunchDisplay.TrajectoryUpdate ( GECore geTrajectory)
protectedvirtual

In a map display need to thread the trajectory under the map when we wrap off the edge (either horizontally or vertically). In this case we need to add more than one point for a given traj. point, hence the need to override the entire traj. update.

Since this is the only use case, C&P the common code for now.

Parameters
geTrajectory

Reimplemented from GravityEngine2.GSDisplay.


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