com.jmex.effects.particles
Class ParticleSystem

java.lang.Object
  extended by com.jme.scene.Spatial
      extended by com.jme.scene.Node
          extended by com.jmex.effects.particles.ParticleSystem
All Implemented Interfaces:
Savable, java.io.Serializable
Direct Known Subclasses:
ParticleLines, ParticleMesh, ParticlePoints

public abstract class ParticleSystem
extends Node

ParticleGeometry is an abstract class representing a particle system. A ParticleController must be attached for the effect to be complete.

Version:
$Id: ParticleSystem.java 4133 2009-03-19 20:40:11Z blaine.dev $
Author:
Joshua Slack
See Also:
Serialized Form

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 com.jme.scene.Spatial
calculateCollisions, calculatePick, clearControllers, clearRenderState, clearRenderState, getClassTag, getController, getControllerCount, getControllers, getCullHint, getLastFrustumIntersection, getLightCombineMode, getLocalCullHint, getLocalLightCombineMode, getLocalNormalsMode, getLocalRenderQueueMode, getLocalRotation, getLocalScale, getLocalTextureCombineMode, getLocalToWorldMatrix, getLocalTranslation, getLocks, getName, getNormalsMode, getParent, getRenderQueueMode, getRenderState, getRenderState, getTextureCombineMode, getUserData, getWorldBound, getWorldRotation, getWorldScale, getWorldTranslation, getZOrder, hasAncestor, isCollidable, localToWorld, lock, lock, lockBranch, lockMeshes, lookAt, onDraw, propagateBoundToRoot, propagateStatesFromRoot, removeController, removeController, removeFromParent, removeUserData, rotateUpTo, setCullHint, setIsCollidable, setLastFrustumIntersection, setLightCombineMode, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalTranslation, setLocalTranslation, setLocks, setLocks, setName, setNormalsMode, setParent, setRenderQueueMode, setRenderState, setTextureCombineMode, setUserData, setZOrder, setZOrder, toString, unlock, unlock, unlockBranch, unlockMeshes, updateRenderState, updateRenderState, updateWorldRotation, updateWorldScale, updateWorldTranslation, updateWorldVectors, worldToLocal
 
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

serialVersionUID

protected static final long serialVersionUID
See Also:
Constant Field Values

DEFAULT_END_SIZE

protected static final float DEFAULT_END_SIZE
See Also:
Constant Field Values

DEFAULT_START_SIZE

protected static final float DEFAULT_START_SIZE
See Also:
Constant Field Values

DEFAULT_MAX_ANGLE

protected static final float DEFAULT_MAX_ANGLE
See Also:
Constant Field Values

DEFAULT_MAX_LIFE

protected static final float DEFAULT_MAX_LIFE
See Also:
Constant Field Values

DEFAULT_MIN_LIFE

protected static final float DEFAULT_MIN_LIFE
See Also:
Constant Field Values

DEFAULT_START_COLOR

protected static final ColorRGBA DEFAULT_START_COLOR

DEFAULT_END_COLOR

protected static final ColorRGBA DEFAULT_END_COLOR

particleType

protected ParticleSystem.ParticleType particleType

emitType

protected ParticleSystem.EmitType emitType

psLine

protected Line psLine

psRect

protected Rectangle psRect

psGeom

protected Geometry psGeom

psRing

protected Ring psRing

cameraFacing

protected boolean cameraFacing

velocityAligned

protected boolean velocityAligned

particlesInWorldCoords

protected boolean particlesInWorldCoords

startSize

protected float startSize

endSize

protected float endSize

startColor

protected ColorRGBA startColor

endColor

protected ColorRGBA endColor

ramp

protected ParticleAppearanceRamp ramp

texAnimation

protected TexAnimation texAnimation

initialVelocity

protected float initialVelocity

minimumLifeTime

protected float minimumLifeTime

maximumLifeTime

protected float maximumLifeTime

minimumAngle

protected float minimumAngle

maximumAngle

protected float maximumAngle

startSpin

protected float startSpin

endSpin

protected float endSpin

startMass

protected float startMass

endMass

protected float endMass

startTexIndex

protected int startTexIndex

texQuantity

protected int texQuantity

emissionDirection

protected Vector3f emissionDirection

emitterTransform

protected TransformMatrix emitterTransform

worldEmit

protected Vector3f worldEmit

numParticles

protected int numParticles

rotateWithScene

protected boolean rotateWithScene

rotMatrix

protected Matrix3f rotMatrix

particleOrientation

protected float particleOrientation

geometryCoordinates

protected java.nio.FloatBuffer geometryCoordinates

appearanceColors

protected java.nio.FloatBuffer appearanceColors

upXemit

protected Vector3f upXemit

absUpVector

protected Vector3f absUpVector

abUpMinUp

protected Vector3f abUpMinUp

upVector

protected Vector3f upVector

leftVector

protected Vector3f leftVector

invScale

protected Vector3f invScale

particles

protected Particle[] particles

releaseRate

protected int releaseRate

originOffset

protected Vector3f originOffset

originCenter

protected Vector3f originCenter

workVect2

protected static Vector2f workVect2

workVect3

protected static Vector3f workVect3

particleGeom

protected Geometry particleGeom

controller

protected ParticleController controller

oldEmit

protected Vector3f oldEmit
Setup the rotation matrix used to determine initial particle velocity based on emission angle and emission direction. called automatically by the set* methods for those parameters.


matData

protected float[][] matData
Constructor Detail

ParticleSystem

public ParticleSystem()

ParticleSystem

public ParticleSystem(java.lang.String name,
                      int numParticles)

ParticleSystem

public ParticleSystem(java.lang.String name,
                      int numParticles,
                      ParticleSystem.ParticleType particleType)
Method Detail

initializeParticles

protected abstract void initializeParticles(int numParticles)

getVertsForParticleType

public static int getVertsForParticleType(ParticleSystem.ParticleType type)

forceRespawn

public void forceRespawn()

updateRotationMatrix

public void updateRotationMatrix()

getParticleGeometry

public abstract Geometry getParticleGeometry()

getParticleController

public ParticleController getParticleController()

addController

public void addController(Controller c)
Description copied from class: Spatial
Adds a Controller to this Spatial's list of controllers.

Overrides:
addController in class Spatial
Parameters:
c - The Controller to add
See Also:
Controller

getEmissionDirection

public Vector3f getEmissionDirection()

setEmissionDirection

public void setEmissionDirection(Vector3f emissionDirection)

getEndSize

public float getEndSize()

setEndSize

public void setEndSize(float size)

getStartSize

public float getStartSize()

setStartSize

public void setStartSize(float size)

setStartColor

public void setStartColor(ColorRGBA color)
Set the start color for particles. This is the base color of the quad.

Parameters:
color - The start color.

getStartColor

public ColorRGBA getStartColor()
getStartColor returns the starting color.

Returns:
ColorRGBA The begining color.

setEndColor

public void setEndColor(ColorRGBA color)
Set the end color for particles. The base color of the quad will linearly approach this color from the start color over the lifetime of the particle.

Parameters:
color - ColorRGBA The ending color.

getEndColor

public ColorRGBA getEndColor()
getEndColor returns the ending color.

Returns:
The ending color

setParticleSpinSpeed

public void setParticleSpinSpeed(float speed)
Set the start and end spinSpeed of particles managed by this manager. Setting it to 0 means no spin.

Parameters:
speed - float

getInvScale

public Vector3f getInvScale()

setInvScale

public void setInvScale(Vector3f invScale)

updateInvScale

public void updateInvScale()

addInfluence

public void addInfluence(ParticleInfluence influence)
Add an external influence to the particle controller for this mesh.

Parameters:
influence - ParticleInfluence

removeInfluence

public boolean removeInfluence(ParticleInfluence influence)
Remove an influence from the particle controller for this mesh.

Parameters:
influence - ParticleInfluence
Returns:
true if found and removed.

getInfluences

public java.util.ArrayList<ParticleInfluence> getInfluences()
Returns the list of influences acting on this particle controller.

Returns:
ArrayList

clearInfluences

public void clearInfluences()

setParticleMass

public void setParticleMass(float mass)

setMinimumAngle

public void setMinimumAngle(float f)
Set the minimum angle (in radians) that particles can be emitted away from the emission direction. Any angle less than 0 is trimmed to 0.

Parameters:
f - The new emission minimum angle.

getMinimumAngle

public float getMinimumAngle()
getEmissionMinimumAngle returns the minimum emission angle.

Returns:
The minimum emission angle.

setMaximumAngle

public void setMaximumAngle(float f)
Set the maximum angle (in radians) that particles can be emitted away from the emission direction. Any angle less than 0 is trimmed to 0.

Parameters:
f - The new emission maximum angle.

getMaximumAngle

public float getMaximumAngle()
getEmissionMaximumAngle returns the maximum emission angle.

