hmi.physics.ode
Class OdeJoint

java.lang.Object
  extended by hmi.physics.PhysicalJoint
      extended by hmi.physics.ode.OdeJoint

public class OdeJoint
extends PhysicalJoint

OdeJoint Note: axis2 (default: y axis) must always be limited between -0.5pi..0.5pi

Author:
Herwin

Field Summary
private  org.odejava.Body box1
           
private  org.odejava.Body box2
           
private  org.odejava.JointGroup jointGroup
           
private  org.odejava.Joint physicalJoint
           
private  org.odejava.JointAMotor physicalMotor
           
private  float[] q
           
private  float[] w1
           
private  float[] w2
           
private  org.odejava.World world
           
 
Fields inherited from class hmi.physics.PhysicalJoint
axis1, axis2, hiStop, loStop, name, rotationBuffer, type
 
Constructor Summary
OdeJoint(JointType t, String name, org.odejava.World w, org.odejava.JointGroup jg)
           
 
Method Summary
 void addTorque(float x, float y, float z)
          Add a torque to this joint
 void attach(RigidBody b1, RigidBody b2)
           
private  void createJoint()
           
 float[] getAnchor(float[] src)
          Get the joints current anchor point, in world coordinates
 float getAngle(int axis)
          Get the current rotation angle around axis axis
 void getAngularVelocity(float[] w)
          Get the angular velocity of the joint, in joint coordinates
 void getAngularVelocity(float[] w, int i)
          Get the angular velocity of the joint, in joint coordinates
 void getForce1(float[] force)
          Get the force applied to body 1
 void getForce2(float[] force)
          Get the torque applied to body 2
 void getTorque1(float[] torque)
          Get the torque applied to body 1
 void getTorque2(float[] torque)
          Get the torque applied to body 2
 void setAnchor(float x, float y, float z)
          Set the joint anchor point in world coordinates
 void setAxis(int axis, float x, float y, float z)
          Set the rotation axis
 void setDesiredVelocity(int axis, float value)
          Set the desired rotational velocity of a dof of a joint
 void setJointMax(int axis, float max)
          Sets the joint rotational limits of a dof/axis, range -pi..pi
 void setJointMin(int axis, float min)
          Sets the joint rotational limits of a dof/axis, range -pi..pi
 void setMaximumForce(int axis, float value)
          Sets the maximum force of a dof to use to gain the desired velocity
 
Methods inherited from class hmi.physics.PhysicalJoint
getName, getRotation, getRotation, getRotationBuffer, getType, setName, setRotationBuffer, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

physicalJoint

private org.odejava.Joint physicalJoint

physicalMotor

private org.odejava.JointAMotor physicalMotor

jointGroup

private org.odejava.JointGroup jointGroup

world

private org.odejava.World world

box1

private org.odejava.Body box1

box2

private org.odejava.Body box2

w1

private float[] w1

w2

private float[] w2

q

private float[] q
Constructor Detail

OdeJoint

public OdeJoint(JointType t,
                String name,
                org.odejava.World w,
                org.odejava.JointGroup jg)
Method Detail

createJoint

private void createJoint()

getTorque1

public void getTorque1(float[] torque)
Description copied from class: PhysicalJoint
Get the torque applied to body 1

Specified by:
getTorque1 in class PhysicalJoint

getTorque2

public void getTorque2(float[] torque)
Description copied from class: PhysicalJoint
Get the torque applied to body 2

Specified by:
getTorque2 in class PhysicalJoint

getForce2

public void getForce2(float[] force)
Description copied from class: PhysicalJoint
Get the torque applied to body 2

Specified by:
getForce2 in class PhysicalJoint

getForce1

public void getForce1(float[] force)
Description copied from class: PhysicalJoint
Get the force applied to body 1

Specified by:
getForce1 in class PhysicalJoint

addTorque

public void addTorque(float x,
                      float y,
                      float z)
Description copied from class: PhysicalJoint
Add a torque to this joint

Specified by:
addTorque in class PhysicalJoint

getAngle

public float getAngle(int axis)
Description copied from class: PhysicalJoint
Get the current rotation angle around axis axis

Specified by:
getAngle in class PhysicalJoint
Parameters:
axis - the axis
Returns:
the angle

setDesiredVelocity

public void setDesiredVelocity(int axis,
                               float value)
Description copied from class: PhysicalJoint
Set the desired rotational velocity of a dof of a joint

Specified by:
setDesiredVelocity in class PhysicalJoint
Parameters:
axis - the axis/dof
value - the desired rotational velocity

setMaximumForce

public void setMaximumForce(int axis,
                            float value)
Description copied from class: PhysicalJoint
Sets the maximum force of a dof to use to gain the desired velocity

Specified by:
setMaximumForce in class PhysicalJoint
Parameters:
axis - the axis/dof
value - the maximum force

setJointMin

public void setJointMin(int axis,
                        float min)
Description copied from class: PhysicalJoint
Sets the joint rotational limits of a dof/axis, range -pi..pi

Overrides:
setJointMin in class PhysicalJoint
Parameters:
axis - the dof/axis
min - minimum rotation

setJointMax

public void setJointMax(int axis,
                        float max)
Description copied from class: PhysicalJoint
Sets the joint rotational limits of a dof/axis, range -pi..pi

Overrides:
setJointMax in class PhysicalJoint
Parameters:
axis - the dof/axis
max - maximum rotation

setAxis

public void setAxis(int axis,
                    float x,
                    float y,
                    float z)
Description copied from class: PhysicalJoint
Set the rotation axis

Overrides:
setAxis in class PhysicalJoint
Parameters:
axis - axis 0>=nr>=2, axis 3 is set automatically
x - x
y - y
z - z

getAnchor

public float[] getAnchor(float[] src)
Description copied from class: PhysicalJoint
Get the joints current anchor point, in world coordinates

Specified by:
getAnchor in class PhysicalJoint
Parameters:
src - float[3] to copy in, null means create new
Returns:
result

setAnchor

public void setAnchor(float x,
                      float y,
                      float z)
Description copied from class: PhysicalJoint
Set the joint anchor point in world coordinates

Specified by:
setAnchor in class PhysicalJoint

attach

public void attach(RigidBody b1,
                   RigidBody b2)

getAngularVelocity

public void getAngularVelocity(float[] w)
Description copied from class: PhysicalJoint
Get the angular velocity of the joint, in joint coordinates

Specified by:
getAngularVelocity in class PhysicalJoint
Parameters:
w - the angular velocity

getAngularVelocity

public void getAngularVelocity(float[] w,
                               int i)
Description copied from class: PhysicalJoint
Get the angular velocity of the joint, in joint coordinates

Specified by:
getAngularVelocity in class PhysicalJoint
Parameters:
w - the angular velocity