|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.phys2d.raw.AngleJoint
A joint that constrains the angle two bodies can be at in relation to each other.
Constructor Summary | |
AngleJoint(Body body1,
Body body2,
Vector2f anchor1,
Vector2f anchor2,
float rotateA,
float rotateB)
Create a new angle joint |
|
AngleJoint(Body body1,
Body body2,
Vector2f anchor1,
Vector2f anchor2,
float rotateA,
float rotateB,
float restitution)
Create a new angle joint |
Method Summary | |
void |
applyImpulse()
Apply the impulse caused by the joint to the bodies attached. |
Vector2f |
getAnchor1()
Get the anchor of the joint on the first body |
Vector2f |
getAnchor2()
Get the anchor of the joint on the second body |
Body |
getBody1()
Get the first body attached to this joint |
Body |
getBody2()
Get the second body attached to this joint |
float |
getRotateA()
Get the upper angle bound |
float |
getRotateB()
Get the lower angle bound |
void |
preStep(float invDT)
Precaculate everything and apply initial impulse before the simulation step takes place |
void |
setRelaxation(float relaxation)
Set the relaxtion value on this joint. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AngleJoint(Body body1, Body body2, Vector2f anchor1, Vector2f anchor2, float rotateA, float rotateB)
body1
- The first body that is attached on the constraintbody2
- The second body that is attached on the constraintanchor1
- The anchor point on first bodyanchor2
- The anchor point on second bodyrotateA
- The higher angle bound for constraintrotateB
- The lower angle bound for constraintpublic AngleJoint(Body body1, Body body2, Vector2f anchor1, Vector2f anchor2, float rotateA, float rotateB, float restitution)
body1
- The first body that is attached on the constraintbody2
- The second body that is attached on the constraintanchor1
- The anchor point on first bodyanchor2
- The anchor point on second bodyrotateA
- The higher angle bound for constraintrotateB
- The lower angle bound for constraintrestitution
- The restitution when body bounce on either sideMethod Detail |
public void applyImpulse()
Joint
applyImpulse
in interface Joint
Joint.applyImpulse()
public Body getBody1()
Joint
getBody1
in interface Joint
Joint.getBody1()
public Body getBody2()
Joint
getBody2
in interface Joint
Joint.getBody2()
public void preStep(float invDT)
Joint
preStep
in interface Joint
invDT
- The amount of time the simulation is being stepped byJoint.preStep(float)
public void setRelaxation(float relaxation)
Joint
setRelaxation
in interface Joint
relaxation
- The relaxation valueJoint.setRelaxation(float)
public float getRotateA()
public float getRotateB()
public Vector2f getAnchor1()
public Vector2f getAnchor2()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |