Gravity state. Hold "most" of the information for gravitational evolution of the system.
More...
|
| GravityState (int size) |
| New Gravity state. Also need to call SetAlgorithmAndForce to fully configure.
|
|
| GravityState (GravityState fromState) |
| Clone constructor.
|
|
NbodyState[] | GetNbodyStates () |
|
void | SetAlgorithmAndForce (GravityEngine.Algorithm algorithm, IForceDelegate forceDelegate) |
| Set the integrator required for the chosen algorithm.
|
|
void | InitArrays (int arraySize) |
|
bool | GrowArrays (int growBy) |
|
void | Clear () |
|
void | ResetPhysicalTime () |
|
void | AddFixedBody (GravityEngine ge, int index, GravityEngine.FixedBody fixedBody, IFixedOrbit fixedOrbit) |
|
void | RemoveFixedBody (NBody nbody) |
|
void | UpdateKeplerDepth (NBody nbody, OrbitUniversal orbitU) |
| Recompute and update the kepler depth of a fixed body.
|
|
void | AddNBody (NBody nbody, float massScale, float physToWorldFactor, bool isFixed) |
|
void | RemoveNBody (NBody nbody) |
| Remove the body at index and shuffle up the rest. Ensure the integrator does the same to stay in alignment.
|
|
void | UpdateOnRails () |
| Check if all bodies are on rails.
|
|
void | PreEvolve (GravityEngine ge) |
|
bool | IsOnRails () |
| Are all bodies in the world state "on-rails"?
|
|
bool | Evolve (GravityEngine ge, double timeStep) |
| Evolve the objects subject to gravity.
|
|
bool | EvolveReversed (GravityEngine ge, double timeStep) |
|
void | MoveFixedBodies (double time) |
|
void | EvolveForTimestepReversed (GravityEngine ge, double physicsDt, bool exactTime=false) |
| Evolve backwards.
|
|
Vector3 | GetPhysicsPosition (NBody nbody) |
| Get the internal position used by the physics engine.
|
|
Vector3d | GetPhysicsPositionDoubleV3 (NBody nbody) |
|
Vector3d | GetPhysicsPositionDouble (NBody nbody) |
| Get the internal position used by the physics engine.
|
|
void | GetVelocityDouble (NBody nbody, ref double[] vel) |
| Get the physics velocity for an NBody as a double[].
|
|
Vector3d | GetVelocity3d (NBody nbody) |
|
void | UpdatePositionAndVelocity (NBody nbody, Vector3d pos, Vector3d vel, Maneuver m=null) |
|
void | SetVelocityDouble (NBody nbody, ref double[] velocity) |
| Set the physics velocity from a double array.
|
|
void | SetVelocity3d (NBody nbody, Vector3d velocity) |
|
void | UpdateInternalDouble (NBody nbody, Vector3d pos, Vector3d velocity) |
| Internal use only from OrbitUniversal InitFromRVT Ensures cached state is current so can use info prior to the next Evolve call.
|
|
void | SetPosition3d (NBody nbody, Vector3d pos) |
| Set the physics velocity from a double array.
|
|
double | GetMass (NBody nbody) |
| Return the internal physics engine mass.
|
|
double | GetPhysicsTime () |
| Get the internal physics time for massive bodies.
|
|
void | SetTime (double newTime, bool force) |
|
void | EvolveToTime (double newTime) |
| Evolve all bodies to the new time (past or future). This will trigger a integration sequence when there is at least one body off rails and this may cause a burst of CPU activity if the time delta is large.
|
|
void | ApplyChangeAtTime (NBody nbody, double atTime, Vector3d r, Vector3d v) |
| Apply a change in R,V to an NBody object in the past or future.
|
|
void | ReverseVelocities () |
|
GERewindMgr | GetGERewindMgr () |
|
bool | NbodyIsActive (NBody nbody) |
|
bool | NbodyIndexIsActive (int index) |
|
void | NbodySetIsActive (NBody nbody, bool state) |
|
void | NbodySetNoUpdateFlag (NBody nbody, bool state) |
|
bool | NbodyGetNoUpdateFlag (NBody nbody) |
|
bool | NbodyGetNoUpdateFlag (int index) |
|
bool | NbodyIsFixed (NBody nbody) |
|
void | NbodySetIsFixed (NBody nbody, bool state) |
|
void | SetMass (NBody nbody, double mass) |
|
void | SetSize2 (NBody nbody, double size) |
|
void | AddTrigger (GETriggerMgr.Trigger t) |
|
void | RemoveTrigger (GETriggerMgr.Trigger t) |
|
void | ClearTriggers () |
|
string | DumpAll (NBody[] gameNBodies, GravityEngine ge) |
|
Vector3d | ComputeCenterOfMass () |
| Deterimine the center of mass.
|
|
Vector3d | ComputeCenterOfMassVelocity () |
| Compute the velocity of the CM. Consider only massive bodies. If there are any FixedObject elements they will be weighted with a velocity of zero.
|
|
void | SetCenterOfMass (GravityEngine ge, Vector3d pos, Vector3d vel) |
| Set the CM to the specified postion and velocity.
|
|
void | MoveAll (Vector3d moveBy) |
|
Gravity state. Hold "most" of the information for gravitational evolution of the system.
The NBody objects added can be massive or massless. They can independently be in normal gravitational motion or have their motion FIXED in some way (either by a Kepler/on-rail evolution mode or simply being not movable).
Massive bodies are tracked here by the arrays m[] and r[]. These arrays are then updated by passing to the selected numerical integrator. This allows a central object manager to compute the mutual gravitational interactions in the most effecient way. Each fixed frame the r[] value are copied back to the transform positions of the associated game objects (this is done in the GE class).
A parallel list of FixedBodies is maintained BUT they are also in the r[] list, since their masses may affect non-fixed bodies.
Massless bodies are evolved seperately using a simple Leapfrog integrator (unless Optimize Massless has been set to false).
Particles are always evolved seperately using a simpe Leapfrog integrator.
A scene may have more than one gravity state. Additional copies may be used for trajectory prediction, to determine future paths objects will take.