com.threerings.opengl.effect
Class Particle

java.lang.Object
  extended by com.threerings.opengl.effect.Particle

public final class Particle
extends Object

Contains the state of a single particle.


Field Summary
 float depth
          The depth of the particle (used for depth sorting).
 
Constructor Summary
Particle()
           
 
Method Summary
 Vector3f getAngularVelocity()
          Returns a reference to the particle's angular velocity.
 Color4f getColor()
          Returns a reference to the particle's color.
 float getFrame()
          Returns the particle's texture frame.
 Quaternion getOrientation()
          Returns a reference to the particle's orientation.
 Vector3f getPosition()
          Returns a reference to the particle's position.
 Vector3f getPosition(float t, Vector3f result)
          Computes the particle's position at some point in its past (where 0 is the oldest position and 1 is the newest).
 float getSize()
          Returns the particle's size.
 float getSize(float t)
          Computes the particle's size at some point in its past.
 Vector3f getVelocity()
          Returns a reference to the particle's (linear) velocity.
 void init(float lifespan, AlphaMode alphaMode, ColorFunctionVariable color, FloatFunctionVariable size, FloatFunctionVariable length, FloatFunctionVariable frame, Transform3D historyTransform)
          Initializes the particle.
 void setSize(float size)
          Sets the particle's size.
 boolean tick(float elapsed)
          Updates the particle state based on the elapsed time in seconds.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

depth

public float depth
The depth of the particle (used for depth sorting).

Constructor Detail

Particle

public Particle()
Method Detail

getPosition

public Vector3f getPosition()
Returns a reference to the particle's position.


getPosition

public Vector3f getPosition(float t,
                            Vector3f result)
Computes the particle's position at some point in its past (where 0 is the oldest position and 1 is the newest).


getSize

public float getSize(float t)
Computes the particle's size at some point in its past.


getVelocity

public Vector3f getVelocity()
Returns a reference to the particle's (linear) velocity.


getOrientation

public Quaternion getOrientation()
Returns a reference to the particle's orientation.


getAngularVelocity

public Vector3f getAngularVelocity()
Returns a reference to the particle's angular velocity.


getColor

public Color4f getColor()
Returns a reference to the particle's color.


setSize

public void setSize(float size)
Sets the particle's size.


getSize

public float getSize()
Returns the particle's size.


getFrame

public float getFrame()
Returns the particle's texture frame.


init

public void init(float lifespan,
                 AlphaMode alphaMode,
                 ColorFunctionVariable color,
                 FloatFunctionVariable size,
                 FloatFunctionVariable length,
                 FloatFunctionVariable frame,
                 Transform3D historyTransform)
Initializes the particle.


tick

public boolean tick(float elapsed)
Updates the particle state based on the elapsed time in seconds.

Returns:
true if the particle is still alive, false if it is dead.


Copyright © 2011. All Rights Reserved.