Gravity Engine 12.0
Unity Asset for Gravity
Loading...
Searching...
No Matches
IFixedOrbit Interface Reference

Interface defining the fixed motion of an NBody object. More...

Inheritance diagram for IFixedOrbit:
FixedObject KeplerSequence OrbitEllipse OrbitHyper OrbitPoint OrbitUniversal BinaryOrbit

Public Member Functions

bool IsOnRails ()
 Check if body is configured at scene start to be fixed. (Allows objects to be optionally configured as not fixed, to allow e.g. Kepler eqn vs initial velocity in OrbitEllipse)
 
void PreEvolve (float physicalScale, float massScale)
 Called for each NBody object prior to evolution beginning. Allows a chance to setup internal state.
 
void Evolve (double physicsTime, GravityState gravityState, ref double[] r, ref double[] v, bool isQuery=false)
 Evolve the NBody. Implementating method uses physics time and scale to compute the new position, placing it in r. Velocity is also updated so that GetVelocity() can request it if it is of interest.
 
void GEUpdate (GravityEngine ge)
 Perform and update of the world game object position and velocity based on the internal state.
 
void Move (Vector3 position)
 Handle dynamic origin shift.
 
void SetNBody (NBody nbody)
 Set the NBody that the orbit element will evolve. This is not commonly used, since the NBody is typically attached to the same game object as the FixedOrbit. The exception is when fixed orbit segments are part of a KeplerSequence (patched-conic evolution).
 
Vector3 ApplyImpulse (Vector3 impulse)
 ApplyImpulse in Kepler mode. (Currently only OrbitUniversal does this)
 
NBody GetCenterNBody ()
 Return the center NBody for the fixed orbit.
 
void UpdatePositionAndVelocity (Vector3 pos, Vector3 vel)
 Update the position and velocity of the object in the orbit.
 
string DumpInfo ()
 Create a string with info for display in GEConsole.
 

Detailed Description

Interface defining the fixed motion of an NBody object.

Scripts implementing this interface must be attached to a game object that also has an NBody component.

Objects with fixed motion will have their mass used to create the global gravitational field but will not be affected by that field. Their motion is defined by the Evolve() method. When called they are responsible for updating their position.

Member Function Documentation

◆ ApplyImpulse()

Vector3 IFixedOrbit.ApplyImpulse ( Vector3  impulse)

ApplyImpulse in Kepler mode. (Currently only OrbitUniversal does this)

Returns

Implemented in OrbitEllipse, OrbitHyper, FixedObject, KeplerSequence, OrbitPoint, and OrbitUniversal.

◆ DumpInfo()

string IFixedOrbit.DumpInfo ( )

Create a string with info for display in GEConsole.

Returns

Implemented in BinaryOrbit, OrbitEllipse, OrbitHyper, FixedObject, KeplerSequence, OrbitPoint, and OrbitUniversal.

◆ Evolve()

void IFixedOrbit.Evolve ( double  physicsTime,
GravityState  gravityState,
ref double[]  r,
ref double[]  v,
bool  isQuery = false 
)

Evolve the NBody. Implementating method uses physics time and scale to compute the new position, placing it in r. Velocity is also updated so that GetVelocity() can request it if it is of interest.

Parameters
physicsTimeCurrent Physics time.
physicalScalePhysical scale.
rPosition in physics space (x, y, z). OUTPUT by the method
vVelocity in physics space (x, y, z). OUTPUT by the method
isQueryRequest is a query and should not change state or do callbacks

Implemented in BinaryOrbit, OrbitUniversal, FixedObject, OrbitPoint, KeplerSequence, OrbitEllipse, and OrbitHyper.

◆ GetCenterNBody()

NBody IFixedOrbit.GetCenterNBody ( )

Return the center NBody for the fixed orbit.

Returns

Implemented in OrbitEllipse, OrbitHyper, FixedObject, KeplerSequence, OrbitPoint, and OrbitUniversal.

◆ GEUpdate()

void IFixedOrbit.GEUpdate ( GravityEngine  ge)

Perform and update of the world game object position and velocity based on the internal state.

Implemented in OrbitEllipse, OrbitHyper, FixedObject, KeplerSequence, OrbitPoint, and OrbitUniversal.

◆ IsOnRails()

bool IFixedOrbit.IsOnRails ( )

Check if body is configured at scene start to be fixed. (Allows objects to be optionally configured as not fixed, to allow e.g. Kepler eqn vs initial velocity in OrbitEllipse)

Returns
true if this instance is fixed; otherwise, false.

Implemented in BinaryOrbit, OrbitEllipse, OrbitHyper, FixedObject, KeplerSequence, OrbitPoint, and OrbitUniversal.

◆ Move()

void IFixedOrbit.Move ( Vector3  position)

Handle dynamic origin shift.

Parameters
position

Implemented in OrbitEllipse, OrbitHyper, FixedObject, KeplerSequence, OrbitPoint, and OrbitUniversal.

◆ PreEvolve()

void IFixedOrbit.PreEvolve ( float  physicalScale,
float  massScale 
)

Called for each NBody object prior to evolution beginning. Allows a chance to setup internal state.

Parameters
physicalScalePhysical scale.
massScaleMass scale.

Implemented in BinaryOrbit, OrbitEllipse, OrbitHyper, FixedObject, KeplerSequence, OrbitPoint, and OrbitUniversal.

◆ SetNBody()

void IFixedOrbit.SetNBody ( NBody  nbody)

Set the NBody that the orbit element will evolve. This is not commonly used, since the NBody is typically attached to the same game object as the FixedOrbit. The exception is when fixed orbit segments are part of a KeplerSequence (patched-conic evolution).

Parameters
nbody

Implemented in OrbitEllipse, OrbitHyper, FixedObject, KeplerSequence, OrbitPoint, and OrbitUniversal.

◆ UpdatePositionAndVelocity()

void IFixedOrbit.UpdatePositionAndVelocity ( Vector3  pos,
Vector3  vel 
)

Update the position and velocity of the object in the orbit.

Currently only implemented in OrbitUniversal for changes in the center body due to patched conic transitions.

Parameters
pos
vel

Implemented in OrbitEllipse, OrbitHyper, FixedObject, KeplerSequence, OrbitPoint, and OrbitUniversal.


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