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

Orbit Segment. An in-scene object that will determine the future orbit based on the current velocity and show a segment of the orbit between the body and the to position. The short or long way between the positions can be specified (in the case of an ellipse). More...

Inheritance diagram for OrbitSegment:

Public Member Functions

void Init ()
 
void SetDestination (Vector3 d)
 Set the destination object (point on the orbit where the line rendering should stop).
 
void SetVelocity (Vector3 v)
 
Vector3 GetVelocity ()
 
void SetCenterObject (GameObject newCenterBody)
 
OrbitUniversal GetOrbitUniversal ()
 
void UpdateOrbit ()
 Update the orbit based on the velocity.
 

Public Attributes

int numPoints = 500
 Number of points to be used in the line renderer for the orbit plot.
 
GameObject body
 The body for which an orbit is to be predicted.
 
GameObject centerBody
 The object which body is in orbit around.
 
bool velocityFromScript = false
 Script code will set the velocity explicitly. Do not retreive automatically.
 
bool retrograde = false
 
GameObject destination
 Location of the destination (optional, can use SetDestination() instead)
 

Detailed Description

Orbit Segment. An in-scene object that will determine the future orbit based on the current velocity and show a segment of the orbit between the body and the to position. The short or long way between the positions can be specified (in the case of an ellipse).

The destination location can be provided by a reference to a gameObject or can be set by script using the SetDestination() method.

Depending on the velocity the orbit may be an ellipse or a hyperbola. This class creates a delegate of each type to compute the orbital path.

Orbit prediction is based on the two-body problem and is with respect to one other body (presumably the dominant source of gravity for the affected object). The OrbitPredictor will add both an OrbitEllipse and an OrbitHyper and use one or the other to plot the projected orbit based on the velocity. The class OrbitData is used to determine the orbital parameters for the velocity.

The general orbit prediction problem is significantly harder - it requires simulating the entire scene into the future - re-computing whenever user input is provided. This is provided by the Trajectory prediction sub-system.

Member Function Documentation

◆ SetDestination()

void OrbitSegment.SetDestination ( Vector3  d)

Set the destination object (point on the orbit where the line rendering should stop).

Set in GE internal physical units.

◆ UpdateOrbit()

void OrbitSegment.UpdateOrbit ( )

Update the orbit based on the velocity.

Only used by FreeReturnController. Is this really needed???


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