com.jmex.effects.particles
Class FloorInfluence

java.lang.Object
  extended by com.jmex.effects.particles.ParticleInfluence
      extended by com.jmex.effects.particles.FloorInfluence
All Implemented Interfaces:
Savable

public class FloorInfluence
extends ParticleInfluence

Author:
andgra

Constructor Summary
FloorInfluence(Vector3f pos, Vector3f normal, float bouncyness)
           
 
Method Summary
 void apply(float dt, Particle particle, int index)
          Apply the influence defined by this class on a given particle.
 float getBouncyness()
           
 Plane getFloor()
           
 Vector3f getNormal()
           
 Vector3f getPos()
           
 void setBouncyness(float bouncyness)
           
 void setFloor(Plane floor)
           
 void setNormal(Vector3f normal)
           
 void setPos(Vector3f pos)
           
 
Methods inherited from class com.jmex.effects.particles.ParticleInfluence
getClassTag, isEnabled, prepare, read, setEnabled, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FloorInfluence

public FloorInfluence(Vector3f pos,
                      Vector3f normal,
                      float bouncyness)
Parameters:
pos - The position vector for the (imaginary) center of the floor.
normal - The normal vector of the floor. Same semantics as in math.Plane.
bouncynessBouncyness - is the factor of multiplication when bouncing off the floor. A bouncyness factor of 1 means the ball leaves the floor with the same velocity as it hit the floor, much like a rubber ball.
Method Detail

apply

public void apply(float dt,
                  Particle particle,
                  int index)
Description copied from class: ParticleInfluence
Apply the influence defined by this class on a given particle. Should probably do this by making a call to particle.getSpeed().addLocal(....); etc.

Specified by:
apply in class ParticleInfluence
Parameters:
dt - amount of time since last apply call in ms.
particle - the particle to apply the influence to.
index - the index of the particle we are working with. This is useful for adding small steady amounts of variation, or remembering information.

getBouncyness

public float getBouncyness()

setBouncyness

public void setBouncyness(float bouncyness)

getFloor

public Plane getFloor()

setFloor

public void setFloor(Plane floor)

getNormal

public Vector3f getNormal()

setNormal

public void setNormal(Vector3f normal)

getPos

public Vector3f getPos()

setPos

public void setPos(Vector3f pos)