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

Dust box. Create particles in a 3D rectangle with a specified initial velocity. More...

Inheritance diagram for DustBox:
IGravityParticlesInit

Public Member Functions

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.
 
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 x_size
 box size in X (-X/2..X/2)
 
float y_size
 box size in Y (-Y/2..Y/2)
 
float z_size
 box size in Z (-Z/2..Z/2)
 
Vector3 velocity
 uniform velocity added to each particle
 
Vector3 rotation
 Box rotation (Use instead of transform rotation)
 

Detailed Description

Dust box. Create particles in a 3D rectangle with a specified initial velocity.

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

Member Function Documentation

◆ InitNewParticles()

void DustBox.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: