org.odejava
Class JointAMotor

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

public class JointAMotor
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
JointAMotor(String name, World world)
          Create a new AMotor joint that belongs to the given world and has a name.
JointAMotor(String name, World world, JointGroup jointGroup)
          Create a new AMotor joint that belongs to the given world.
JointAMotor(World world)
          Create a new AMotor joint that belongs to the given world and does not belong to any group.
JointAMotor(World world, JointGroup jointGroup)
          Create a new AMotor joint that belongs to the given world.
 
Method Summary
 void addTorque(float x, float y, float z)
           
 void addTorque(org.openmali.vecmath2.Vector3f torque)
          Convenience method, just calls addTorque(x,y,z)
 float getAngle(int anum)
           
 float getAngleRate(int anum)
           
 org.openmali.vecmath2.Vector3f getAxis(int anum)
          Get the axis vector for the requested axis identifier.
 org.openmali.vecmath2.Vector3f getAxis(int anum, org.openmali.vecmath2.Vector3f val)
          Get the axis vector for the requested axis identifier and place it in the user-provided data structure.
 int getAxisRel(int anum)
           
 int getMode()
           
 int getNumAxes()
          Get the number of valid axes currently in use by the motor.
 float getParam(int parameter)
          Get an unchecked parameter value directly from this joint.
 void setAngle(int anum, float angle)
           
 void setAxis(int anum, int rel, float x, float y, float z)
           
 void setMode(int mode)
           
 void setNumAxes(int num)
          Set the number of valid axes to use for this motor.
 void setParam(int parameter, float value)
          Set a generic, unchecked, parameter directly for this joint.
 
Methods inherited from class org.odejava.Joint
attach, delete, enableFeedbackTracking, enableFeedbackTracking, getBody1, getBody2, getFeedback, getGroup, getName, isFeedbackTrackingEnabled, setAxis1, setAxis2, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JointAMotor

public JointAMotor(World world)
Create a new AMotor 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

JointAMotor

public JointAMotor(String name,
                   World world)
Create a new AMotor 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

JointAMotor

public JointAMotor(World world,
                   JointGroup jointGroup)
Create a new AMotor 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

JointAMotor

public JointAMotor(String name,
                   World world,
                   JointGroup jointGroup)
Create a new AMotor 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

setMode

public void setMode(int mode)

getMode

public int getMode()

setNumAxes

public void setNumAxes(int num)
Set the number of valid axes to use for this motor. The valid range is between 0 and 3. A value of zero effectively disables the motor.

Parameters:
num - The number of valid axes to use. Must be in the range [0,3].

getNumAxes

public int getNumAxes()
Get the number of valid axes currently in use by the motor.

Returns:
A value in the range [0,3]

setAxis

public void setAxis(int anum,
                    int rel,
                    float x,
                    float y,
                    float z)

getAxis

public org.openmali.vecmath2.Vector3f getAxis(int anum)
Get the axis vector for the requested axis identifier. A new vector instance will be created for each request. This is identical to calling getAxis(anum, null).

Parameters:
anum - The axis number in the range [1,3]
Returns:
A new vector object containing the axis values

getAxis

public org.openmali.vecmath2.Vector3f getAxis(int anum,
                                              org.openmali.vecmath2.Vector3f val)
Get the axis vector for the requested axis identifier and place it in the user-provided data structure. If the user-provided data structure is null, then a new instance is created and returned, otherwise the user provided structure is used as the return value.

Parameters:
anum - The axis number in the range [1,3]
val - An object to place the values into or null
Returns:
Either the val parameter or a new object

getAxisRel

public int getAxisRel(int anum)

setAngle

public void setAngle(int anum,
                     float angle)

getAngle

public float getAngle(int anum)

getAngleRate

public float getAngleRate(int anum)

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

addTorque

public void addTorque(org.openmali.vecmath2.Vector3f torque)
Convenience method, just calls addTorque(x,y,z)

Parameters:
torque - added torque

addTorque

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