Gravity Engine 12.0
Unity Asset for Gravity
|
Dust ball. Create particles in a sphere with a given initial velocity. More...
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 | 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 | |
Vector3 | velocity |
Velocity of each particle when it is initalized. | |
float | radius = 1f |
Radius of the ball of particles. | |
Dust ball. Create particles in a sphere with a given initial velocity.
Must be attached to a particle system with a GravityParticles component.
void DustBall.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.
fromParticle | From particle number. |
toParticle | To 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.