|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.scene.Controller
com.jmex.effects.particles.ParticleController
public class ParticleController
ParticleController
controls and maintains the parameters of a
ParticleGeometry particle system over time.
Field Summary | |
---|---|
protected java.util.ArrayList<ParticleControllerListener> |
listeners
|
Fields inherited from class com.jme.scene.Controller |
---|
RT_CLAMP, RT_CYCLE, RT_WRAP |
Constructor Summary | |
---|---|
ParticleController()
|
|
ParticleController(ParticleSystem system)
ParticleManager constructor |
Method Summary | |
---|---|
void |
addInfluence(ParticleInfluence influence)
Add an external influence to this particle controller. |
void |
addListener(ParticleControllerListener listener)
Subscribe a listener to receive mouse events. |
void |
clearInfluences()
|
boolean |
containsListener(ParticleControllerListener listener)
Check if a listener is allready added to this ParticleController |
java.util.ArrayList<ParticleInfluence> |
getInfluences()
Returns the list of influences acting on this particle controller. |
int |
getIterations()
Return the number this manager has warmed up |
java.util.ArrayList<ParticleControllerListener> |
getListeners()
Get all added ParticleController listeners |
Spatial |
getParticles()
Get the Spatial that holds all of the particle information for display. |
float |
getPrecision()
Get how soon after the last update the manager will send updates to the particles. |
float |
getReleaseVariance()
Get the variance possible on the release rate. |
Camera |
getViewCamera()
|
boolean |
isControlFlow()
Does this manager regulate the particle flow? |
boolean |
isUpdateOnlyInView()
Does this manager use the particle's bounding volume to limit updates? |
void |
read(JMEImporter e)
|
boolean |
removeInfluence(ParticleInfluence influence)
Remove an influence from this particle controller. |
void |
removeListener(ParticleControllerListener listener)
Unsubscribe a listener. |
void |
removeListeners()
Remove all listeners and disable event generation. |
void |
setControlFlow(boolean regulate)
Set the regulate flow property on the manager. |
void |
setIterations(int iterations)
Sets the iterations for the warmup and calls warmUp with the number of iterations as the argument |
void |
setPrecision(float precision)
Set how soon after the last update the manager will send updates to the particles. |
void |
setReleaseVariance(float variance)
Set the variance possible on the release rate. |
void |
setUpdateOnlyInView(boolean updateOnlyInView)
Set the updateOnlyInView property on the manager. |
void |
setViewCamera(Camera viewCamera)
|
void |
update(float secondsPassed)
Update the particles managed by this manager. |
void |
warmUp(int iterations)
Runs the update method of this particle manager for iteration seconds with an update every .1 seconds (IE iterations * 10
update(.1f) calls). |
void |
write(JMEExporter e)
|
Methods inherited from class com.jme.scene.Controller |
---|
getClassTag, getControllerValues, getMaxTime, getMinTime, getRepeatType, getSpeed, isActive, setActive, setControllerValues, setMaxTime, setMinTime, setRepeatType, setSpeed |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.ArrayList<ParticleControllerListener> listeners
Constructor Detail |
---|
public ParticleController()
public ParticleController(ParticleSystem system)
system
- Target ParticleGeometry to act upon.Method Detail |
---|
public void update(float secondsPassed)
update
in class Controller
secondsPassed
- floatpublic float getPrecision()
public void setPrecision(float precision)
precision
- in secondspublic float getReleaseVariance()
public void setReleaseVariance(float variance)
variance
- release rate +/- variance as a percent (eg. .5 = 50%)public boolean isControlFlow()
public void setControlFlow(boolean regulate)
regulate
- regulate particle flow.public boolean isUpdateOnlyInView()
public void setUpdateOnlyInView(boolean updateOnlyInView)
updateOnlyInView
- use the particle's bounding volume to limit updates.public Camera getViewCamera()
public void setViewCamera(Camera viewCamera)
viewCamera
- sets the camera to be used in updateOnlyInView situations. If
null, the current displaySystem's renderer camera is used.public Spatial getParticles()
public int getIterations()
public void setIterations(int iterations)
iterations
- public void addInfluence(ParticleInfluence influence)
influence
- ParticleInfluencepublic boolean removeInfluence(ParticleInfluence influence)
influence
- ParticleInfluence
public java.util.ArrayList<ParticleInfluence> getInfluences()
public void clearInfluences()
public void addListener(ParticleControllerListener listener)
listener
- to be subscribedpublic void removeListener(ParticleControllerListener listener)
listener
- to be unsuscribedaddListener(ParticleControllerListener)
public void removeListeners()
public boolean containsListener(ParticleControllerListener listener)
listener
- listener to check for
public java.util.ArrayList<ParticleControllerListener> getListeners()
public void warmUp(int iterations)
iterations
* 10
update(.1f) calls). This is used to "warm up" and get the particle
manager going.
iterations
- The number of iterations to warm up.public void write(JMEExporter e) throws java.io.IOException
write
in interface Savable
write
in class Controller
java.io.IOException
public void read(JMEImporter e) throws java.io.IOException
read
in interface Savable
read
in class Controller
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |