net.java.dev.joode.joint
Class JointHinge

java.lang.Object
  extended by net.java.dev.joode.WorldObject
      extended by net.java.dev.joode.joint.Joint
          extended by net.java.dev.joode.joint.JointHinge
All Implemented Interfaces:
java.io.Serializable, SimState

public class JointHinge
extends Joint

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class net.java.dev.joode.joint.Joint
Joint.Info1, Joint.Info2
 
Field Summary
 Vector3 anchor1
          anchor measured relative to body 1
 Vector3 anchor2
          anchor measured relative to body 2 or absolute world coords if body 2 is null
 Vector3 axis1
           
 Vector3 axis2
           
 JointLimitMotor limot
           
 
Fields inherited from class net.java.dev.joode.joint.Joint
body, dJOINT_INGROUP, dJOINT_REVERSE, dJOINT_TWOBODIES, feedback, flags, lambda, MAX_BODIES
 
Fields inherited from class net.java.dev.joode.WorldObject
data, tag, world
 
Constructor Summary
JointHinge(World world)
           
 
Method Summary
 JointHinge cloneState(ClonedReferences util)
           deep clones the state object, any references to other SimState objects should be cloned and assigned to the clone via the ClonedReferences util object.
 float getHingeAngle()
          Gets the hinge angle.
static float getHingeAngle(Body body1, Body body2, Vector3 axis, Quaternion q_initial)
           
static float getHingeAngleFromRelativeQuat(Quaternion qrel, Vector3 axis)
           
 void getInfo1(Joint.Info1 info)
           
 void getInfo2(Joint.Info2 info)
           
 void setAnchor(float x, float y, float z)
           
 void setAxis(float x, float y, float z)
           
 
Methods inherited from class net.java.dev.joode.joint.Joint
attach, destroy, partialCloneJoint, removeJointReferencesFromAttachedBodies, reset, setJointId
 
Methods inherited from class net.java.dev.joode.WorldObject
partialCloneWorldObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

anchor1

public final Vector3 anchor1
anchor measured relative to body 1


anchor2

public final Vector3 anchor2
anchor measured relative to body 2 or absolute world coords if body 2 is null


axis1

public final Vector3 axis1

axis2

public final Vector3 axis2

limot

public JointLimitMotor limot
Constructor Detail

JointHinge

public JointHinge(World world)
Method Detail

getInfo1

public void getInfo1(Joint.Info1 info)
Specified by:
getInfo1 in class Joint

getInfo2

public void getInfo2(Joint.Info2 info)
Specified by:
getInfo2 in class Joint

setAnchor

public final void setAnchor(float x,
                            float y,
                            float z)

setAxis

public final void setAxis(float x,
                          float y,
                          float z)

getHingeAngle

public float getHingeAngle()
Gets the hinge angle. The angle is measured between the two bodies, or between the body and the static environment. Zero corresponds to the angle at the time setAnchor(float, float, float) or setAxis(float, float, float) was last called.

Returns:
the hinge angle, in radians

getHingeAngle

public static float getHingeAngle(Body body1,
                                  Body body2,
                                  Vector3 axis,
                                  Quaternion q_initial)

getHingeAngleFromRelativeQuat

public static float getHingeAngleFromRelativeQuat(Quaternion qrel,
                                                  Vector3 axis)

cloneState

public JointHinge cloneState(ClonedReferences util)
Description copied from interface: SimState

deep clones the state object, any references to other SimState objects should be cloned and assigned to the clone via the ClonedReferences util object. The util object ensures that multiple clones of the same object are not performed during a clone operation.

Parameters:
util - instanciate a new one if top level cloning