Game Development Reference
In-Depth Information
The PolyParticleEx class is derived from the Object3d class.
public class PolyParticleEx extends Object3d
The
PolyParticleVertices
variable array holds the mesh data for a
PolyParticleEx
particle. The
particle is a triangle that has no texture coordinates but has lighting data in the form of vertex
normals. (See Listing 7-31.)
Listing 7-31. Particle Mesh Definition
static float[] PolyParticleVertices =
{
// Triangle Shape
// Left Side nx, ny, nz
0.0f, 0.0f, -0.5f, 0, 0, -1, // v0 = bottom, back
0.0f, 0.0f, 0.5f, 0, 0, 1, // v1 = bottom, front
0.0f, 0.5f, 0.0f, 0, 1, 0, // v2 = top point
};
The
m_Color
variable holds the current color of the polygon particle.
private Vector3 m_Color = new Vector3(0,0,0);
The
m_TimeStamp
variable holds the time in milliseconds that the particle is created.
private long m_TimeStamp; // Time in milliseconds that Particle is created
The
m_TimeDelay
variable holds the life span of the particle in milliseconds.
private float m_TimeDelay; // LifeSpan of Particle in milliseconds
The
m_Locked
variable is true if set to launch or in use, false if available for use.
private boolean m_Locked; // true if set to launch or in use, false if available for use
The
m_Active
variable is true if the particle is onscreen and has to be rendered. It is false otherwise.
private boolean m_Active; // Onscreen = Render particle if Active
The
m_ColorBrightness
variable holds the current brightness level of the particle color.
private float m_ColorBrightness;
The
m_FadeDelta
variable is the rate at which the particle fades out.
private float m_FadeDelta;
The
m_OriginalColor
variable is the original color of the particle when created.
private Vector3 m_OriginalColor = new Vector3(0,0,0);