|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.geom.particle.Particle
public abstract class Particle
An abstract Particle that defines some physical properties and life-cycle properties.
This class is subclassed for specific types of particle that have a means of representing themselves. This class contains some fields commonly used to implement physics based particle systems, such as force, energy, surface area as well as a total age and a cyclable age.
Particles start with all settings as zero, except the dimensions, which default to 0.2.
Field Summary | |
---|---|
protected float |
alpha
Red component of the color of the particle |
protected float |
blue
Blue component of the color of the particle |
protected float[] |
boundingBox
bounding box for the particle |
protected int |
cycleAge
a resettable cyclable age |
protected float |
depth
depth of the particle |
protected float |
energy
currently unused and undefined |
protected float |
green
Green component of the color of the particle |
protected float |
height
height of the particle |
protected float |
mass
Mass of the object in kilograms |
protected int |
particleLife
The maximum lifetime of this particle in milliseconds |
protected javax.vecmath.Point3f |
position
Current position of the particle |
protected float |
red
Red component of the color of the particle |
protected javax.vecmath.Vector3f |
resultantForce
Force applied to the particle in newtons |
protected float |
surfaceArea
Surface area of the particle in square meters |
protected javax.vecmath.Vector3f |
velocity
Current velocity in meters per second |
protected long |
wallClockBirth
The age of the particle in wall clock time (milliseconds), in this cycle |
protected long |
wallClockLife
The end time in wall clock time (milliseconds) |
protected float |
width
width of the particle in meters |
Constructor Summary | |
---|---|
Particle()
Construct a new particle instance. |
Method Summary | |
---|---|
long |
getBirthTime()
Get the wall clock time that this particle was born. |
float[] |
getBounds()
Retrieve the bounds of this particle in local coordinate space. |
void |
getColor(float[] val)
Retrieve the current colour that this particle has. |
int |
getCycleAge()
Get the set maximum cycle age. |
int |
getCycleTime()
Get the set maximum cycle time. |
float |
getDepth()
Get the current depth of the particle. |
float |
getHeight()
Get the current height of the particle. |
float |
getMass()
Gets the mass of this particle. |
void |
getPosition(float[] val)
Retrieve the current position of this particle. |
javax.vecmath.Vector3f |
getResultantForce()
Gets the resultantForce applied to a particle. |
float |
getSurfaceArea()
Gets the surfaceArea of the particle. |
javax.vecmath.Vector3f |
getVelocity()
Gets the current velocity of the particle. |
float |
getWidth()
Get the current width of the particle. |
void |
incAge()
Increment the cycle age. |
void |
setColor(float r,
float g,
float b,
float alpha)
Set this particle to a new colour. |
void |
setCycleAge(int age)
Set the cycle age to a new value. |
void |
setCycleTime(int time)
Set the cycle time to a new value. |
void |
setDepth(float depth)
Sets the depth of the particle. |
void |
setHeight(float height)
Sets the height of the particle. |
void |
setMass(float mass)
Sets the mass of this particle. |
void |
setPosition(float x,
float y,
float z)
Set the new position of this particle. |
void |
setResultantForce(javax.vecmath.Vector3f force)
Sets the resultantForce applied to a particle. |
void |
setSurfaceArea(float surfaceArea)
Sets the surfaceArea. |
void |
setVelocity(javax.vecmath.Vector3f velocity)
Sets the velocity of the particle. |
void |
setWidth(float width)
Sets the width of the particle. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int cycleAge
protected long wallClockBirth
protected long wallClockLife
protected int particleLife
protected float surfaceArea
protected float energy
protected float mass
protected javax.vecmath.Vector3f resultantForce
protected javax.vecmath.Vector3f velocity
protected javax.vecmath.Point3f position
protected float[] boundingBox
protected float red
protected float green
protected float blue
protected float alpha
protected float width
protected float height
protected float depth
Constructor Detail |
---|
public Particle()
Method Detail |
---|
public void getPosition(float[] val)
val
- An array of length 3 to copy the values topublic void setPosition(float x, float y, float z)
x
- The x coordinate of the new positiony
- The y coordinate of the new positionz
- The z coordinate of the new positionpublic void getColor(float[] val)
val
- An array of length 4 to copy the values topublic void setColor(float r, float g, float b, float alpha)
r
- The red component of the colourg
- The green component of the colourb
- The blue component of the colouralpha
- The alpha component of the colourpublic float[] getBounds()
public void incAge()
public final int getCycleAge()
public void setCycleAge(int age)
age
- The new age to setpublic final int getCycleTime()
public final long getBirthTime()
public void setCycleTime(int time)
time
- The new time to setpublic final float getMass()
public void setMass(float mass)
mass
- The mass to setpublic javax.vecmath.Vector3f getResultantForce()
public void setResultantForce(javax.vecmath.Vector3f force)
force
- The resultant Force to setpublic final float getSurfaceArea()
public void setSurfaceArea(float surfaceArea)
surfaceArea
- The surfaceArea to setpublic javax.vecmath.Vector3f getVelocity()
public void setVelocity(javax.vecmath.Vector3f velocity)
velocity
- The velocity to setpublic void setDepth(float depth)
depth
- The depth to setpublic void setHeight(float height)
height
- The height to setpublic void setWidth(float width)
width
- The width to setpublic final float getWidth()
public final float getHeight()
public final float getDepth()
|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |