org.odejava
Class JointUniversal

java.lang.Object
  extended by org.odejava.Joint
      extended by org.odejava.JointUniversal

public class JointUniversal
extends Joint

Created 20.12.2003 (dd.mm.yyyy)

Author:
Jani Laakso E-mail: jani.laakso@itmill.com see http://odejava.dev.java.net

Field Summary
 
Fields inherited from class org.odejava.Joint
body1, body2, BOUNCE_RANGE_MSG, deleted, feedback, group, jointGroupId, jointId, name
 
Constructor Summary
JointUniversal(String name, World world)
          Create a new Universal joint that belongs to the given world and has a name.
JointUniversal(String name, World world, JointGroup jointGroup)
          Create a new Universal joint that belongs to the given world.
JointUniversal(World world)
          Create a new Universal joint that belongs to the given world and does not belong to any group.
JointUniversal(World world, JointGroup jointGroup)
          Create a new universal joint that belongs to the given world.
 
Method Summary
 org.openmali.vecmath2.Vector3f getAnchor()
           
 void getAnchor(float[] result)
          Get the anchor location the joint, relative to body 1 and place it in the user-provided array.
 org.openmali.vecmath2.Vector3f getAnchor2()
           
 void getAnchor2(float[] result)
          Get the anchor location the joint, relative to body 2 and place it in the user-provided array.
 float getAngle1()
           
 float getAngle1Rate()
           
 float getAngle2()
           
 float getAngle2Rate()
           
 org.openmali.vecmath2.Vector3f getAxis1()
           
 org.openmali.vecmath2.Vector3f getAxis2()
           
 float getParam(int parameter)
          Get an unchecked parameter value directly from this joint.
 float getStopBounce()
          Fetch the current bounce factor for the stop on axis 1.
 float getStopBounce2()
          Fetch the current bounce factor for the stop on axis 2.
 void setAnchor(float x, float y, float z)
           
 void setAxis1(float x, float y, float z)
           
 void setAxis2(float x, float y, float z)
           
 void setParam(int parameter, float value)
          Set a generic, unchecked, parameter directly for this joint.
 void setStopBounce(float bounce)
          Set the bounciness of the stops for axis 1.
 void setStopBounce2(float bounce)
          Set the bounciness of the stops for axis 2.
 
Methods inherited from class org.odejava.Joint
attach, delete, enableFeedbackTracking, enableFeedbackTracking, getBody1, getBody2, getFeedback, getGroup, getName, isFeedbackTrackingEnabled, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JointUniversal

public JointUniversal(World world)
Create a new Universal joint that belongs to the given world and does not belong to any group. The name is set to the null string.

Parameters:
world - The world that this belongs to

JointUniversal

public JointUniversal(String name,
                      World world)
Create a new Universal joint that belongs to the given world and has a name. The name parameter is optional. The joint is attached to the global environment.

Parameters:
name - A label string to associate with this joint
world - The world that this belongs to

JointUniversal

public JointUniversal(World world,
                      JointGroup jointGroup)
Create a new universal joint that belongs to the given world. The JointGroup is optional and the name is set to the null string. If no group is provided, the joint is attached to the global environment.

Parameters:
world - The world that this belongs to
jointGroup - An optional group to associate this joint with

JointUniversal

public JointUniversal(String name,
                      World world,
                      JointGroup jointGroup)
Create a new Universal joint that belongs to the given world. The JointGroup and name parameters are optional. If no group is provided, the joint is attached to the global environment.

Parameters:
name - A label string to associate with this joint
world - The world that this belongs to
jointGroup - An optional group to associate this joint with
Method Detail

setAnchor

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

getAnchor

public org.openmali.vecmath2.Vector3f getAnchor()

getAnchor

public void getAnchor(float[] result)
Get the anchor location the joint, relative to body 1 and place it in the user-provided array.

Parameters:
result - An object to place the values into

getAnchor2

public org.openmali.vecmath2.Vector3f getAnchor2()

getAnchor2

public void getAnchor2(float[] result)
Get the anchor location the joint, relative to body 2 and place it in the user-provided array.

Parameters:
result - An object to place the values into

setAxis1

public void setAxis1(float x,
                     float y,
                     float z)
Overrides:
setAxis1 in class Joint

getAxis1

public org.openmali.vecmath2.Vector3f getAxis1()

setAxis2

public void setAxis2(float x,
                     float y,
                     float z)
Overrides:
setAxis2 in class Joint

getAxis2

public org.openmali.vecmath2.Vector3f getAxis2()

getAngle1

public float getAngle1()

getAngle1Rate

public float getAngle1Rate()

getAngle2

public float getAngle2()

getAngle2Rate

public float getAngle2Rate()

setStopBounce

public void setStopBounce(float bounce)
                   throws IllegalArgumentException
Set the bounciness of the stops for axis 1. This is a value in the range [0,1] defining how hitting the stop will effect the return travel of the two bodies. A value of 0 means there is no bounce and the bodies will not bounce back. A value of 1 means the full contact velocity at the stop will be reflected back in the opposite direction.

Parameters:
bounce - The bounciness factor in the range [0,1]
Throws:
IllegalArgumentException - The bounce factor is out of range

getStopBounce

public float getStopBounce()
Fetch the current bounce factor for the stop on axis 1.

Returns:
The bounce factor as a value in the range [0,1]

setStopBounce2

public void setStopBounce2(float bounce)
                    throws IllegalArgumentException
Set the bounciness of the stops for axis 2. This is a value in the range [0,1] defining how hitting the stop will effect the return travel of the two bodies. A value of 0 means there is no bounce and the bodies will not bounce back. A value of 1 means the full contact velocity at the stop will be reflected back in the opposite direction.

Parameters:
bounce - The bounciness factor in the range [0,1]
Throws:
IllegalArgumentException - The bounce factor is out of range

getStopBounce2

public float getStopBounce2()
Fetch the current bounce factor for the stop on axis 2.

Returns:
The bounce factor as a value in the range [0,1]

setParam

public void setParam(int parameter,
                     float value)
Set a generic, unchecked, parameter directly for this joint. The parameter types that are permissable for the joint are defined by the individual joint classes and the definitions can be found in OdeConstants.

Overrides:
setParam in class Joint
Parameters:
parameter - A parameter constant from OdeConstants
value - The new value to associate with the parameter

getParam

public float getParam(int parameter)
Get an unchecked parameter value directly from this joint. The parameter types that are permissable for the joint are defined by the individual joint classes and the definitions can be found in OdeConstants.

Overrides:
getParam in class Joint
Parameters:
parameter - A constant describing the parameter to fetch
Returns:
The value of that parameter