Particles can represent objects, corners of 2D or 3D shapes or abstract things that won't even be drawn. Particles have 5 properties:
Move the particle to some 3D location with positon.set(x, y, z);
. Move the particle by some 3D amount with position.add(x, y, z);
. And this is how you get to the dimensions of particle position. position.x; position.y; position.z;
.
Set the velocity to some 3D quantity, maybe use this to send a particle flying off in a particular direction: velocity.set(x, y, z);
. This adds some 3D quantity to the velocity of the particle. You could maybe use this to speed up or slow down a particle: velocity.add(x, y, z);
. And this is how you get at the dimensions of the particles velocity: velocity.x; velocity.y; velocity.z;
Get or set the mass of the particle.
Set the mass of the particle. Heavier particles will have more inertia and will accelerate slower. Attraction/repulsion forces will also be stronger for heavier particles. If you aren't doing anything special this will probably be the same for all particles.
Particles can either be fixed or free. If they are free they move around and are affected by forces, if they are fixed they stay where they are.
How long the particle has been around. Every time you advance the simulation by t
every particle gets a little older by t
.