Gravity Engine 2 3.0
Loading...
Searching...
No Matches
GravityEngine2.GSParticles Class Reference

Evolve particles in the gravitation field computed by the GravityEngine. More...

Inheritance diagram for GravityEngine2.GSParticles:

Classes

struct  ParticleData
 Particle evolution. More...
 
struct  ParticleJob
 

Public Member Functions

void AdjustVelocity (double3 velAdjust)
 
double Evolve (double evolveTime, List< int > massiveIndices, ref GEPhysicsCore.GEPhysicsJob geJob)
 Direct evolution of particles without using the Job system. To maintain common code this is done by calling a method on the particle job, but we are not scheduling a job (yet).
 
void MoveAll (ref double3 moveBy)
 
void ParallelJobSetup (List< int > massiveIndices, ref GEPhysicsCore.GEBodies bodies)
 
void ParticleSetup (double dt, double time, GBUnits.GEScaler geScaler)
 
void UpdateParticles (GSDisplay gsDisplay, double lenPhysToWorld)
 Updates the particles positions in world space.
 

Public Attributes

bool addGSBodyVelocity = false
 If the particle system has an NBody or NBody parent, add the velocity of the NBody to particles that are created.
 
double3 initialVelocity = double3.zero
 Initial velocity to be added to particles (may be over-riden by an IGravityParticlesInit script, if present)
 
ParticleJob pJob
 

Detailed Description

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 attached to the same game object that holds this component. Two common example 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.

Member Function Documentation

◆ Evolve()

double GravityEngine2.GSParticles.Evolve ( double evolveTime,
List< int > massiveIndices,
ref GEPhysicsCore::GEPhysicsJob geJob )

Direct evolution of particles without using the Job system. To maintain common code this is done by calling a method on the particle job, but we are not scheduling a job (yet).

Parameters
evolveTime
massiveIndices
bodies
Returns

◆ UpdateParticles()

void GravityEngine2.GSParticles.UpdateParticles ( GSDisplay gsDisplay,
double lenPhysToWorld )

Updates the particles positions in world space.

UpdateParticles is called from GSDisplay. Do not call from other scripts.

Parameters
physicalScalePhysical scale.

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