hmi.physics
Class PhysicalJoint

java.lang.Object
  extended by hmi.physics.PhysicalJoint
Direct Known Subclasses:
OdeJoint

public abstract class PhysicalJoint
extends Object

PhysicalJoint

Author:
welberge

Field Summary
(package private)  float[] a1
           
(package private)  float[] a2
           
(package private)  float[] a3
           
(package private)  float[] ax1
           
(package private)  float[] ax2
           
(package private)  float[] ax3
           
protected  float[] axis1
           
protected  float[] axis2
           
protected  float[] hiStop
           
protected  float[] loStop
           
protected  String name
           
private  float[] q2
           
private  float[] q3
           
protected  float[] rotationBuffer
           
protected  JointType type
           
 
Constructor Summary
PhysicalJoint(JointType t, String n)
          Constructor
 
Method Summary
abstract  void addTorque(float x, float y, float z)
          Add a torque to this joint
abstract  float[] getAnchor(float[] src)
          Get the joints current anchor point, in world coordinates
abstract  float getAngle(int axis)
          Get the current rotation angle around axis axis
abstract  void getAngularVelocity(float[] w)
          Get the angular velocity of the joint, in joint coordinates
abstract  void getAngularVelocity(float[] w, int i)
          Get the angular velocity of the joint, in joint coordinates
abstract  void getForce1(float[] force1)
          Get the force applied to body 1
abstract  void getForce2(float[] force2)
          Get the torque applied to body 2
 String getName()
           
 void getRotation(float[] q)
          Get the rotation of the joint in local coordinates
 void getRotation(float[] q, int i)
          Get the rotation of the joint in local coordinates
 float[] getRotationBuffer()
          get the current rotation buffer
abstract  void getTorque1(float[] torque1)
          Get the torque applied to body 1
abstract  void getTorque2(float[] torque2)
          Get the torque applied to body 2
 JointType getType()
           
abstract  void setAnchor(float x, float y, float z)
          Set the joint anchor point in world coordinates
 void setAxis(int ax, float x, float y, float z)
          Set the rotation axis
abstract  void setDesiredVelocity(int axis, float value)
          Set the desired rotational velocity of a dof of a joint
 void setJointMax(int ax, float max)
          Sets the joint rotational limits of a dof/axis, range -pi..pi
 void setJointMin(int ax, float min)
          Sets the joint rotational limits of a dof/axis, range -pi..pi
abstract  void setMaximumForce(int axis, float value)
          Sets the maximum force of a dof to use to gain the desired velocity
 void setName(String name)
           
 void setRotationBuffer(float[] rotationBuffer)
          Set the rotation buffer to which this joint should write it's physical simulation info (=joint rotation after a simulation step).
 String toString()
          Get the joint name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

type

protected JointType type

name

protected String name

rotationBuffer

protected float[] rotationBuffer

axis1

protected float[] axis1

axis2

protected float[] axis2

hiStop

protected float[] hiStop

loStop

protected float[] loStop

q2

private float[] q2

q3

private float[] q3

a1

float[] a1

a2

float[] a2

a3

float[] a3

ax1

float[] ax1

ax2

float[] ax2

ax3

float[] ax3
Constructor Detail

PhysicalJoint

public PhysicalJoint(JointType t,
                     String n)
Constructor

Parameters:
t - type
n - name
Method Detail

getType

public JointType getType()
Returns:
the type

getTorque1

public abstract void getTorque1(float[] torque1)
Get the torque applied to body 1


getTorque2

public abstract void getTorque2(float[] torque2)
Get the torque applied to body 2


getForce1

public abstract void getForce1(float[] force1)
Get the force applied to body 1


getForce2

public abstract void getForce2(float[] force2)
Get the torque applied to body 2


addTorque

public abstract void addTorque(float x,
                               float y,
                               float z)
Add a torque to this joint

Parameters:
x -
y -
z -

getAngle

public abstract float getAngle(int axis)
Get the current rotation angle around axis axis

Parameters:
axis - the axis
Returns:
the angle

setDesiredVelocity

public abstract void setDesiredVelocity(int axis,
                                        float value)
Set the desired rotational velocity of a dof of a joint

Parameters:
axis - the axis/dof
value - the desired rotational velocity

setMaximumForce

public abstract void setMaximumForce(int axis,
                                     float value)
Sets the maximum force of a dof to use to gain the desired velocity

Parameters:
axis - the axis/dof
value - the maximum force

setJointMin

public void setJointMin(int ax,
                        float min)
Sets the joint rotational limits of a dof/axis, range -pi..pi

Parameters:
ax - the dof/axis
min - minimum rotation

setJointMax

public void setJointMax(int ax,
                        float max)
Sets the joint rotational limits of a dof/axis, range -pi..pi

Parameters:
ax - the dof/axis
max - maximum rotation

setAxis

public void setAxis(int ax,
                    float x,
                    float y,
                    float z)
Set the rotation axis

Parameters:
ax - axis 0>=nr>=2, axis 3 is set automatically
x - x
y - y
z - z

setAnchor

public abstract void setAnchor(float x,
                               float y,
                               float z)
Set the joint anchor point in world coordinates

Parameters:
x -
y -
z -

getAnchor

public abstract float[] getAnchor(float[] src)
Get the joints current anchor point, in world coordinates

Parameters:
src - float[3] to copy in, null means create new
Returns:
result

toString

public String toString()
Get the joint name

Overrides:
toString in class Object

getName

public String getName()
Returns:
the name

setName

public void setName(String name)
Parameters:
name - the name to set

setRotationBuffer

public void setRotationBuffer(float[] rotationBuffer)
Set the rotation buffer to which this joint should write it's physical simulation info (=joint rotation after a simulation step).

Parameters:
rotationBuffer - the buffer

getRotationBuffer

public float[] getRotationBuffer()
get the current rotation buffer

Returns:
the rotation buffer

getRotation

public void getRotation(float[] q)
Get the rotation of the joint in local coordinates

Parameters:
q - output: the joint rotation

getAngularVelocity

public abstract void getAngularVelocity(float[] w)
Get the angular velocity of the joint, in joint coordinates

Parameters:
w - the angular velocity

getAngularVelocity

public abstract void getAngularVelocity(float[] w,
                                        int i)
Get the angular velocity of the joint, in joint coordinates

Parameters:
w - the angular velocity

getRotation

public void getRotation(float[] q,
                        int i)
Get the rotation of the joint in local coordinates

Parameters:
q - output: the joint rotation