net.phys2d.raw
Class FixedAngleJoint

java.lang.Object
  extended bynet.phys2d.raw.FixedAngleJoint
All Implemented Interfaces:
Joint

public class FixedAngleJoint
extends java.lang.Object
implements Joint

A joint that will maintain a fixed angle between two bodies


Constructor Summary
FixedAngleJoint(Body body1, Body body2, Vector2f anchor1, Vector2f anchor2, float rotateA)
           
 
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 angle maintained between the two bodies
 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

FixedAngleJoint

public FixedAngleJoint(Body body1,
                       Body body2,
                       Vector2f anchor1,
                       Vector2f anchor2,
                       float rotateA)
Parameters:
body1 - The first body to be attached on constraint
body2 - The second body to be attached on constraint
anchor1 - The anchor point on first body
anchor2 - The anchor point on second body
rotateA - The fixed angle on body2 from body1
Method Detail

applyImpulse

public void applyImpulse()
Description copied from interface: Joint
Apply the impulse caused by the joint to the bodies attached.

Specified by:
applyImpulse in interface Joint
See Also:
Joint.applyImpulse()

getBody1

public Body getBody1()
Description copied from interface: Joint
Get the first body attached to this joint

Specified by:
getBody1 in interface Joint
Returns:
The first body attached to this joint
See Also:
Joint.getBody1()

getBody2

public Body getBody2()
Description copied from interface: Joint
Get the second body attached to this joint

Specified by:
getBody2 in interface Joint
Returns:
The second body attached to this joint
See Also:
Joint.getBody2()

preStep

public void preStep(float invDT)
Description copied from interface: Joint
Precaculate everything and apply initial impulse before the simulation step takes place

Specified by:
preStep in interface Joint
Parameters:
invDT - The amount of time the simulation is being stepped by
See Also:
Joint.preStep(float)

setRelaxation

public void setRelaxation(float relaxation)
Description copied from interface: Joint
Set the relaxtion value on this joint. This value determines how loose the joint will be

Specified by:
setRelaxation in interface Joint
Parameters:
relaxation - The relaxation value
See Also:
Joint.setRelaxation(float)

getRotateA

public float getRotateA()
Get the angle maintained between the two bodies

Returns:
The angle maintained between the two bodies

getAnchor1

public Vector2f getAnchor1()
Get the anchor of the joint on the first body

Returns:
The anchor of the joint on the first body

getAnchor2

public Vector2f getAnchor2()
Get the anchor of the joint on the second body

Returns:
The anchor of the joint on the second body