Returns:
The maximum emission angle.

setMinimumLifeTime

public void setMinimumLifeTime(float lifeSpan)
Set the minimum lifespan of new particles (or recreated) managed by this manager. if a value less than zero is given, 1.0f is used.

Parameters:
lifeSpan - in ms

getMinimumLifeTime

public float getMinimumLifeTime()
getParticlesMinimumLifeTime returns the minimum life time of a particle.

Returns:
The current minimum life time in ms.

setMaximumLifeTime

public void setMaximumLifeTime(float lifeSpan)
Set the maximum lifespan of new particles (or recreated) managed by this manager. if a value less than zero is given, 1.0f is used.

Parameters:
lifeSpan - in ms

getMaximumLifeTime

public float getMaximumLifeTime()
getParticlesMaximumLifeTime returns the maximum life time of a particle.

Returns:
The current maximum life time in ms.

getRotMatrix

public Matrix3f getRotMatrix()

setRotMatrix

public void setRotMatrix(Matrix3f rotMatrix)

getEmitterTransform

public TransformMatrix getEmitterTransform()

setEmitterTransform

public void setEmitterTransform(TransformMatrix emitterTransform)

getParticleOrientation

public float getParticleOrientation()

setParticleOrientation

public void setParticleOrientation(float orient)

setInitialVelocity

public void setInitialVelocity(float velocity)
Set the acceleration for any new particles created (or recreated) by this manager.

Parameters:
velocity - particle v0

getInitialVelocity

public float getInitialVelocity()
Get the acceleration set in this manager.

Returns:
The initialVelocity

setOriginOffset

public void setOriginOffset(Vector3f offset)
Set the offset for any new particles created (or recreated) by this manager. This is applicable only to managers generating from a point (not a line, rectangle, etc..)

Parameters:
offset - new offset position

getOriginOffset

public Vector3f getOriginOffset()
Get the offset point set in this manager.

Returns:
origin

getWorldEmit

public Vector3f getWorldEmit()

setWorldEmit

public void setWorldEmit(Vector3f worldEmit)

getReleaseRate

public int getReleaseRate()
Get the number of particles the manager should release per second.

Returns:
The number of particles that should be released per second.

setReleaseRate

public void setReleaseRate(int particlesPerSecond)
Set the number of particles the manager should release per second.

Parameters:
particlesPerSecond - number of particles per second

getEndMass

public float getEndMass()

setEndMass

public void setEndMass(float endMass)

getEndSpin

public float getEndSpin()

setEndSpin

public void setEndSpin(float endSpin)

getStartMass

public float getStartMass()

setStartMass

public void setStartMass(float startMass)

getStartSpin

public float getStartSpin()

setStartSpin

public void setStartSpin(float startSpin)

getTexQuantity

public int getTexQuantity()

setTexQuantity

public void setTexQuantity(int quantity)

getStartTexIndex

public int getStartTexIndex()

setStartTexIndex

public void setStartTexIndex(int startTexIndex)

getEmitType

public ParticleSystem.EmitType getEmitType()
Get which emittype method is being used by the underlying system. One of EmitType.Point, EmitType.Line, EmitType.Rectangle, EmitType.Ring, EmitType.GeomMesh

Returns:
An int representing the current geometry method being used.

setEmitType

public void setEmitType(ParticleSystem.EmitType type)
Set which emittype method is being used by the underlying system. This is already done by setGeometry(Line) and setGeometry(Rectangle) You should not need to use this method unless you are switching between geometry already set by those methods.

Parameters:
type - emit type to use

getParticleType

public ParticleSystem.ParticleType getParticleType()
Get which emittype method is being used by the underlying system. One of ParticleType.Quad, ParticleType.Triangle, ParticleType.Point, ParticleType.Line, ParticleType.GeomMesh

Returns:
An int representing the type of particle we are emitting.

setParticleType

public void setParticleType(ParticleSystem.ParticleType type)
Set what type of particle to emit from this sytem. Does not have an effect unless recreate is called.

Parameters:
type - particle type to use, should be one of ParticleType.Quad, ParticleType.Triangle, ParticleType.Point, ParticleType.Line, ParticleType.GeomMesh

setGeometry

public void setGeometry(Line line)
Set a line segment to be used as the "emittor".

Parameters:
line - New emittor line segment.

setGeometry

public void setGeometry(Rectangle rect)
Set a rectangular patch to be used as the "emittor".

Parameters:
rect - New rectangular patch.

