|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.java.dev.joode.WorldObject
net.java.dev.joode.Body
public class Body
Bodies are the most important objects that reside within a World container. Bodies have position, rotation, velocity, angular velocity and mass, and are influenced by forces.
Bodies DO NOT inherently have a shape. A shape is formed by adding geometries to a body. However, geometry and collisions are handled by space containers. World and Space concepts are independant. You can use bodies without spaces or geometries.
World,
Serialized Form| Field Summary | |
|---|---|
Vector3 |
avel
angular velocity |
static int |
dxBodyAutoDisable
denotes that the body should be auto-disabled |
static int |
dxBodyDisabled
denotes that the body is disabled |
static int |
dxBodyFlagFiniteRotation
denotes that the body should use finite rotations, denotes the meaning of angular velocity if using finite rotations, the length of the angular velocity vector denotes the theta velocity otherwise |
static int |
dxBodyFlagFiniteRotationAxis
denotes that the body should us finite rotation around a single axis |
static int |
dxBodyGravity
denotes that the body should be affected by gravity |
static int |
dxBodyNoForce
denotes that the body cannot be affected by external forces (implementers of Force) |
Vector3 |
facc
linear force accumulator |
Vector3 |
finite_rot_axis
finite rotation axis, unit length or 0=none |
int |
flags
body flags, defined by dxBodyFlagXXX constants |
Geom |
geom
first collision geom associated with body |
java.util.List<Geom> |
geoms
all geoms associated with body |
java.util.List<Joint> |
joints
attached joints |
Vector3 |
lvel
linear velocity |
Mass |
mass
mass parameters about POR |
Vector3 |
pos
position of POR (point of reference) |
PosR |
posR
single object reference for both position and rotation of the body |
Quaternion |
q
orientation quaternion, must correspond to R |
Matrix3 |
R
rotation matrix, must correspond to q |
Vector3 |
tacc
torque accumulator |
| Fields inherited from class net.java.dev.joode.WorldObject |
|---|
data, tag, world |
| Constructor Summary | |
|---|---|
Body(World world,
Mass mass)
|
|
| Method Summary | |
|---|---|
void |
addForce(float fx,
float fy,
float fz)
|
void |
addForceAtPos(float fx,
float fy,
float fz,
float px,
float py,
float pz)
|
void |
addForceAtRelPos(float fx,
float fy,
float fz,
float px,
float py,
float pz)
|
void |
addGeom(Geom g)
|
void |
addRelForce(float fx,
float fy,
float fz)
|
void |
addRelForceAtPos(float fx,
float fy,
float fz,
float px,
float py,
float pz)
|
void |
addRelForceAtRelPos(float fx,
float fy,
float fz,
float px,
float py,
float pz)
|
void |
addRelTorque(float fx,
float fy,
float fz)
|
void |
addTorque(float fx,
float fy,
float fz)
|
Body |
cloneState(ClonedReferences util)
deep clones the state object, any references to other SimState objects should be cloned and assigned to the clone via the ClonedReferences util object. |
void |
destroy()
|
void |
disable()
|
void |
enable()
|
void |
getAngularVel(Vector3f v)
|
void |
getAngularVelocityToTurn(Quaternion dq,
float fps,
Vector3 angularPassback)
calculates what the angular velocity should be set to, for the body to change orientation by the amount specified by the quaternion argument over the time 1/fps |
void |
getForce(Vector3f v)
|
Geom |
getGeom()
Convention method, makes Joode like Odejava |
void |
getLinearVel(Vector3f v)
|
void |
getTorque(Vector3f v)
|
boolean |
isAutoDisabled()
|
boolean |
isEnabled()
|
boolean |
isFiniteRotations()
|
void |
resetForces()
|
void |
setAngularVel(float fx,
float fy,
float fz)
|
void |
setAutoDisable(boolean e)
|
void |
setEnabled(boolean e)
|
void |
setFiniteRotations(boolean b)
sets the body flag to use finite rotations This is the more accurate method for stepping the body, where rotations are not assumed to be infintesimaly small |
void |
setGravityMode(boolean m)
|
void |
setLinearVel(float fx,
float fy,
float fz)
|
void |
setPosition(float x,
float y,
float z)
|
void |
setRotation(float a,
float b,
float c,
float w)
|
void |
setRotation(Matrix3 R)
|
void |
setRotation(Quaternion q)
|
void |
setStepDisableThreshold(int i)
|
void |
step(float h)
apply the linear and angular velocities over time interval h, thereby adjusting its position and orientation. |
| Methods inherited from class net.java.dev.joode.WorldObject |
|---|
partialCloneWorldObject |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public java.util.List<Joint> joints
public int flags
public Geom geom
public java.util.List<Geom> geoms
public final Mass mass
public final Vector3 pos
public final Quaternion q
public final Matrix3 R
public final Vector3 lvel
public final Vector3 avel
public final Vector3 facc
public final Vector3 tacc
public final Vector3 finite_rot_axis
public final PosR posR
public static final int dxBodyFlagFiniteRotation
public static final int dxBodyFlagFiniteRotationAxis
public static final int dxBodyDisabled
public static final int dxBodyNoForce
public static final int dxBodyAutoDisable
public static final int dxBodyGravity
| Constructor Detail |
|---|
public Body(World world,
Mass mass)
| Method Detail |
|---|
public void destroy()
destroy in class WorldObject
public void setPosition(float x,
float y,
float z)
public void setRotation(Matrix3 R)
public void setRotation(float a,
float b,
float c,
float w)
public void setRotation(Quaternion q)
public void step(float h)
public void addGeom(Geom g)
public Geom getGeom()
public void setEnabled(boolean e)
public void setGravityMode(boolean m)
public void setFiniteRotations(boolean b)
b - public boolean isFiniteRotations()
public boolean isEnabled()
public boolean isAutoDisabled()
public void enable()
public void disable()
public void setAutoDisable(boolean e)
public void setStepDisableThreshold(int i)
public void setLinearVel(float fx,
float fy,
float fz)
public void getLinearVel(Vector3f v)
public void setAngularVel(float fx,
float fy,
float fz)
public void getAngularVel(Vector3f v)
public void getForce(Vector3f v)
public void getTorque(Vector3f v)
public void resetForces()
public void addForce(float fx,
float fy,
float fz)
public void addTorque(float fx,
float fy,
float fz)
public void addRelForce(float fx,
float fy,
float fz)
public void addRelTorque(float fx,
float fy,
float fz)
public void addForceAtPos(float fx,
float fy,
float fz,
float px,
float py,
float pz)
public void addForceAtRelPos(float fx,
float fy,
float fz,
float px,
float py,
float pz)
public void addRelForceAtPos(float fx,
float fy,
float fz,
float px,
float py,
float pz)
public void addRelForceAtRelPos(float fx,
float fy,
float fz,
float px,
float py,
float pz)
public Body cloneState(ClonedReferences util)
SimStatedeep clones the state object, any references to other SimState objects should be cloned and assigned to the clone via the ClonedReferences util object. The util object ensures that multiple clones of the same object are not performed during a clone operation.
util - instanciate a new one if top level cloning
public void getAngularVelocityToTurn(Quaternion dq,
float fps,
Vector3 angularPassback)
calculates what the angular velocity should be set to, for the body to change orientation by the amount specified by the quaternion argument over the time 1/fps
This method does not work accuratly when the finiteRotation flag is off
dq - the rotation required i.e. the bodies final orientation should be R*qangularPassback -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||