|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DBody
A rigid body has various properties from the point of view of the simulation. Some properties change over time:
Other body properties are usually constant over time:
The origin of this coordinate frame is the body's point of reference. Some values in ODE (vectors, matrices etc) are relative to the body coordinate frame, and others are relative to the global coordinate frame.
Note that the shape of a rigid body is not a dynamical property (except insofar as it influences the various mass properties). It is only collision detection that cares about the detailed shape of the body.
From odecpp.h.
Nested Class Summary | |
---|---|
static interface |
DBody.BodyMoveCallBack
Whenever a body has its position or rotation changed during the timestep, the callback will be called (with body as the argument). |
Method Summary | |
---|---|
void |
addForce(double fx,
double fy,
double fz)
Add force at centre of mass of body in absolute coordinates. |
void |
addForce(DVector3C f)
Add force at centre of mass of body in absolute coordinates. |
void |
addForceAtPos(double fx,
double fy,
double fz,
double px,
double py,
double pz)
Add force at specified point in body in global coordinates. |
void |
addForceAtPos(DVector3C f,
DVector3C p)
Add force at specified point in body in global coordinates. |
void |
addForceAtRelPos(double fx,
double fy,
double fz,
double px,
double py,
double pz)
Add force at specified point in body in local coordinates. |
void |
addForceAtRelPos(DVector3C f,
DVector3C p)
Add force at specified point in body in local coordinates. |
void |
addRelForce(double fx,
double fy,
double fz)
Add force at centre of mass of body in coordinates relative to body. |
void |
addRelForce(DVector3C f)
Add force at centre of mass of body in coordinates relative to body. |
void |
addRelForceAtPos(double fx,
double fy,
double fz,
double px,
double py,
double pz)
Add force at specified point in body in global coordinates. |
void |
addRelForceAtPos(DVector3C f,
DVector3C p)
Add force at specified point in body in global coordinates. |
void |
addRelForceAtRelPos(double fx,
double fy,
double fz,
double px,
double py,
double pz)
Add force at specified point in body in local coordinates. |
void |
addRelForceAtRelPos(DVector3C f,
DVector3C p)
Add force at specified point in body in local coordinates. |
void |
addRelTorque(double fx,
double fy,
double fz)
Add torque at centre of mass of body in coordinates relative to body. |
void |
addRelTorque(DVector3C t)
Add torque at centre of mass of body in coordinates relative to body. |
void |
addTorque(double fx,
double fy,
double fz)
Add torque at centre of mass of body in absolute coordinates. |
void |
addTorque(DVector3C t)
Add torque at centre of mass of body in absolute coordinates. |
void |
destroy()
Destroy a body. |
void |
DESTRUCTOR()
|
void |
disable()
Manually disable a body. |
void |
enable()
Manually enable a body. |
double |
getAngularDamping()
Get the body's angular damping scale. |
double |
getAngularDampingThreshold()
Get the body's angular damping threshold. |
DVector3C |
getAngularVel()
Get the angular velocity of a body. |
double |
getAutoDisableAngularThreshold()
Get auto disable angular average threshold. |
int |
getAutoDisableAverageSamplesCount()
Get auto disable average size (samples count). |
boolean |
getAutoDisableFlag()
Get auto disable flag. |
double |
getAutoDisableLinearThreshold()
Get auto disable linear average threshold. |
int |
getAutoDisableSteps()
Get auto steps a body must be thought of as idle to disable |
double |
getAutoDisableTime()
Get auto disable time. |
java.lang.Object |
getData()
Get the body's user-data pointer. |
void |
getFiniteRotationAxis(DVector3 result)
Get the finite rotation axis. |
boolean |
getFiniteRotationMode()
Get the way a body's orientation is updated each timestep. |
DGeom |
getFirstGeom()
Deprecated. May be replaced by a more Java-like API. |
DVector3C |
getForce()
Return the current accumulated force vector. |
boolean |
getGravityMode()
Get whether the body is influenced by the world's gravity or not. |
boolean |
getGyroscopicMode()
Get the body's gyroscopic state. |
DJoint |
getJoint(int index)
Return a joint attached to this body, given by index. |
double |
getLinearDamping()
Get the body's linear damping scale. |
double |
getLinearDampingThreshold()
Get the body's linear damping threshold. |
DVector3C |
getLinearVel()
Get the linear velocity of a body. |
DMassC |
getMass()
Get the mass of a body. |
double |
getMaxAngularSpeed()
Get the body's maximum angular speed. |
DGeom |
getNextGeom(DGeom geom)
Deprecated. May be replaced by a more Java-like API. |
int |
getNumJoints()
Get the number of joints that are attached to this body. |
void |
getPointVel(double px,
double py,
double pz,
DVector3 result)
Get velocity vector in global coords of a globally specified point on a body. |
void |
getPointVel(DVector3C p,
DVector3 result)
Get velocity vector in global coords of a globally specified point on a body. |
DVector3C |
getPosition()
Get the position of a body. |
void |
getPosRelPoint(double px,
double py,
double pz,
DVector3 result)
Takes a point in global coordinates and returns the point's position in body-relative coordinates. |
void |
getPosRelPoint(DVector3C p,
DVector3 result)
Takes a point in global coordinates and returns the point's position in body-relative coordinates. |
DQuaternionC |
getQuaternion()
Get the rotation of a body. |
void |
getRelPointPos(double px,
double py,
double pz,
DVector3 result)
Get world position of a relative point on body. |
void |
getRelPointPos(DVector3C p,
DVector3 result)
Get world position of a relative point on body. |
void |
getRelPointVel(double px,
double py,
double pz,
DVector3 result)
Get velocity vector in global coords of a relative point on body. |
void |
getRelPointVel(DVector3C p,
DVector3 result)
Get velocity vector in global coords of a relative point on body. |
DMatrix3C |
getRotation()
Get the rotation of a body. |
DVector3C |
getTorque()
Return the current accumulated torque vector. |
DWorld |
getWorld()
Retrieves the world attached to the given body. |
boolean |
isConnectedTo(DBody body)
|
boolean |
isEnabled()
Check wether a body is enabled. |
boolean |
isKinematic()
Check wether a body is in kinematic state. |
void |
setAngularDamping(double scale)
Set the body's angular damping scale. |
void |
setAngularDampingThreshold(double threshold)
Set the body's angular damping threshold. |
void |
setAngularVel(double x,
double y,
double z)
Set the angular velocity of a body. |
void |
setAngularVel(DVector3C v)
Set the angular velocity of a body. |
void |
setAutoDisableAngularThreshold(double threshold)
Set auto disable angular average threshold. |
void |
setAutoDisableAverageSamplesCount(int average_samples_count)
Set auto disable average buffer size (average steps). |
void |
setAutoDisableDefaults()
Set auto disable defaults. |
void |
setAutoDisableFlag(boolean do_auto_disable)
Set auto disable flag. |
void |
setAutoDisableLinearThreshold(double threshold)
Set auto disable linear average threshold. |
void |
setAutoDisableSteps(int steps)
Set auto disable steps. |
void |
setAutoDisableTime(double time)
Set auto disable time. |
void |
setDamping(double linear_scale,
double angular_scale)
Convenience function to set linear and angular scales at once. |
void |
setDampingDefaults()
Resets the damping settings to the current world's settings. |
void |
setData(java.lang.Object data)
Set the body's user-data pointer. |
void |
setDynamic()
Set rigid body to dynamic state (default). |
void |
setFiniteRotationAxis(double x,
double y,
double z)
Sets the finite rotation axis for a body. |
void |
setFiniteRotationAxis(DVector3C a)
Sets the finite rotation axis for a body. |
void |
setFiniteRotationMode(boolean mode)
Controls the way a body's orientation is updated at each timestep. |
void |
setForce(double x,
double y,
double z)
Set the body force accumulation vector. |
void |
setForce(DVector3C f)
Set the body force accumulation vector. |
void |
setGravityMode(boolean mode)
Set whether the body is influenced by the world's gravity or not. |
void |
setGyroscopicMode(boolean enabled)
Enable/disable the body's gyroscopic term. |
void |
setKinematic()
Set rigid body to kinematic state. |
void |
setLinearDamping(double scale)
Set the body's linear damping scale. |
void |
setLinearDampingThreshold(double threshold)
Set the body's linear damping threshold. |
void |
setLinearVel(double x,
double y,
double z)
Set the linear velocity of a body. |
void |
setLinearVel(DVector3C v)
Set the linear velocity of a body. |
void |
setMass(DMassC mass)
Set the mass of a body. |
void |
setMaxAngularSpeed(double max_speed)
Set the body's maximum angular speed. |
void |
setMovedCallback(DBody.BodyMoveCallBack callback)
Set the 'moved' callback of a body. |
void |
setPosition(double x,
double y,
double z)
Set position of a body. |
void |
setPosition(DVector3C p)
Set position of a body. |
void |
setQuaternion(DQuaternionC q)
Set the orientation of a body. |
void |
setRotation(DMatrix3C R)
Set the orientation of a body. |
void |
setTorque(double x,
double y,
double z)
Set the body torque accumulation vector. |
void |
setTorque(DVector3C t)
Set the body torque accumulation vector. |
void |
vectorFromWorld(double px,
double py,
double pz,
DVector3 result)
Convert from world to local coordinates. |
void |
vectorFromWorld(DVector3C p,
DVector3 result)
Convert from world to local coordinates. |
void |
vectorToWorld(double px,
double py,
double pz,
DVector3 result)
Convert from local to world coordinates. |
void |
vectorToWorld(DVector3C p,
DVector3 result)
Convert from local to world coordinates. |
Method Detail |
---|
void DESTRUCTOR()
void destroy()
void setData(java.lang.Object data)
data
- arbitraty pointerjava.lang.Object getData()
void setPosition(double x, double y, double z)
void setPosition(DVector3C p)
void setRotation(DMatrix3C R)
void setQuaternion(DQuaternionC q)
void setLinearVel(double x, double y, double z)
void setLinearVel(DVector3C v)
void setAngularVel(double x, double y, double z)
void setAngularVel(DVector3C v)
DVector3C getPosition()
DMatrix3C getRotation()
DQuaternionC getQuaternion()
DVector3C getLinearVel()
DVector3C getAngularVel()
void setMass(DMassC mass)
DMassC getMass()
DWorld getWorld()
void setAutoDisableLinearThreshold(double threshold)
double getAutoDisableLinearThreshold()
void setAutoDisableAngularThreshold(double threshold)
double getAutoDisableAngularThreshold()
void setAutoDisableSteps(int steps)
steps
- the nr of steps.int getAutoDisableSteps()
void setAutoDisableTime(double time)
time
- nr of seconds.double getAutoDisableTime()
void setAutoDisableFlag(boolean do_auto_disable)
do_auto_disable
- 0 or 1boolean getAutoDisableFlag()
int getAutoDisableAverageSamplesCount()
void setAutoDisableAverageSamplesCount(int average_samples_count)
average_samples_count
- the nr of samples to review.void setAutoDisableDefaults()
void addForce(double fx, double fy, double fz)
void addForce(DVector3C f)
void addTorque(double fx, double fy, double fz)
void addTorque(DVector3C t)
void addRelForce(double fx, double fy, double fz)
void addRelForce(DVector3C f)
void addRelTorque(double fx, double fy, double fz)
void addRelTorque(DVector3C t)
void addForceAtPos(double fx, double fy, double fz, double px, double py, double pz)
void addForceAtPos(DVector3C f, DVector3C p)
void addForceAtRelPos(double fx, double fy, double fz, double px, double py, double pz)
void addForceAtRelPos(DVector3C f, DVector3C p)
void addRelForceAtPos(double fx, double fy, double fz, double px, double py, double pz)
void addRelForceAtPos(DVector3C f, DVector3C p)
void addRelForceAtRelPos(double fx, double fy, double fz, double px, double py, double pz)
void addRelForceAtRelPos(DVector3C f, DVector3C p)
DVector3C getForce()
DVector3C getTorque()
void setForce(double x, double y, double z)
void setForce(DVector3C f)
void setTorque(double x, double y, double z)
void setTorque(DVector3C t)
void getRelPointPos(double px, double py, double pz, DVector3 result)
result
- will contain the result.void getRelPointPos(DVector3C p, DVector3 result)
result
- will contain the result.void getRelPointVel(double px, double py, double pz, DVector3 result)
result
- will contain the result.void getRelPointVel(DVector3C p, DVector3 result)
result
- will contain the result.void getPointVel(double px, double py, double pz, DVector3 result)
result
- will contain the result.void getPointVel(DVector3C p, DVector3 result)
result
- will contain the result.void getPosRelPoint(double px, double py, double pz, DVector3 result)
result
- will contain the result.void getPosRelPoint(DVector3C p, DVector3 result)
result
- will contain the result.void vectorToWorld(double px, double py, double pz, DVector3 result)
result
- will contain the result.void vectorToWorld(DVector3C p, DVector3 result)
result
- will contain the result.void vectorFromWorld(double px, double py, double pz, DVector3 result)
result
- will contain the result.void vectorFromWorld(DVector3C p, DVector3 result)
result
- will contain the result.void setFiniteRotationMode(boolean mode)
mode
- can be 0 or 1:
void setFiniteRotationAxis(double x, double y, double z)
void setFiniteRotationAxis(DVector3C a)
boolean getFiniteRotationMode()
void getFiniteRotationAxis(DVector3 result)
result
- will contain the axis.int getNumJoints()
DJoint getJoint(int index)
index
- valid range is 0 to n-1 where n is the value returned by
dBodyGetNumJoints().void setDynamic()
void setKinematic()
boolean isKinematic()
void enable()
void disable()
boolean isEnabled()
void setGravityMode(boolean mode)
mode
- when nonzero gravity affects this body.boolean getGravityMode()
boolean isConnectedTo(DBody body)
double getLinearDamping()
void setLinearDamping(double scale)
scale
- The linear damping scale. Should be in the interval [0, 1].setDampingDefaults()
double getAngularDamping()
void setAngularDamping(double scale)
scale
- The angular damping scale. Should be in the interval [0, 1].void setDamping(double linear_scale, double angular_scale)
linear_scale
- The linear damping scale. Should be in the interval [0, 1].angular_scale
- The angular damping scale. Should be in the interval [0, 1].setLinearDamping(double)
,
setAngularDamping(double)
double getLinearDampingThreshold()
void setLinearDampingThreshold(double threshold)
threshold
- The linear threshold to be used. Damping
is only applied if the linear speed is above this limit.double getAngularDampingThreshold()
void setAngularDampingThreshold(double threshold)
threshold
- The angular threshold to be used. Damping is
only used if the angular speed is above this limit.void setDampingDefaults()
double getMaxAngularSpeed()
DWorld.getMaxAngularSpeed()
void setMaxAngularSpeed(double max_speed)
DWorld.setMaxAngularSpeed(double)
boolean getGyroscopicMode()
void setGyroscopicMode(boolean enabled)
enabled
- nonzero (default) to enable gyroscopic term, 0
to disable.void setMovedCallback(DBody.BodyMoveCallBack callback)
callback
- the callback to be invoked when the body moves. Set to zero
to disable.DGeom getFirstGeom()
DGeom getNextGeom(DGeom geom)
geom
- a geom attached to some body.
getFirstGeom()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |