hmi.physics
Class PhysicalSegment

java.lang.Object
  extended by hmi.physics.PhysicalSegment
All Implemented Interfaces:
VObject
Direct Known Subclasses:
OdePhysicalSegment

public abstract class PhysicalSegment
extends Object
implements VObject

PhysicalSegment, links a RigidBody with a visual humanoid segment

Author:
welberge

Nested Class Summary
 
Nested classes/interfaces inherited from interface hmi.animation.VObject
VObject.Predicate
 
Field Summary
 float[] axis1
           
 float[] axis2
           
 RigidBody box
           
 float[] hiStop
           
protected  String id
           
 JointType jointType
           
 float[] loStop
           
protected  String name
           
 boolean onGround
           
protected  String sid
           
 PhysicalJoint startJoint
           
 float[] startJointOffset
           
 
Constructor Summary
PhysicalSegment()
          Constructor
 
Method Summary
 void clear()
          prepare the segment for removal
abstract  Mass createMass()
          Create the appropiate mass subclass
 void getAngularVelocity(float[] v)
          Returns the angular velocity vector in the form of a float array of length three.
 void getAngularVelocity(float[] vc, int vcIndex)
          Like getAngularVelocity(wa), but starting at the specified offset.
 String getId()
          Returns an interned String that specifies the id.
 String getName()
          Returns an interned String that specifies the name.
 void getRotation(float[] r)
          Returns the rotation quaternion in a float array of length four.
 void getRotation(float[] r, int index)
          Like getRotation(ra), but starting at the specified offset.
 float[] getRotationBuffer()
           
 void getScale(float[] r)
          Returns the scale vector in a float array of length three.
 void getScale(float[] r, int index)
          Like getScale(sa), but starting at the specified offset.
 float[] getScaleBuffer()
           
 String getSid()
          Returns an interned String that specifies the sid.
 void getTranslation(float[] t)
          Returns the translation vector in the form of a float array of length three
 void getTranslation(float[] vc, int vcIndex)
          Like getTranslation(ta), but starting at the specified offset
 float[] getTranslationBuffer()
           
 void getVelocity(float[] v)
          Returns the velocity vector in the form of a float array of length three.
 void getVelocity(float[] vc, int vcIndex)
          Like getVelocity(va), but starting at the specified offset.
 void set(PhysicalSegment s)
          Copies everything but the physicalJoint from s
 void setAngularVelocity(float[] v)
          Sets the angular velocity vector from a float array of length three.
 void setAngularVelocity(float[] vc, int vcIndex)
          Like setAngularVelocity(wa), but starting at the specified offset.
 void setAngularVelocity(float wx, float wy, float wz)
          Sets the angular velocity vector from three floats.
 void setAxisAngle(float ax, float ay, float az, float angle)
          Sets the rotation quaternion derived from a rotation axis (ax, ay, az) and a rotation angle angle, specified in radians.
 void setEnabled(boolean enabled)
          Disables or enables the segment.
 void setId(String n)
          Set the name
 void setName(String n)
          Sets the name for this VObject.
 void setRotation(float[] ra)
          Sets the rotation quaternion from a float array of length four.
 void setRotation(float[] ra, int raIndex)
          Like setRotation(ra), but starting at the specified offset.
 void setRotation(float qs, float qx, float qy, float qz)
          Sets the rotation quaternion from four floats.
 void setScale(float[] sa)
          Sets the scale vector from a float array of lebgth three.
 void setScale(float[] sa, int saIndex)
          Like setScale(sa), but starting at the specified offset
 void setSid(String sid)
          Sets the sid for this VObject.
 void setTranslation(float[] ta)
          Sets the translation vector from a float array of length three.
 void setTranslation(float[] ta, int taIndex)
          Like setTranslation(ta), but starting at the specified offset.
 void setTranslation(float tx, float ty, float tz)
          Sets the current translation vector from three floats.
 void setVelocity(float[] v)
          Sets the velocity vector from a float array of length three.
 void setVelocity(float[] vc, int vcIndex)
          Like setVelocity(va), but starting at the specified offset.
 void setVelocity(float vx, float vy, float vz)
          Sets the velocity vector from three floats.
 String toString()
          String representation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

box

public RigidBody box

startJoint

public PhysicalJoint startJoint

axis1

public float[] axis1

axis2

public float[] axis2

onGround

public boolean onGround

jointType

public JointType jointType

hiStop

public float[] hiStop

loStop

public float[] loStop

startJointOffset

public float[] startJointOffset

sid

protected String sid

id

protected String id

name

protected String name
Constructor Detail

PhysicalSegment

public PhysicalSegment()
Constructor

Method Detail

set

public void set(PhysicalSegment s)
Copies everything but the physicalJoint from s


getName

public String getName()
Description copied from interface: VObject
Returns an interned String that specifies the name.

Specified by:
getName in interface VObject

setName

public void setName(String n)
Description copied from interface: VObject
Sets the name for this VObject.

Specified by:
setName in interface VObject

clear

public void clear()
prepare the segment for removal


toString

public String toString()
String representation

Overrides:
toString in class Object

setId

public void setId(String n)
Set the name

Specified by:
setId in interface VObject
Parameters:
n - the new name

getAngularVelocity

public void getAngularVelocity(float[] v)
Description copied from interface: VObject
Returns the angular velocity vector in the form of a float array of length three.

Specified by:
getAngularVelocity in interface VObject

getAngularVelocity

public void getAngularVelocity(float[] vc,
                               int vcIndex)
Description copied from interface: VObject
Like getAngularVelocity(wa), but starting at the specified offset.

Specified by:
getAngularVelocity in interface VObject

getId

public String getId()
Description copied from interface: VObject
Returns an interned String that specifies the id.

Specified by:
getId in interface VObject

getRotation

public void getRotation(float[] r)
Description copied from interface: VObject
Returns the rotation quaternion in a float array of length four. The order is (s, x, y, z), where s is the scalar part, x, y, z are the imaginary parts.

Specified by:
getRotation in interface VObject

getRotation

public void getRotation(float[] r,
                        int index)
Description copied from interface: VObject
Like getRotation(ra), but starting at the specified offset.

Specified by:
getRotation in interface VObject

getSid

public String getSid()
Description copied from interface: VObject
Returns an interned String that specifies the sid.

Specified by:
getSid in interface VObject

getTranslation

public void getTranslation(float[] t)
Description copied from interface: VObject
Returns the translation vector in the form of a float array of length three

Specified by:
getTranslation in interface VObject

getTranslation

public void getTranslation(float[] vc,
                           int vcIndex)
Description copied from interface: VObject
Like getTranslation(ta), but starting at the specified offset

Specified by:
getTranslation in interface VObject

getVelocity

public void getVelocity(float[] v)
Description copied from interface: VObject
Returns the velocity vector in the form of a float array of length three.

Specified by:
getVelocity in interface VObject

getVelocity

public void getVelocity(float[] vc,
                        int vcIndex)
Description copied from interface: VObject
Like getVelocity(va), but starting at the specified offset.

Specified by:
getVelocity in interface VObject

setAngularVelocity

public void setAngularVelocity(float[] v)
Description copied from interface: VObject
Sets the angular velocity vector from a float array of length three.

Specified by:
setAngularVelocity in interface VObject

setAngularVelocity

public void setAngularVelocity(float[] vc,
                               int vcIndex)
Description copied from interface: VObject
Like setAngularVelocity(wa), but starting at the specified offset.

Specified by:
setAngularVelocity in interface VObject

setAngularVelocity

public void setAngularVelocity(float wx,
                               float wy,
                               float wz)
Description copied from interface: VObject
Sets the angular velocity vector from three floats.

Specified by:
setAngularVelocity in interface VObject

setAxisAngle

public void setAxisAngle(float ax,
                         float ay,
                         float az,
                         float angle)
Description copied from interface: VObject
Sets the rotation quaternion derived from a rotation axis (ax, ay, az) and a rotation angle angle, specified in radians. The axis need not have length one. If all parameters are zero, the rotation is set to the identity quaternion (1,0,0,0).

Specified by:
setAxisAngle in interface VObject

setRotation

public void setRotation(float[] ra)
Description copied from interface: VObject
Sets the rotation quaternion from a float array of length four. The order is (s, x, y, z), where s is the real part, x, y, z are the imaginary parts.

Specified by:
setRotation in interface VObject

setRotation

public void setRotation(float[] ra,
                        int raIndex)
Description copied from interface: VObject
Like setRotation(ra), but starting at the specified offset.

Specified by:
setRotation in interface VObject

setRotation

public void setRotation(float qs,
                        float qx,
                        float qy,
                        float qz)
Description copied from interface: VObject
Sets the rotation quaternion from four floats. qs is the real part, qx, qy, qz the imaginary parts.

Specified by:
setRotation in interface VObject

setSid

public void setSid(String sid)
Description copied from interface: VObject
Sets the sid for this VObject.

Specified by:
setSid in interface VObject

setTranslation

public void setTranslation(float[] ta)
Description copied from interface: VObject
Sets the translation vector from a float array of length three.

Specified by:
setTranslation in interface VObject

setTranslation

public void setTranslation(float[] ta,
                           int taIndex)
Description copied from interface: VObject
Like setTranslation(ta), but starting at the specified offset.

Specified by:
setTranslation in interface VObject

setTranslation

public void setTranslation(float tx,
                           float ty,
                           float tz)
Description copied from interface: VObject
Sets the current translation vector from three floats.

Specified by:
setTranslation in interface VObject

setVelocity

public void setVelocity(float[] v)
Description copied from interface: VObject
Sets the velocity vector from a float array of length three.

Specified by:
setVelocity in interface VObject

setVelocity

public void setVelocity(float[] vc,
                        int vcIndex)
Description copied from interface: VObject
Like setVelocity(va), but starting at the specified offset.

Specified by:
setVelocity in interface VObject

setVelocity

public void setVelocity(float vx,
                        float vy,
                        float vz)
Description copied from interface: VObject
Sets the velocity vector from three floats.

Specified by:
setVelocity in interface VObject

setEnabled

public void setEnabled(boolean enabled)
Disables or enables the segment. Disabled segments are not updated with the physical simulation step and do not collide with other segments.

Parameters:
enabled -

getRotationBuffer

public float[] getRotationBuffer()

getScale

public void getScale(float[] r)
Description copied from interface: VObject
Returns the scale vector in a float array of length three.

Specified by:
getScale in interface VObject

setScale

public void setScale(float[] sa)
Description copied from interface: VObject
Sets the scale vector from a float array of lebgth three.

Specified by:
setScale in interface VObject

setScale

public void setScale(float[] sa,
                     int saIndex)
Description copied from interface: VObject
Like setScale(sa), but starting at the specified offset

Specified by:
setScale in interface VObject

getScale

public void getScale(float[] r,
                     int index)
Description copied from interface: VObject
Like getScale(sa), but starting at the specified offset.

Specified by:
getScale in interface VObject

getScaleBuffer

public float[] getScaleBuffer()

getTranslationBuffer

public float[] getTranslationBuffer()

createMass

public abstract Mass createMass()
Create the appropiate mass subclass

Returns:
the mass