Gravity Engine  1.5
Unity Asset for Gravity
AZTripleIntegrator Class Reference
Inheritance diagram for AZTripleIntegrator:
INBodyIntegrator

Public Member Functions

void Setup (int maxBodies, double timeStep)
 Setup the specified maxBodies and timeStep. Must be called prior to PreEvolve/Evolve More...
 
INBodyIntegrator DeepClone ()
 Clone this instance, replicating internal arrays. Copy across any internal state required for continued evolution. More...
 
void AddNBody (int bodyNum, NBody nbody, Vector3 position, Vector3 velocity)
 Adds the N body. Implementation may support the case where the initial number of bodies in Setup() is exceeded, creating space, or may ignore additions that exceed this limit (e.g. AZTTriple). More...
 
void RemoveBodyAtIndex (int atIndex)
 Removes NBody at index i. More...
 
void GrowArrays (int growBy)
 Grows the arrays. Called by GravityEngine when it changes internal data sizes. More...
 
Vector3 GetVelocityForIndex (int i)
 
void GetVelocityDoubleForIndex (int i, ref double[] vel)
 
void SetVelocityForIndex (int i, Vector3 vel)
 
Vector3 GetAccelerationForIndex (int i)
 
float GetEnergy (GravityState gravityState)
 Gets the energy of the system. More...
 
float GetInitialEnergy (GravityState gravityState)
 Gets the initial energy. More...
 
void PreEvolve (GravityState gravityState, ref byte[] info)
 Call ONCE after all game objects have been added to allow integrator to pre-calc starting quantities required for integration More...
 
double Evolve (double evolveTime, GravityState gravityState, ref byte[] info)
 Evolve the specified evolveTime, m_arg and r_arg. More...
 

Member Function Documentation

void AZTripleIntegrator.AddNBody ( int  bodyNum,
NBody  nbody,
Vector3  position,
Vector3  velocity 
)

Adds the N body. Implementation may support the case where the initial number of bodies in Setup() is exceeded, creating space, or may ignore additions that exceed this limit (e.g. AZTTriple).

Parameters
nbodyNBody component
positionPhysics position
velocityPhysics velocity

Implements INBodyIntegrator.

INBodyIntegrator AZTripleIntegrator.DeepClone ( )

Clone this instance, replicating internal arrays. Copy across any internal state required for continued evolution.

Implements INBodyIntegrator.

double AZTripleIntegrator.Evolve ( double  evolveTime,
GravityState  gravityState,
ref byte[]  info 
)

Evolve the specified evolveTime, m_arg and r_arg.

AZT is focused on accuracy and the time it evolves for can vary over several orders of magnitude.

Parameters
evolveTimeEvolve time.
m_argM_arg. NOT USED
r_argR_arg. passes results back

Implements INBodyIntegrator.

float AZTripleIntegrator.GetEnergy ( GravityState  gravityState)

Gets the energy of the system.

Returns
The energy.
Parameters
massMass.
posPosition.

Implements INBodyIntegrator.

float AZTripleIntegrator.GetInitialEnergy ( GravityState  gravityState)

Gets the initial energy.

Returns
The initial energy.
Parameters
massMass.
posPosition.

Implements INBodyIntegrator.

void AZTripleIntegrator.GrowArrays ( int  growBy)

Grows the arrays. Called by GravityEngine when it changes internal data sizes.

Parameters
growByGrow by.

Implements INBodyIntegrator.

void AZTripleIntegrator.PreEvolve ( GravityState  gravityState,
ref byte[]  info 
)

Call ONCE after all game objects have been added to allow integrator to pre-calc starting quantities required for integration

To avoid copies of mass and position arrays in integrators provide a reference to these for Evolve and PreEvolve

Some implementations (e.g. AZTriple) may make their own copies and then copy the result back into these arrays ///

Parameters
mM.
rThe red component.
infoInfo.

Implements INBodyIntegrator.

void AZTripleIntegrator.RemoveBodyAtIndex ( int  atIndex)

Removes NBody at index i.

Parameters
atIndexAt index.

Implements INBodyIntegrator.

void AZTripleIntegrator.Setup ( int  maxBodies,
double  timeStep 
)

Setup the specified maxBodies and timeStep. Must be called prior to PreEvolve/Evolve

Parameters
maxBodiesMax bodies.
timeStepTime step.

Implements INBodyIntegrator.


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