Gravity Engine 12.0
Unity Asset for Gravity
|
Evolve particles in the gravitation field computed by the GravityEngine. More...
Public Member Functions | |
double | Evolve (double evolveTime, int numBodies, GravityState gravityState) |
Evolve for the specified evolveTime using a dedicated Leapfrog integrator. | |
double | EvolveWithForce (double evolveTime, int numBodies, GravityState gravityState, IForceDelegate force) |
Evolves particles using massice bodies the with force delegate provided. | |
void | UpdateParticles (float physicalScale, GravityEngine ge) |
Updates the particles positions in world space. | |
void | MoveAll (ref double[] moveBy) |
void | AdjustVelocity (Vector3d velAdjust) |
Public Attributes | |
bool | addNBodyVelocity = false |
If the particle system has an NBody or NBody parent, add the velocity of the NBody to particles that are created. | |
Vector3 | initialVelocity = Vector3.zero |
Initial velocity to be added to particles (may be over-riden by an IGravityParticlesInit script, if present) | |
Evolve particles in the gravitation field computed by the GravityEngine.
This script is attached to a Unity ParticleSystem. Initialization of the particles may be handled by a script implementing IGravityParticleInit. Two common examples are DustBall and DustRing. If there is no init delegate the Unity particle creation will be applied.
Each instance of GravityParticles manages the gravitational evolution of it's particle system. Particles are massless (they do not affect other particles) and are evolved with a built-in Leapfrog integrator. Particles which move within the particle capture radius of an NBody are made inactive and will not be further evolved. Particles that move outside the GravityEngine horizon are also made inactive.
double GravityParticles.Evolve | ( | double | evolveTime, |
int | numBodies, | ||
GravityState | gravityState | ||
) |
Evolve for the specified evolveTime using a dedicated Leapfrog integrator.
Evolve is called by GravityEngine on the fixed update loop. Do not call from scene scripts.
evolveTime | Evolve time. |
numBodies | Number bodies. |
m | M. |
r_m | R m. |
size2 | Size2. |
info | Info. |
double GravityParticles.EvolveWithForce | ( | double | evolveTime, |
int | numBodies, | ||
GravityState | gravityState, | ||
IForceDelegate | force | ||
) |
Evolves particles using massice bodies the with force delegate provided.
evolveTime | Evolve time. |
numBodies | Number bodies. |
m | M. |
r_m | R m. |
size2 | Size2. |
info | Info. |
force | Force. |
void GravityParticles.UpdateParticles | ( | float | physicalScale, |
GravityEngine | ge | ||
) |
Updates the particles positions in world space.
UpdateParticles is called from the GravityEngine. Do not call from other scripts.
physicalScale | Physical scale. |