|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jmex.effects.particles.Particle
public class Particle
Particle
defines a single Particle of a Particle system.
Generally, you would not interact with this class directly.
Nested Class Summary | |
---|---|
static class |
Particle.Status
|
Field Summary | |
---|---|
(package private) static int |
VAL_CURRENT_MASS
|
(package private) static int |
VAL_CURRENT_SIZE
|
(package private) static int |
VAL_CURRENT_SPIN
|
Constructor Summary | |
---|---|
Particle()
Empty constructor - mostly for use with Savable interface |
|
Particle(ParticleSystem parent)
Normal use constructor. |
Method Summary | |
---|---|
java.lang.Class<? extends Particle> |
getClassTag()
|
int |
getCurrentAge()
|
ColorRGBA |
getCurrentColor()
|
float |
getInvMass()
|
float |
getMass()
|
Vector3f |
getPosition()
|
int |
getStartIndex()
|
Particle.Status |
getStatus()
|
Triangle |
getTriangleModel()
|
Vector3f |
getVelocity()
|
void |
init()
Cause this particle to reset it's lifespan, velocity, color, age and size per the parent's settings. |
void |
init(Vector3f velocity,
Vector3f position,
float lifeSpan)
Cause this particle to reset it's color, age and size per the parent's settings. |
void |
killParticle()
|
void |
read(JMEImporter e)
|
void |
recreateParticle(float lifeSpan)
Reset particle conditions. |
void |
resetAge()
Resets current age to 0 |
void |
setPosition(Vector3f position)
Set the position of the particle in space. |
void |
setStartIndex(int index)
Set the starting index where this particle is represented in its parent's geometry data |
void |
setStatus(Particle.Status status)
Set the status of this particle. |
void |
setTriangleModel(Triangle t)
Sets a triangle model to use for particle calculations when using particle type ParticleType.GeomMesh. |
void |
setVelocity(Vector3f velocity)
Set the current velocity of this particle |
boolean |
updateAndCheck(float secondsPassed)
update position (using current position and velocity), color (interpolating between start and end color), size (interpolating between start and end size), spin (using parent's spin speed) and current age of particle. |
void |
updateVerts(Camera cam)
Update the vertices for this particle, taking size, spin and viewer into consideration. |
void |
write(JMEExporter e)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final int VAL_CURRENT_SIZE
static final int VAL_CURRENT_SPIN
static final int VAL_CURRENT_MASS
Constructor Detail |
---|
public Particle()
public Particle(ParticleSystem parent)
parent
- the particle collection this particle belongs toMethod Detail |
---|
public void init()
public void init(Vector3f velocity, Vector3f position, float lifeSpan)
velocity
- new initial particle velocityposition
- new initial particle positionlifeSpan
- new particle lifespan in mspublic void recreateParticle(float lifeSpan)
lifeSpan
- the recreated particle's new lifespanpublic void updateVerts(Camera cam)
cam
- Camera to use in determining viewer aspect. If null, or if
parent is not set to camera facing, parent's left and up
vectors are used.public boolean updateAndCheck(float secondsPassed)
update position (using current position and velocity), color (interpolating between start and end color), size (interpolating between start and end size), spin (using parent's spin speed) and current age of particle. If this particle's age is greater than its lifespan, it is set to status DEAD.
Note that this only changes the parameters of the Particle, not the geometry the particle is associated with.
secondsPassed
- number of seconds passed since last update.
public void killParticle()
public void resetAge()
public int getCurrentAge()
public Vector3f getPosition()
public void setPosition(Vector3f position)
position
- the new position in world coordinatespublic Particle.Status getStatus()
Particle.Status
public void setStatus(Particle.Status status)
status
- new status of this particleParticle.Status
public Vector3f getVelocity()
public void setVelocity(Vector3f velocity)
velocity
- the new velocitypublic ColorRGBA getCurrentColor()
public int getStartIndex()
public void setStartIndex(int index)
index
- public float getMass()
public float getInvMass()
public void setTriangleModel(Triangle t)
t
- the triangle to model this particle after.public Triangle getTriangleModel()
setTriangleModel(Triangle)
public void write(JMEExporter e) throws java.io.IOException
write
in interface Savable
java.io.IOException
public void read(JMEImporter e) throws java.io.IOException
read
in interface Savable
java.io.IOException
public java.lang.Class<? extends Particle> getClassTag()
getClassTag
in interface Savable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |