toxi.physics.behaviors
Class ConstantForceBehavior

java.lang.Object
  extended by toxi.physics.behaviors.ConstantForceBehavior
All Implemented Interfaces:
ParticleBehavior
Direct Known Subclasses:
GravityBehavior

public class ConstantForceBehavior
extends java.lang.Object
implements ParticleBehavior


Constructor Summary
ConstantForceBehavior(toxi.geom.Vec3D force)
           
 
Method Summary
 void apply(VerletParticle p)
          Applies the constraint to the passed in particle.
 void configure(float timeStep)
           
 toxi.geom.Vec3D getForce()
           
 void setForce(toxi.geom.Vec3D force)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstantForceBehavior

public ConstantForceBehavior(toxi.geom.Vec3D force)
Method Detail

apply

public void apply(VerletParticle p)
Description copied from interface: ParticleBehavior
Applies the constraint to the passed in particle. The method is assumed to manipulate the given instance directly.

Specified by:
apply in interface ParticleBehavior
Parameters:
p - particle

configure

public void configure(float timeStep)
Specified by:
configure in interface ParticleBehavior

getForce

public toxi.geom.Vec3D getForce()
Returns:
the force

setForce

public void setForce(toxi.geom.Vec3D force)
Parameters:
force - the force to set