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

Dust ring. Create a ring of particles in orbit around an NBody mass. Allows full control over the orbital attributes of the ring particles. More...

Inheritance diagram for DustRing:
EllipseBase IGravityParticlesInit IOrbitPositions

Public Member Functions

void InitNewParticles (int numLastActive, int numActive, ref double[,] r, ref double[,] v)
 Provide the initial positions and velocity for a range of particles. This method will be called as particles are created by the particle system. The implementing class must fill in the r[,] and v[,] arrays for the range specified. These arrays are indexed by [particle_num, dimension] where dimension 0,1,2 correspond to x,y,z.
 
void ApplyScale (float scale)
 Apply scale to the orbit. This is used by the inspector scripts during scene setup. Do not use at run-time.
 
- Public Member Functions inherited from EllipseBase
void Init ()
 Init the ellipse, verify a center body is present, determine orientation and update transform.
 
void SetCenterBody (GameObject centerBody)
 Sets the center body and initializes the ellipse configuration.
 
void InitFromOrbitData (OrbitData od)
 Inits an EllipseBase orbit from orbital parameters contained in an OrbitData.
 
OrbitData GetOrbitData ()
 
void SetInitialPosition (NBody nbody)
 Sets the initial position based on the orbit parameters. Used in the init phase to set the NBody in the correct position in the scene before handing control GE.
 
Vector3[] OrbitPositions (int numPoints, Vector3 centerPos, bool doSceneMapping)
 Calculate an array of points that describe the specified orbit.
 
Vector3[] OrbitSegmentPositions (int numPoints, Vector3 centerPos, Vector3 startPos, Vector3 endPos, bool shortPath)
 Generate the points for an orbit segment given the start and end positions. If shortPath then the short path between the points will be shown, otherwise the long way around.
 
GameObject GetCenterObject ()
 Return the center object around which this ellipse is defined.
 
Vector3[] OrbitPositions (int numPoints, Vector3 centerPos, bool doSceneMapping)
 
void InitNewParticles (int fromParticle, int toParticle, ref double[,] r, ref double[,] v)
 Provide the initial positions and velocity for a range of particles. This method will be called as particles are created by the particle system. The implementing class must fill in the r[,] and v[,] arrays for the range specified. These arrays are indexed by [particle_num, dimension] where dimension 0,1,2 correspond to x,y,z.
 

Public Attributes

float ringWidthPercent
 Width of particle ring as a percent of ring radius.
 
- Public Attributes inherited from EllipseBase
ParamBy paramBy = ParamBy.AXIS_A
 Define ellipse by semi0major axis (A) or closest approach (P)
 
GameObject centerObject
 object to orbit around (if null, will take parent game object)
 
float ecc
 eccentricity (0..1, 0=circle, 1=linear)
 
float a_scaled = -1f
 
float p_scaled
 
float a = 10f
 (a,p) hold the values for a and p in the unit system specified by the gravity engine. These are scaled and used to set a and p for game simulation based on the unit scaling system provided by gravity engine.
 
float p
 pericenter - based on paramBy user can specify a OR p. a = p/(1-ecc)
 
float omega_uc
 "longitude of ascending node" - angle from x-axis to line from focus to pericenter
 
float omega_lc
 "argument of perienter" - angle from ascending node to pericenter
 
float inclination
 inclination (degrees!)
 
float phase
 initial TRUE anomoly (angle wrt line from focus to closest approach)
 

Additional Inherited Members

- Public Types inherited from EllipseBase
enum  ParamBy { AXIS_A , CLOSEST_P }
 
- Protected Member Functions inherited from EllipseBase
void UpdateOrbitParams ()
 
void CalculateRotation ()
 
- Protected Attributes inherited from EllipseBase
Quaternion ellipse_orientation
 
NBody centerNbody
 
OrbitData initData
 

Detailed Description

Dust ring. Create a ring of particles in orbit around an NBody mass. Allows full control over the orbital attributes of the ring particles.

Must be attached to a particle system with a GravityParticles component.

Member Function Documentation

◆ ApplyScale()

void DustRing.ApplyScale ( float  scale)

Apply scale to the orbit. This is used by the inspector scripts during scene setup. Do not use at run-time.

Parameters
scaleScale.

◆ InitNewParticles()

void DustRing.InitNewParticles ( int  fromParticle,
int  toParticle,
ref double  r[,],
ref double  v[,] 
)

Provide the initial positions and velocity for a range of particles. This method will be called as particles are created by the particle system. The implementing class must fill in the r[,] and v[,] arrays for the range specified. These arrays are indexed by [particle_num, dimension] where dimension 0,1,2 correspond to x,y,z.

See the DustBox script for a sample usage of this interface.

Parameters
fromParticleFrom particle number.
toParticleTo particle number.
r(out) 2D array [numParticles, 3] to hold physics position (x,y,z) per particle
v(out) 2D array [numParticles, 3] to hold velocity (x,y,z) per particle

Implements IGravityParticlesInit.


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