org.xith3d.utility.physics.pseudo.joints
Class HingeJoint

java.lang.Object
  extended by org.xith3d.scenegraph.SceneGraphObject
      extended by org.xith3d.scenegraph.Node
          extended by org.xith3d.scenegraph.GroupNode
              extended by org.xith3d.scenegraph.Group
                  extended by org.xith3d.utility.physics.pseudo.joints.Joint
                      extended by org.xith3d.utility.physics.pseudo.joints.HingeJoint
All Implemented Interfaces:
org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject, org.openmali.spatial.SpatialNode

public class HingeJoint
extends Joint

A HingeJoint permits you to constraints some objects to


Field Summary
 
Fields inherited from class org.xith3d.scenegraph.GroupNode
children, hostGroup, numChildren, totalNumChildren, totalNumShapes
 
Fields inherited from class org.xith3d.scenegraph.Node
bounds, boundsAutoCompute, boundsDirty, globalIgnoreBounds, instanceBoundsTypeHint, transformGroup, untransformedBounds
 
Fields inherited from class org.xith3d.scenegraph.SceneGraphObject
XITH3D_USERDATAKEY_OLDUSERDATA
 
Constructor Summary
HingeJoint(org.openmali.vecmath2.Vector3f rotationAxis, org.openmali.vecmath2.Vector3f translationAxis, float length)
          Creates a new HingeJoint
HingeJoint(org.openmali.vecmath2.Vector3f rotationAxis, org.openmali.vecmath2.Vector3f translationAxis, float length, float angle)
          Creates a new HingeJoint
 
Method Summary
 void addAngle(float angle)
           
 void addChild(Joint j)
          Add a child joint to this one
 void addLength(float length)
           
 float getAngle()
           
 Group getEndGroup()
           
 float getLength()
           
 org.openmali.vecmath2.Vector3f getRotationAxis()
           
 Group getStartGroup()
           
 org.openmali.vecmath2.Vector3f getTranslationAxis()
           
 void removeChild(Joint j)
          Remove a child joint from this one
 void setAngle(float angle)
           
 void setLength(float length)
           
 void setRotationAxis(org.openmali.vecmath2.Vector3f rotationAxis)
           
 void setTranslationAxis(org.openmali.vecmath2.Vector3f translationAxis)
           
 void subAngle(float angle)
           
 void subLength(float length)
           
 boolean traverse(DetailedTraversalCallback callback)
          Traverses the scenegraph from this node on.
 
Methods inherited from class org.xith3d.scenegraph.Group
moveTo, newInstance
 
Methods inherited from class org.xith3d.scenegraph.GroupNode
absorbDetails, addChild, addChild, checkChild, dump, dump, ensureCapacity, expandBounds, findAll, findAll, findFirst, findFirst, freeOpenGLResources, getChild, getChildren, getChildren, getClipper, getPickHost, getScissorRect, getTotalNumChildren, getTotalNumShapes, indexOf, isPickHost, mergeInheritedClipper, mergeInheritedNodes, mergeInheritedScissorRect, numChildren, removeAllChildren, removeChild, removeChild, setBoundsDirty, setBoundsDirtyUpward, setChild, setClipper, setLive, setPickHost, setPickHost, setScissorRect, setShowBounds, sharedCopy, sharedCopy, traverse, unmergeInheritedFog, unmergeInheritedLight, unmergeInheritedNodes, updateBounds, updateBoundsCheap
 
Methods inherited from class org.xith3d.scenegraph.Node
cloneNode, detach, duplicateNode, freeOpenGLResources, getBounds, getBoundsAutoCompute, getBoundsType, getBoundsTypeHint, getDefaultPickable, getIndentString, getInheritedNodeAttributes, getModListener, getOrderedChild, getOrderedState, getParent, getRoot, getShadowAttachment, getShowBounds, getTransformGroup, getTreeCell, getWorldBounds, getWorldTransform, getWorldTransform, isBillboard, isIgnoreBounds, isOccluder, isPickable, isRenderable, isUpdatableNode, popGlobalIgnoreBounds, printBounds, pushGlobalIgnoreBounds, setBounds, setBoundsAutoCompute, setBoundsTypeHint, setDefaultPickable, setGlobalIgnoreBounds, setIgnoreBounds, setIsOccluder, setModListener, setOrderedChild, setParent, setPickable, setPickableRecursive, setPickableRecursive, setRenderable, setShadowAttachment, setShowBounds, setTransformGroup, setTreeCell, updateOrderedChild, updateTransformGroup, updateWorldTransform
 
Methods inherited from class org.xith3d.scenegraph.SceneGraphObject
getName, getUserData, getUserData, getUserDataMap, isLive, setName, setUserData, setUserData, setUserDataRecursive, setUserDataRecursive, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HingeJoint

public HingeJoint(org.openmali.vecmath2.Vector3f rotationAxis,
                  org.openmali.vecmath2.Vector3f translationAxis,
                  float length)
Creates a new HingeJoint

Parameters:
rotationAxis - Axis about which the attached object will rotate
translationAxis - Axis about which the object is tied to the joint
length - Length of the joint (where/how far should the next joint begin?)

HingeJoint

public HingeJoint(org.openmali.vecmath2.Vector3f rotationAxis,
                  org.openmali.vecmath2.Vector3f translationAxis,
                  float length,
                  float angle)
Creates a new HingeJoint

Parameters:
rotationAxis - Axis about which the attached object will rotate
translationAxis - Axis about which the object is tied to the joint
length - Length of the joint (where/how far should the next joint begin?)
angle - Initial angle of the HingeJoint
Method Detail

getStartGroup

public Group getStartGroup()
Returns:
the display group, to which you can add some Shapes for your joint to be visible.

getEndGroup

public Group getEndGroup()
Returns:
the display group, to which you can add some Shapes for your joint to be visible.

addChild

public void addChild(Joint j)
Add a child joint to this one

Specified by:
addChild in class Joint
Parameters:
j - The new joint to be added

removeChild

public void removeChild(Joint j)
Remove a child joint from this one

Specified by:
removeChild in class Joint
Parameters:
j - The joint to be removed from

getRotationAxis

public org.openmali.vecmath2.Vector3f getRotationAxis()

setRotationAxis

public void setRotationAxis(org.openmali.vecmath2.Vector3f rotationAxis)

getTranslationAxis

public org.openmali.vecmath2.Vector3f getTranslationAxis()

setTranslationAxis

public void setTranslationAxis(org.openmali.vecmath2.Vector3f translationAxis)

getAngle

public float getAngle()

setAngle

public void setAngle(float angle)

getLength

public float getLength()

setLength

public void setLength(float length)

addAngle

public void addAngle(float angle)

subAngle

public void subAngle(float angle)

addLength

public void addLength(float length)

subLength

public void subLength(float length)

traverse

public boolean traverse(DetailedTraversalCallback callback)
Description copied from class: Group
Traverses the scenegraph from this node on. If this Node is a Group it will recusively run through each child.

Overrides:
traverse in class Group
Parameters:
callback - the listener is notified of any traversed Node on the way
Returns:
if false, the whole traversal will stop
See Also:
Node.traverse(org.xith3d.scenegraph.traversal.DetailedTraversalCallback)