|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.scene.Spatial
com.jme.scene.Node
com.jmex.effects.particles.ParticleSystem
public abstract class ParticleSystem
ParticleGeometry is an abstract class representing a particle system. A ParticleController must be attached for the effect to be complete.
Nested Class Summary | |
---|---|
static class |
ParticleSystem.EmitType
|
static class |
ParticleSystem.ParticleType
|
Nested classes/interfaces inherited from class com.jme.scene.Spatial |
---|
Spatial.CullHint, Spatial.LightCombineMode, Spatial.NormalsMode, Spatial.TextureCombineMode |
Field Summary | |
---|---|
protected Vector3f |
absUpVector
|
protected Vector3f |
abUpMinUp
|
protected java.nio.FloatBuffer |
appearanceColors
|
protected boolean |
cameraFacing
|
protected ParticleController |
controller
|
protected static ColorRGBA |
DEFAULT_END_COLOR
|
protected static float |
DEFAULT_END_SIZE
|
protected static float |
DEFAULT_MAX_ANGLE
|
protected static float |
DEFAULT_MAX_LIFE
|
protected static float |
DEFAULT_MIN_LIFE
|
protected static ColorRGBA |
DEFAULT_START_COLOR
|
protected static float |
DEFAULT_START_SIZE
|
protected Vector3f |
emissionDirection
|
protected TransformMatrix |
emitterTransform
|
protected ParticleSystem.EmitType |
emitType
|
protected ColorRGBA |
endColor
|
protected float |
endMass
|
protected float |
endSize
|
protected float |
endSpin
|
protected java.nio.FloatBuffer |
geometryCoordinates
|
protected float |
initialVelocity
|
protected Vector3f |
invScale
|
protected Vector3f |
leftVector
|
protected float[][] |
matData
|
protected float |
maximumAngle
|
protected float |
maximumLifeTime
|
protected float |
minimumAngle
|
protected float |
minimumLifeTime
|
protected int |
numParticles
|
protected Vector3f |
oldEmit
Setup the rotation matrix used to determine initial particle velocity based on emission angle and emission direction. |
protected Vector3f |
originCenter
|
protected Vector3f |
originOffset
|
protected Geometry |
particleGeom
|
protected float |
particleOrientation
|
protected Particle[] |
particles
|
protected boolean |
particlesInWorldCoords
|
protected ParticleSystem.ParticleType |
particleType
|
protected Geometry |
psGeom
|
protected Line |
psLine
|
protected Rectangle |
psRect
|
protected Ring |
psRing
|
protected ParticleAppearanceRamp |
ramp
|
protected int |
releaseRate
|
protected boolean |
rotateWithScene
|
protected Matrix3f |
rotMatrix
|
protected static long |
serialVersionUID
|
protected ColorRGBA |
startColor
|
protected float |
startMass
|
protected float |
startSize
|
protected float |
startSpin
|
protected int |
startTexIndex
|
protected TexAnimation |
texAnimation
|
protected int |
texQuantity
|
protected Vector3f |
upVector
|
protected Vector3f |
upXemit
|
protected boolean |
velocityAligned
|
protected static Vector2f |
workVect2
|
protected static Vector3f |
workVect3
|
protected Vector3f |
worldEmit
|
Fields inherited from class com.jme.scene.Node |
---|
children |
Fields inherited from class com.jme.scene.Spatial |
---|
cullHint, frustrumIntersects, geometricalControllers, isCollidable, lightCombineMode, localRotation, localScale, localTranslation, LOCKED_BOUNDS, LOCKED_BRANCH, LOCKED_MESH_DATA, LOCKED_NONE, LOCKED_SHADOWS, LOCKED_TRANSFORMS, lockedMode, name, normalsMode, parent, queueDistance, renderQueueMode, renderStateList, textureCombineMode, worldBound, worldRotation, worldScale, worldTranslation, zOrder |
Constructor Summary | |
---|---|
ParticleSystem()
|
|
ParticleSystem(java.lang.String name,
int numParticles)
|
|
ParticleSystem(java.lang.String name,
int numParticles,
ParticleSystem.ParticleType particleType)
|
Method Summary | |
---|---|
void |
addController(Controller c)
Adds a Controller to this Spatial's list of controllers. |
void |
addInfluence(ParticleInfluence influence)
Add an external influence to the particle controller for this mesh. |
void |
clearInfluences()
|
void |
forceRespawn()
|
Vector3f |
getEmissionDirection()
|
TransformMatrix |
getEmitterTransform()
|
ParticleSystem.EmitType |
getEmitType()
Get which emittype method is being used by the underlying system. |
ColorRGBA |
getEndColor()
getEndColor returns the ending color. |
float |
getEndMass()
|
float |
getEndSize()
|
float |
getEndSpin()
|
Geometry |
getGeometry()
getGeometry returns the currently set Geometry emitter. |
java.util.ArrayList<ParticleInfluence> |
getInfluences()
Returns the list of influences acting on this particle controller. |
float |
getInitialVelocity()
Get the acceleration set in this manager. |
Vector3f |
getInvScale()
|
Vector3f |
getLeftVector()
|
Line |
getLine()
getLine returns the currently set line segment. |
float |
getMaximumAngle()
getEmissionMaximumAngle returns the maximum emission angle. |
float |
getMaximumLifeTime()
getParticlesMaximumLifeTime returns the maximum life time of a particle. |
float |
getMinimumAngle()
getEmissionMinimumAngle returns the minimum emission angle. |
float |
getMinimumLifeTime()
getParticlesMinimumLifeTime returns the minimum life time of a particle. |
int |
getNumParticles()
|
Vector3f |
getOriginCenter()
|
Vector3f |
getOriginOffset()
Get the offset point set in this manager. |
Particle |
getParticle(int i)
|
ParticleController |
getParticleController()
|
abstract Geometry |
getParticleGeometry()
|
float |
getParticleOrientation()
|
ParticleSystem.ParticleType |
getParticleType()
Get which emittype method is being used by the underlying system. |
ParticleAppearanceRamp |
getRamp()
|
float |
getRandomAngle()
Returns a random angle between the min and max angles. |
float |
getRandomLifeSpan()
generate a random lifespan between the min and max lifespan of the particle system. |
protected Vector3f |
getRandomVelocity(Vector3f pSpeed)
Generate a random velocity within the parameters of max angle and the rotation matrix. |
Rectangle |
getRectangle()
getRectangle returns the currently set rectangle segment. |
int |
getReleaseRate()
Get the number of particles the manager should release per second. |
float |
getReleaseVariance()
|
Ring |
getRing()
getRing returns the currently set ring emission area. |
Matrix3f |
getRotMatrix()
|
ColorRGBA |
getStartColor()
getStartColor returns the starting color. |
float |
getStartMass()
|
float |
getStartSize()
|
float |
getStartSpin()
|
int |
getStartTexIndex()
|
TexAnimation |
getTexAnimation()
|
int |
getTexQuantity()
|
Vector3f |
getUpVector()
|
static int |
getVertsForParticleType(ParticleSystem.ParticleType type)
|
Vector3f |
getWorldEmit()
|
void |
initAllParticlesLocation()
|
protected abstract void |
initializeParticles(int numParticles)
|
void |
initParticleLocation(int index)
|
boolean |
isActive()
|
boolean |
isCameraFacing()
|
boolean |
isParticlesInWorldCoords()
|
boolean |
isRotateWithScene()
|
boolean |
isVelocityAligned()
|
void |
read(JMEImporter e)
|
void |
recreate(int count)
Changes the number of particles in this particle mesh. |
boolean |
removeInfluence(ParticleInfluence influence)
Remove an influence from the particle controller for this mesh. |
void |
resetParticleVelocity(int i)
|
protected void |
rotateVectorSpeed(Vector3f pSpeed)
Apply the rotation matrix to a given vector representing a particle velocity. |
void |
setCameraFacing(boolean cameraFacing)
|
void |
setControlFlow(boolean b)
|
void |
setEmissionDirection(Vector3f emissionDirection)
|
void |
setEmitterTransform(TransformMatrix emitterTransform)
|
void |
setEmitType(ParticleSystem.EmitType type)
Set which emittype method is being used by the underlying system. |
void |
setEndColor(ColorRGBA color)
Set the end color for particles. |
void |
setEndMass(float endMass)
|
void |
setEndSize(float size)
|
void |
setEndSpin(float endSpin)
|
void |
setGeometry(Geometry geom)
Set a Geometry's verts to be the random emission points |
void |
setGeometry(Line line)
Set a line segment to be used as the "emittor". |
void |
setGeometry(Rectangle rect)
Set a rectangular patch to be used as the "emittor". |
void |
setGeometry(Ring ring)
Set a ring or disk to be used as the "emittor". |
void |
setInitialVelocity(float velocity)
Set the acceleration for any new particles created (or recreated) by this manager. |
void |
setInvScale(Vector3f invScale)
|
void |
setLeftVector(Vector3f leftVector)
|
void |
setMaximumAngle(float f)
Set the maximum angle (in radians) that particles can be emitted away from the emission direction. |
void |
setMaximumLifeTime(float lifeSpan)
Set the maximum lifespan of new particles (or recreated) managed by this manager. |
void |
setMinimumAngle(float f)
Set the minimum angle (in radians) that particles can be emitted away from the emission direction. |
void |
setMinimumLifeTime(float lifeSpan)
Set the minimum lifespan of new particles (or recreated) managed by this manager. |
void |
setNumParticles(int numParticles)
|
void |
setOriginOffset(Vector3f offset)
Set the offset for any new particles created (or recreated) by this manager. |
void |
setParticleMass(float mass)
|
void |
setParticleOrientation(float orient)
|
void |
setParticlesInWorldCoords(boolean particlesInWorldCoords)
|
void |
setParticleSpinSpeed(float speed)
Set the start and end spinSpeed of particles managed by this manager. |
void |
setParticleType(ParticleSystem.ParticleType type)
Set what type of particle to emit from this sytem. |
void |
setRamp(ParticleAppearanceRamp ramp)
|
void |
setReleaseRate(int particlesPerSecond)
Set the number of particles the manager should release per second. |
void |
setReleaseVariance(float var)
|
void |
setRepeatType(int type)
|
void |
setRotateWithScene(boolean rotate)
|
void |
setRotMatrix(Matrix3f rotMatrix)
|
void |
setSpeed(float f)
|
void |
setStartColor(ColorRGBA color)
Set the start color for particles. |
void |
setStartMass(float startMass)
|
void |
setStartSize(float size)
|
void |
setStartSpin(float startSpin)
|
void |
setStartTexIndex(int startTexIndex)
|
void |
setTexAnimation(TexAnimation texAnimation)
|
void |
setTexQuantity(int quantity)
|
void |
setUpVector(Vector3f upVector)
|
void |
setVelocityAligned(boolean velocityAligned)
|
void |
setWorldEmit(Vector3f worldEmit)
|
void |
updateGeometricState(float time,
boolean initiator)
updateGeometricState updates all the geometry information
for the node. |
void |
updateInvScale()
|
void |
updateRotationMatrix()
|
void |
updateWorldBound()
updateWorldBound merges the bounds of all the children
maintained by this node. |
void |
updateWorldBoundManually()
|
void |
warmUp(int iterations)
|
void |
write(JMEExporter e)
|
Methods inherited from class com.jme.scene.Node |
---|
applyRenderState, attachChild, attachChildAt, childChange, detachAllChildren, detachChild, detachChildAt, detachChildNamed, draw, findCollisions, findPick, getChild, getChild, getChildIndex, getChildren, getQuantity, getTriangleCount, getVertexCount, hasChild, hasCollision, lockBounds, lockMeshes, lockShadows, lockTransforms, setModelBound, sortLights, swapChildren, unlockBounds, unlockMeshes, unlockShadows, unlockTransforms, updateModelBound, updateWorldData, updateWorldVectors |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.jme.util.export.Savable |
---|
getClassTag |
Field Detail |
---|
protected static final long serialVersionUID
protected static final float DEFAULT_END_SIZE
protected static final float DEFAULT_START_SIZE
protected static final float DEFAULT_MAX_ANGLE
protected static final float DEFAULT_MAX_LIFE
protected static final float DEFAULT_MIN_LIFE
protected static final ColorRGBA DEFAULT_START_COLOR
protected static final ColorRGBA DEFAULT_END_COLOR
protected ParticleSystem.ParticleType particleType
protected ParticleSystem.EmitType emitType
protected Line psLine
protected Rectangle psRect
protected Geometry psGeom
protected Ring psRing
protected boolean cameraFacing
protected boolean velocityAligned
protected boolean particlesInWorldCoords
protected float startSize
protected float endSize
protected ColorRGBA startColor
protected ColorRGBA endColor
protected ParticleAppearanceRamp ramp
protected TexAnimation texAnimation
protected float initialVelocity
protected float minimumLifeTime
protected float maximumLifeTime
protected float minimumAngle
protected float maximumAngle
protected float startSpin
protected float endSpin
protected float startMass
protected float endMass
protected int startTexIndex
protected int texQuantity
protected Vector3f emissionDirection
protected TransformMatrix emitterTransform
protected Vector3f worldEmit
protected int numParticles
protected boolean rotateWithScene
protected Matrix3f rotMatrix
protected float particleOrientation
protected java.nio.FloatBuffer geometryCoordinates
protected java.nio.FloatBuffer appearanceColors
protected Vector3f upXemit
protected Vector3f absUpVector
protected Vector3f abUpMinUp
protected Vector3f upVector
protected Vector3f leftVector
protected Vector3f invScale
protected Particle[] particles
protected int releaseRate
protected Vector3f originOffset
protected Vector3f originCenter
protected static Vector2f workVect2
protected static Vector3f workVect3
protected Geometry particleGeom
protected ParticleController controller
protected Vector3f oldEmit
protected float[][] matData
Constructor Detail |
---|
public ParticleSystem()
public ParticleSystem(java.lang.String name, int numParticles)
public ParticleSystem(java.lang.String name, int numParticles, ParticleSystem.ParticleType particleType)
Method Detail |
---|
protected abstract void initializeParticles(int numParticles)
public static int getVertsForParticleType(ParticleSystem.ParticleType type)
public void forceRespawn()
public void updateRotationMatrix()
public abstract Geometry getParticleGeometry()
public ParticleController getParticleController()
public void addController(Controller c)
Spatial
addController
in class Spatial
c
- The Controller to addController
public Vector3f getEmissionDirection()
public void setEmissionDirection(Vector3f emissionDirection)
public float getEndSize()
public void setEndSize(float size)
public float getStartSize()
public void setStartSize(float size)
public void setStartColor(ColorRGBA color)
color
- The start color.public ColorRGBA getStartColor()
getStartColor
returns the starting color.
public void setEndColor(ColorRGBA color)
color
- ColorRGBA The ending color.public ColorRGBA getEndColor()
public void setParticleSpinSpeed(float speed)
speed
- floatpublic Vector3f getInvScale()
public void setInvScale(Vector3f invScale)
public void updateInvScale()
public void addInfluence(ParticleInfluence influence)
influence
- ParticleInfluencepublic boolean removeInfluence(ParticleInfluence influence)
influence
- ParticleInfluence
public java.util.ArrayList<ParticleInfluence> getInfluences()
public void clearInfluences()
public void setParticleMass(float mass)
public void setMinimumAngle(float f)
f
- The new emission minimum angle.public float getMinimumAngle()
public void setMaximumAngle(float f)
f
- The new emission maximum angle.public float getMaximumAngle()
public void setMinimumLifeTime(float lifeSpan)
lifeSpan
- in mspublic float getMinimumLifeTime()
public void setMaximumLifeTime(float lifeSpan)
lifeSpan
- in mspublic float getMaximumLifeTime()
public Matrix3f getRotMatrix()
public void setRotMatrix(Matrix3f rotMatrix)
public TransformMatrix getEmitterTransform()
public void setEmitterTransform(TransformMatrix emitterTransform)
public float getParticleOrientation()
public void setParticleOrientation(float orient)
public void setInitialVelocity(float velocity)
velocity
- particle v0public float getInitialVelocity()
public void setOriginOffset(Vector3f offset)
offset
- new offset positionpublic Vector3f getOriginOffset()
public Vector3f getWorldEmit()
public void setWorldEmit(Vector3f worldEmit)
public int getReleaseRate()
public void setReleaseRate(int particlesPerSecond)
particlesPerSecond
- number of particles per secondpublic float getEndMass()
public void setEndMass(float endMass)
public float getEndSpin()
public void setEndSpin(float endSpin)
public float getStartMass()
public void setStartMass(float startMass)
public float getStartSpin()
public void setStartSpin(float startSpin)
public int getTexQuantity()
public void setTexQuantity(int quantity)
public int getStartTexIndex()
public void setStartTexIndex(int startTexIndex)
public ParticleSystem.EmitType getEmitType()
public void setEmitType(ParticleSystem.EmitType type)
type
- emit type to usepublic ParticleSystem.ParticleType getParticleType()
public void setParticleType(ParticleSystem.ParticleType type)
type
- particle type to use, should be one of ParticleType.Quad,
ParticleType.Triangle, ParticleType.Point, ParticleType.Line,
ParticleType.GeomMeshpublic void setGeometry(Line line)
line
- New emittor line segment.public void setGeometry(Rectangle rect)
rect
- New rectangular patch.public void setGeometry(Ring ring)
ring
- The new ring area.public void setGeometry(Geometry geom)
geom
- The new geometry random verts.public Line getLine()
public Rectangle getRectangle()
public Ring getRing()
public Geometry getGeometry()
public void initAllParticlesLocation()
public void initParticleLocation(int index)
public boolean isCameraFacing()
public void setCameraFacing(boolean cameraFacing)
public boolean isVelocityAligned()
public void setVelocityAligned(boolean velocityAligned)
public Particle getParticle(int i)
public boolean isActive()
public void setSpeed(float f)
public void setRepeatType(int type)
public void setControlFlow(boolean b)
public Vector3f getOriginCenter()
public Vector3f getUpVector()
public void setUpVector(Vector3f upVector)
public Vector3f getLeftVector()
public void setLeftVector(Vector3f leftVector)
public boolean isRotateWithScene()
public void setRotateWithScene(boolean rotate)
public void resetParticleVelocity(int i)
public float getRandomAngle()
public float getRandomLifeSpan()
protected Vector3f getRandomVelocity(Vector3f pSpeed)
pSpeed
- a vector to store the results in.protected void rotateVectorSpeed(Vector3f pSpeed)
pSpeed
- the velocity vector to be modified.public void warmUp(int iterations)
public int getNumParticles()
public void setNumParticles(int numParticles)
public float getReleaseVariance()
public void setReleaseVariance(float var)
public ParticleAppearanceRamp getRamp()
public void setRamp(ParticleAppearanceRamp ramp)
public TexAnimation getTexAnimation()
public void setTexAnimation(TexAnimation texAnimation)
public boolean isParticlesInWorldCoords()
public void setParticlesInWorldCoords(boolean particlesInWorldCoords)
public void recreate(int count)
count
- the desired number of particles to change to.public void updateWorldBound()
Node
updateWorldBound
merges the bounds of all the children
maintained by this node. This will allow for faster culling operations.
updateWorldBound
in class Node
Spatial.updateWorldBound()
public void updateWorldBoundManually()
public void updateGeometricState(float time, boolean initiator)
Spatial
updateGeometricState
updates all the geometry information
for the node.
updateGeometricState
in class Spatial
time
- the frame time.initiator
- true if this node started the update process.public void write(JMEExporter e) throws java.io.IOException
write
in interface Savable
write
in class Node
java.io.IOException
public void read(JMEImporter e) throws java.io.IOException
read
in interface Savable
read
in class Node
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |