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

Fixed object. More...

Inheritance diagram for FixedObject:
IFixedOrbit

Public Member Functions

void Start ()
 
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 gs, ref double[] r, ref double[] v, bool doCallbacks=true)
 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.
 
Vector3 GetPosition ()
 
Vector3d GetPositionDouble ()
 
void Move (Vector3 moveBy)
 Handle dynamic origin shift.
 
void GEUpdate (GravityEngine ge)
 Perform and update of the world game object position and velocity based on the internal state.
 
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).
 
bool IsKepler ()
 
NBody GetCenterNBody ()
 Return the center NBody for the fixed orbit.
 
Vector3 ApplyImpulse (Vector3 impulse)
 ApplyImpulse in Kepler mode. (Currently only OrbitUniversal does this)
 
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.
 
void SetPositionDouble (Vector3d pos)
 
Vector3 GetVelocity ()
 
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

Fixed object.

Object does not move (but it's gravity will affect others).

Good choice for e.g. central star in a system

Member Function Documentation

◆ ApplyImpulse()

Vector3 FixedObject.ApplyImpulse ( Vector3  impulse)

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

Returns

Implements IFixedOrbit.

◆ DumpInfo()

string FixedObject.DumpInfo ( )

Create a string with info for display in GEConsole.

Returns

Implements IFixedOrbit.

◆ Evolve()

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

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

Implements IFixedOrbit.

◆ GetCenterNBody()

NBody FixedObject.GetCenterNBody ( )

Return the center NBody for the fixed orbit.

Returns

Implements IFixedOrbit.

◆ GEUpdate()

void FixedObject.GEUpdate ( GravityEngine  ge)

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

Implements IFixedOrbit.

◆ IsOnRails()

bool FixedObject.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.

Implements IFixedOrbit.

◆ Move()

void FixedObject.Move ( Vector3  position)

Handle dynamic origin shift.

Parameters
position

Implements IFixedOrbit.

◆ PreEvolve()

void FixedObject.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.

Implements IFixedOrbit.

◆ SetNBody()

void FixedObject.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

Implements IFixedOrbit.

◆ UpdatePositionAndVelocity()

void FixedObject.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

Implements IFixedOrbit.


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