hmi.physics.ode
Class OdeMass

java.lang.Object
  extended by hmi.physics.Mass
      extended by hmi.physics.ode.OdeMass

public class OdeMass
extends Mass


Field Summary
private  org.odejava.Mass mass
           
 
Constructor Summary
OdeMass()
           
OdeMass(org.odejava.ode.dMass m)
           
 
Method Summary
 void adjustMass(float newMass)
          Adjust the mass to be newMass (in kg)
 void adjustMass(float m, org.odejava.Body b)
           
 Mass copy()
           
 void getCOM(float[] center)
          Get the center of mass
 void getInertiaTensor(float[] I)
          Get the inertia tensor
 float getMass()
          Get the mass (in kg)
 org.odejava.Mass getOMass()
          Gets the ode mass representation
 void rotate(float[] q)
          Rotates the inertia tensor
 void setCOM(float[] c)
          Sets the center of mass
 void setCOM(float[] c, org.odejava.Body body)
          Set the mass and apply it to a body
 void setFromBox(float[] size, float density)
          Set a new box mass, assumes center at (0,0,0)
 void setFromCapsule(float radius, float height, int direction, float density)
          Set a capsule mass, assume center = CoM at (0,0,0)
 void setFromGMesh(GMesh m, float density)
          Set mass properties on the basis of a closed GMesh, assumes uniform density density is set in kg/m3 (or mass unit/length unit^3)
 void setFromSphere(float radius, float density)
          Set a sphere-shaped mass, assume center at (0,0,0)
 void setInertiaTensor(float[] I)
          Sets the inertia tensor
 void setInertiaTensor(float[] I, org.odejava.Body body)
          Set the inertia tensor and apply it to a body
 String toString()
          String representation
 void translate(float x, float y, float z)
          Translates the COM and inertia tensor
 
Methods inherited from class hmi.physics.Mass
addMass, scale, scale, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mass

private org.odejava.Mass mass
Constructor Detail

OdeMass

public OdeMass()

OdeMass

public OdeMass(org.odejava.ode.dMass m)
Method Detail

adjustMass

public void adjustMass(float m,
                       org.odejava.Body b)

adjustMass

public void adjustMass(float newMass)
Description copied from class: Mass
Adjust the mass to be newMass (in kg)

Specified by:
adjustMass in class Mass
Parameters:
newMass - the new mass

getCOM

public void getCOM(float[] center)
Description copied from class: Mass
Get the center of mass

Specified by:
getCOM in class Mass

getInertiaTensor

public void getInertiaTensor(float[] I)
Description copied from class: Mass
Get the inertia tensor

Specified by:
getInertiaTensor in class Mass

getOMass

public org.odejava.Mass getOMass()
Gets the ode mass representation

Returns:
the ode mass rep

getMass

public float getMass()
Description copied from class: Mass
Get the mass (in kg)

Specified by:
getMass in class Mass
Returns:
the mass

setFromBox

public void setFromBox(float[] size,
                       float density)
Description copied from class: Mass
Set a new box mass, assumes center at (0,0,0)

Specified by:
setFromBox in class Mass
Parameters:
size - of the sides of the box
density - the density of the box

setFromGMesh

public void setFromGMesh(GMesh m,
                         float density)
Description copied from class: Mass
Set mass properties on the basis of a closed GMesh, assumes uniform density density is set in kg/m3 (or mass unit/length unit^3)

Specified by:
setFromGMesh in class Mass

translate

public void translate(float x,
                      float y,
                      float z)
Description copied from class: Mass
Translates the COM and inertia tensor

Specified by:
translate in class Mass

toString

public String toString()
Description copied from class: Mass
String representation

Specified by:
toString in class Mass

setFromSphere

public void setFromSphere(float radius,
                          float density)
Description copied from class: Mass
Set a sphere-shaped mass, assume center at (0,0,0)

Specified by:
setFromSphere in class Mass
Parameters:
radius - radius of the sphere
density - density of the sphere

setFromCapsule

public void setFromCapsule(float radius,
                           float height,
                           int direction,
                           float density)
Description copied from class: Mass
Set a capsule mass, assume center = CoM at (0,0,0)

Specified by:
setFromCapsule in class Mass
Parameters:
radius - radius of the spheres and cylinder
height - height of the cylinder
direction - direction of the long axes of the cylinder: 1=x, 2=y, 3=z
density - density

setCOM

public void setCOM(float[] c)
Description copied from class: Mass
Sets the center of mass

Specified by:
setCOM in class Mass

setCOM

public void setCOM(float[] c,
                   org.odejava.Body body)
Set the mass and apply it to a body


setInertiaTensor

public void setInertiaTensor(float[] I)
Description copied from class: Mass
Sets the inertia tensor

Specified by:
setInertiaTensor in class Mass

setInertiaTensor

public void setInertiaTensor(float[] I,
                             org.odejava.Body body)
Set the inertia tensor and apply it to a body


rotate

public void rotate(float[] q)
Description copied from class: Mass
Rotates the inertia tensor

Specified by:
rotate in class Mass
Parameters:
q - rotation as quaternion

copy

public Mass copy()
Specified by:
copy in class Mass