setGeometry

public void setGeometry(Ring ring)
Set a ring or disk to be used as the "emittor".

Parameters:
ring - The new ring area.

setGeometry

public void setGeometry(Geometry geom)
Set a Geometry's verts to be the random emission points

Parameters:
geom - The new geometry random verts.

getLine

public Line getLine()
getLine returns the currently set line segment.

Returns:
current line segment.

getRectangle

public Rectangle getRectangle()
getRectangle returns the currently set rectangle segment.

Returns:
current rectangle segment.

getRing

public Ring getRing()
getRing returns the currently set ring emission area.

Returns:
current ring.

getGeometry

public Geometry getGeometry()
getGeometry returns the currently set Geometry emitter.

Returns:
current Geometry emitter.

initAllParticlesLocation

public void initAllParticlesLocation()

initParticleLocation

public void initParticleLocation(int index)

isCameraFacing

public boolean isCameraFacing()

setCameraFacing

public void setCameraFacing(boolean cameraFacing)

isVelocityAligned

public boolean isVelocityAligned()

setVelocityAligned

public void setVelocityAligned(boolean velocityAligned)

getParticle

public Particle getParticle(int i)

isActive

public boolean isActive()

setSpeed

public void setSpeed(float f)

setRepeatType

public void setRepeatType(int type)

setControlFlow

public void setControlFlow(boolean b)

getOriginCenter

public Vector3f getOriginCenter()

getUpVector

public Vector3f getUpVector()

setUpVector

public void setUpVector(Vector3f upVector)

getLeftVector

public Vector3f getLeftVector()

setLeftVector

public void setLeftVector(Vector3f leftVector)

isRotateWithScene

public boolean isRotateWithScene()

setRotateWithScene

public void setRotateWithScene(boolean rotate)

resetParticleVelocity

public void resetParticleVelocity(int i)

getRandomAngle

public float getRandomAngle()
Returns a random angle between the min and max angles.

Returns:
the random angle.

getRandomLifeSpan

public float getRandomLifeSpan()
generate a random lifespan between the min and max lifespan of the particle system.

Returns:
the generated lifespan value

getRandomVelocity

protected Vector3f getRandomVelocity(Vector3f pSpeed)
Generate a random velocity within the parameters of max angle and the rotation matrix.

Parameters:
pSpeed - a vector to store the results in.

rotateVectorSpeed

protected void rotateVectorSpeed(Vector3f pSpeed)
Apply the rotation matrix to a given vector representing a particle velocity.

Parameters:
pSpeed - the velocity vector to be modified.

warmUp

public void warmUp(int iterations)

getNumParticles

public int getNumParticles()

setNumParticles

public void setNumParticles(int numParticles)

getReleaseVariance

public float getReleaseVariance()

setReleaseVariance

public void setReleaseVariance(float var)

getRamp

public ParticleAppearanceRamp getRamp()

setRamp

public void setRamp(ParticleAppearanceRamp ramp)

getTexAnimation

public TexAnimation getTexAnimation()

setTexAnimation

public void setTexAnimation(TexAnimation texAnimation)

isParticlesInWorldCoords

public boolean isParticlesInWorldCoords()
Returns:
true if the particles are already in world coordinate space (default). When true, scene-graph transforms will only affect the emission of particles, not particles that are already living.

setParticlesInWorldCoords

public void setParticlesInWorldCoords(boolean particlesInWorldCoords)

recreate

public void recreate(int count)
Changes the number of particles in this particle mesh.

Parameters:
count - the desired number of particles to change to.

updateWorldBound

public void updateWorldBound()
Description copied from class: Node
updateWorldBound merges the bounds of all the children maintained by this node. This will allow for faster culling operations.

Overrides:
updateWorldBound in class Node
See Also:
Spatial.updateWorldBound()

updateWorldBoundManually

public void updateWorldBoundManually()

updateGeometricState

public void updateGeometricState(float time,
                                 boolean initiator)
Description copied from class: Spatial
updateGeometricState updates all the geometry information for the node.

Overrides:
updateGeometricState in class Spatial
Parameters:
time - the frame time.
initiator - true if this node started the update process.

write

public void write(JMEExporter e)
           throws java.io.IOException
Specified by:
write in interface Savable
Overrides:
write in class Node
Throws:
java.io.IOException

read

public void read(JMEImporter e)
          throws java.io.IOException
Specified by:
read in interface Savable
Overrides:
read in class Node
Throws:
java.io.IOException