toxi.physics.constraints
Class AxisConstraint

java.lang.Object
  extended by toxi.physics.constraints.AxisConstraint
All Implemented Interfaces:
ParticleConstraint

public class AxisConstraint
extends java.lang.Object
implements ParticleConstraint

Constrains a particle's movement by locking a given axis to a fixed value.


Field Summary
 toxi.geom.Vec3D.Axis axis
           
 float constraint
           
 
Constructor Summary
AxisConstraint(toxi.geom.Vec3D.Axis axis, float constraint)
           
 
Method Summary
 void apply(VerletParticle p)
          Applies the constraint to the passed in particle.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

constraint

public float constraint

axis

public toxi.geom.Vec3D.Axis axis
Constructor Detail

AxisConstraint

public AxisConstraint(toxi.geom.Vec3D.Axis axis,
                      float constraint)
Parameters:
axis - axis to lock
constraint - constrain the axis to this value
Method Detail

apply

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

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