org.odejava
Class Mass

java.lang.Object
  extended by org.odejava.Mass

public class Mass
extends Object

Mass properties, can be used to construct masses that are not coupled to a Body.

Author:
welberge

Constructor Summary
Mass()
          Creates a Mass
Mass(org.odejava.ode.dMass m)
          Controls the mass of a given dMass
 
Method Summary
 void adjust(float newMass)
          Changes mass to newMass
 void adjust(float newMass, Body body)
          Changes the mass to newMass and apply it to the body
 void getC(float[] C)
          Get the center of gravity
 org.odejava.ode.dMass getdMass()
          Get the dMass
 void getI(float[] I)
          Get the 3x3 Inertia tensor
 float getMass()
          Get the mass
 void setC(float[] c)
          Sets the center of mass
 void setC(float[] c, Body b)
          Set the center of mass and apply it to a body
 void setI(float[] I)
          Sets the inertia tensor
 void setI(float[] I, Body b)
          Set the inertia tensor and apply it to a body
 void setMass(Geom geom, float density)
          Set mass parameters based on geometry and density
 void translate(float x, float y, float z)
          Adjust the mass paramaters to represent the object displaced by (x,y,z)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Mass

public Mass(org.odejava.ode.dMass m)
Controls the mass of a given dMass

Parameters:
m - the dMass

Mass

public Mass()
Creates a Mass

Method Detail

setMass

public void setMass(Geom geom,
                    float density)
Set mass parameters based on geometry and density


adjust

public void adjust(float newMass)
Changes mass to newMass

Parameters:
newMass - the new mass

adjust

public void adjust(float newMass,
                   Body body)
Changes the mass to newMass and apply it to the body

Parameters:
newMass - new mass
body - body to apply the mass to

translate

public void translate(float x,
                      float y,
                      float z)
Adjust the mass paramaters to represent the object displaced by (x,y,z)


getMass

public float getMass()
Get the mass


getdMass

public org.odejava.ode.dMass getdMass()
Get the dMass


setI

public void setI(float[] I)
Sets the inertia tensor

Parameters:
I - the new inertia tensor

setI

public void setI(float[] I,
                 Body b)
Set the inertia tensor and apply it to a body


getI

public void getI(float[] I)
Get the 3x3 Inertia tensor

Parameters:
I - An object to place the values into

setC

public void setC(float[] c)
Sets the center of mass

Parameters:
c - the new center of mass

setC

public void setC(float[] c,
                 Body b)
Set the center of mass and apply it to a body


getC

public void getC(float[] C)
Get the center of gravity

Parameters:
C - An object to place the values into