org.jbox2d.p5
Class JointBreaker
java.lang.Object
org.jbox2d.p5.JointBreaker
- All Implemented Interfaces:
- org.jbox2d.dynamics.Steppable
public class JointBreaker
- extends java.lang.Object
- implements org.jbox2d.dynamics.Steppable
Tracks the reaction force of a given joint, and destroys the joint if the reaction force is above
a given threshold AND is between the minimum and maximum allowable angles. This is useful for creating
mouse-controlled joints where the "release" should only happen in one direction, and when a certain
force threshold is reached.
- Author:
- Greg
Constructor Summary |
JointBreaker(org.jbox2d.dynamics.joints.Joint joint,
float reactionThreshold)
|
Method Summary |
void |
setAngleLimits(float lo,
float hi)
Sets the range of angles between which this jointbreaker will break the joint. |
void |
step(float dt,
int iterations)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JointBreaker
public JointBreaker(org.jbox2d.dynamics.joints.Joint joint,
float reactionThreshold)
step
public void step(float dt,
int iterations)
- Specified by:
step
in interface org.jbox2d.dynamics.Steppable
setAngleLimits
public void setAngleLimits(float lo,
float hi)
- Sets the range of angles between which this jointbreaker will break the joint. Angles are in radians,
relative to due east.
- Parameters:
lo
- hi
-