|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.physics.util.PlaceableImpl
org.xith3d.physics.simulation.Body
public abstract class Body
A body has a position, an orientation, a linear and angular velocity, and some forces applied to it. It's part of a SimulationWorld and can be stepped.
| Field Summary | |
|---|---|
protected java.util.ArrayList<Collideable> |
collideables
Our collideables : used for collision detection |
protected SimulationWorld |
world
The simulation engine we belong to |
| Fields inherited from class org.xith3d.physics.util.PlaceableImpl |
|---|
position, rotation, valueCheckedBeforeChanged |
| Constructor Summary | |
|---|---|
Body(SimulationWorld world)
Creates a new Body. |
|
| Method Summary | |
|---|---|
void |
addCollideable(Collideable collideable)
Adds a collideable to this Body. |
abstract void |
addForce(float fx,
float fy,
float fz)
Adds a force to this body. |
void |
addForce(org.openmali.vecmath2.Vector3f force)
Adds a force to this body. |
abstract void |
addTorque(float tx,
float ty,
float tz)
Adds a torque to this body. |
void |
addTorque(org.openmali.vecmath2.Tuple3f torque)
Adds a torque to this body. |
abstract org.openmali.vecmath2.Vector3f |
getAngularVelocity()
|
Collideable |
getCollideable(int i)
|
int |
getCollideablesCount()
|
abstract org.openmali.vecmath2.Vector3f |
getLinearVelocity()
|
abstract float |
getMass()
|
java.lang.String |
getName()
|
java.lang.Object |
getParameter(java.lang.String member)
Gets a member, by name. |
java.lang.Object |
getUserObject()
|
SimulationWorld |
getWorld()
|
abstract boolean |
isEnabled()
|
abstract boolean |
isGravityEnabled()
|
protected void |
refresh()
Refreshes this Body's position and rotation from the
implementation as well as all the child-Collideable's ones. |
void |
removeCollideable(Collideable collideable)
Removes a collideable for this Body. |
void |
resetAngularVelocity()
Sets the angular velocity, as "euler angles" (but for speed), about the X, Y, and Z axis to zero. |
void |
resetLinearVelocity()
Sets the linear velocity of this object to zero. |
abstract void |
setAngularVelocity(float velX,
float velY,
float velZ)
Sets the angular velocity, as "euler angles" (but for speed), about the X, Y, and Z axis |
void |
setAngularVelocity(org.openmali.vecmath2.Tuple3f angularVel)
Sets the angular velocity, as "euler angles" (but for speed), about the X, Y, and Z axis |
abstract void |
setEnabled(boolean enabled)
Enables or disables this Body. |
abstract void |
setGravityEnabled(boolean enabled)
Enables/Disables gravity specifically for this Body. |
abstract void |
setLinearVelocity(float velX,
float velY,
float velZ)
Sets the linear velocity of this object |
void |
setLinearVelocity(org.openmali.vecmath2.Vector3f linearVel)
Sets the linear velocity of this object |
abstract void |
setMass(float mass)
Sets this Body's mass. |
void |
setName(java.lang.String name)
Sets this Bodie's name. |
void |
setParameter(java.lang.String member,
java.lang.Object value)
Sets a parameter, by name. |
void |
setUserObject(java.lang.Object userObject)
Sets this Bodie's user-object. |
java.lang.String |
toString()
|
| Methods inherited from class org.xith3d.physics.util.PlaceableImpl |
|---|
addRepositionListener, getPosition, getPosition, getPositionX, getPositionY, getPositionZ, getRotation, getRotation, getRotationMatrix, getRotationMatrix, getRotationX, getRotationY, getRotationZ, onPositionChanged, onRotationChanged, removeRepositionListener, setPosition, setPosition, setPositionX, setPositionY, setPositionZ, setRotation, setRotation, setRotationMatrix, setRotationX, setRotationY, setRotationZ |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final SimulationWorld world
protected final java.util.ArrayList<Collideable> collideables
| Constructor Detail |
|---|
public Body(SimulationWorld world)
world - the simulation world we belong toaddCollideable(Collideable)| Method Detail |
|---|
public final SimulationWorld getWorld()
SimulationWorld, this Body belongs to.public final void setName(java.lang.String name)
setName in interface org.jagatoo.datatypes.NamableObjectname - public final java.lang.String getName()
getName in interface org.jagatoo.datatypes.NamedObjectpublic final void setUserObject(java.lang.Object userObject)
userObject - public final java.lang.Object getUserObject()
public abstract void setEnabled(boolean enabled)
Body.
setEnabled in interface org.jagatoo.datatypes.Enableableenabled - public abstract boolean isEnabled()
isEnabled in interface org.jagatoo.datatypes.EnableableBody is enabled.public abstract void setGravityEnabled(boolean enabled)
Body.
enabled - public abstract boolean isGravityEnabled()
Body.public abstract org.openmali.vecmath2.Vector3f getLinearVelocity()
public abstract void setLinearVelocity(float velX,
float velY,
float velZ)
velX - velY - velZ - public final void setLinearVelocity(org.openmali.vecmath2.Vector3f linearVel)
linearVel - public final void resetLinearVelocity()
public abstract org.openmali.vecmath2.Vector3f getAngularVelocity()
public abstract void setAngularVelocity(float velX,
float velY,
float velZ)
velX - velY - velZ - public final void setAngularVelocity(org.openmali.vecmath2.Tuple3f angularVel)
angularVel - public final void resetAngularVelocity()
public abstract void addTorque(float tx,
float ty,
float tz)
tx - X componentty - Y componenttz - Z componentpublic final void addTorque(org.openmali.vecmath2.Tuple3f torque)
torque -
public abstract void addForce(float fx,
float fy,
float fz)
fx - X componentfy - Y componentfz - Z componentpublic final void addForce(org.openmali.vecmath2.Vector3f force)
force - public java.lang.Object getParameter(java.lang.String member)
member - the member to get
public void setParameter(java.lang.String member,
java.lang.Object value)
member - The name of the parametervalue - The "data" : could be Float, Vector3f, whatever..public abstract void setMass(float mass)
mass - public abstract float getMass()
public void addCollideable(Collideable collideable)
collideable - public void removeCollideable(Collideable collideable)
collideable - public final int getCollideablesCount()
Collideables in this Body.public final Collideable getCollideable(int i)
i -
Collideable in this Body.protected void refresh()
Body's position and rotation from the
implementation as well as all the child-Collideable's ones.
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||