|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthmi.physics.Mass
public abstract class Mass
| Constructor Summary | |
|---|---|
Mass()
|
|
| Method Summary | |
|---|---|
void |
addMass(Mass m,
float[] p1,
float[] p2,
float[] newPos)
Combines with another Mass object. |
abstract void |
adjustMass(float newMass)
Adjust the mass to be newMass (in kg) |
abstract Mass |
copy()
|
abstract void |
getCOM(float[] c)
Get the center of mass |
abstract void |
getInertiaTensor(float[] I)
Get the inertia tensor |
abstract float |
getMass()
Get the mass (in kg) |
abstract void |
rotate(float[] q)
Rotates the inertia tensor |
void |
scale(float s)
Uniform scale Assumes that the Mass objects has it COM at (0,0,0) and that the density is uniform. |
void |
scale(float[] s)
Non-uniform scale Assumes that the Mass objects has it COM at (0,0,0) and that the density is uniform. |
abstract void |
setCOM(float[] c)
Sets the center of mass |
abstract void |
setFromBox(float[] size,
float density)
Set a new box mass, assumes center at (0,0,0) |
abstract void |
setFromCapsule(float radius,
float height,
int direction,
float density)
Set a capsule mass, assume center = CoM at (0,0,0) |
abstract 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) |
abstract void |
setFromSphere(float radius,
float density)
Set a sphere-shaped mass, assume center at (0,0,0) |
abstract void |
setInertiaTensor(float[] I)
Sets the inertia tensor |
abstract String |
toString()
String representation |
void |
translate(float[] pos)
|
abstract void |
translate(float x,
float y,
float z)
Translates the COM and inertia tensor |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Mass()
| Method Detail |
|---|
public abstract void getCOM(float[] c)
public abstract void getInertiaTensor(float[] I)
public abstract void setCOM(float[] c)
public abstract void setInertiaTensor(float[] I)
public abstract float getMass()
public abstract void adjustMass(float newMass)
newMass - the new mass
public abstract void translate(float x,
float y,
float z)
public void translate(float[] pos)
public abstract void rotate(float[] q)
q - rotation as quaternion
public abstract void setFromBox(float[] size,
float density)
size - of the sides of the boxdensity - the density of the box
public abstract void setFromSphere(float radius,
float density)
radius - radius of the spheredensity - density of the sphere
public abstract void setFromCapsule(float radius,
float height,
int direction,
float density)
radius - radius of the spheres and cylinderheight - height of the cylinderdirection - direction of the long axes of the cylinder: 1=x, 2=y, 3=zdensity - density
public abstract void setFromGMesh(GMesh m,
float density)
public abstract String toString()
toString in class Objectpublic abstract Mass copy()
public void scale(float[] s)
s - scale vector [sx,sy,sz]public void scale(float s)
s - the desired acale
public void addMass(Mass m,
float[] p1,
float[] p2,
float[] newPos)
m - mass to addp1 - position of this mass object in world coordinatesp2 - position of m in world coordinatesnewPos - output: new COM in world coordinates of the combined mass, cannot be aliased to p1 or p2
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||