org.jbox2d.p5
Class ForceUtils
java.lang.Object
org.jbox2d.p5.ForceUtils
public class ForceUtils
- extends java.lang.Object
A class to hold static methods for applying forces to bodies / shapes /
objects in various ways. If you find yourself duplicating code to do things
like this, then add it here!
- Author:
- Greg
Method Summary |
void |
push(org.jbox2d.dynamics.Body b,
org.jbox2d.common.Vec2 dir,
double force)
Pushes a body in the specified direction. |
void |
pushTowards(org.jbox2d.dynamics.Body b,
org.jbox2d.common.Vec2 worldTarget,
double force)
Pushes a body towards the specified location. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ForceUtils
public ForceUtils()
pushTowards
public void pushTowards(org.jbox2d.dynamics.Body b,
org.jbox2d.common.Vec2 worldTarget,
double force)
- Pushes a body towards the specified location.
push
public void push(org.jbox2d.dynamics.Body b,
org.jbox2d.common.Vec2 dir,
double force)
- Pushes a body in the specified direction.