Trees | Index | Help |
|
---|
Module ode :: Class Body |
|
object
--+
|
Body
The rigid body class encapsulating the ODE body.
This class represents a rigid body that has a location and orientation in space and that stores the mass properties of an object.
When creating a Body object you have to pass the world it belongs to as argument to the constructor:>>> import ode >>> w = ode.World() >>> b = ode.Body(w)
Method Summary | |
---|---|
x.__init__(...) initializes x; see x.__class__.__doc__ for signature | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
x.__setattr__('name', value) <==> x.name = value | |
Add an external force f given in absolute coordinates. | |
Add an external force f at position p. | |
Add an external force f at position p. | |
Add an external force f given in relative coordinates (relative to the body's own frame of reference). | |
Add an external force f at position p. | |
Add an external force f at position p. | |
Add an external torque t given in relative coordinates (relative to the body's own frame of reference). | |
Add an external torque t given in absolute coordinates. | |
Manually disable a body. | |
Manually enable a body. | |
3-tuple |
Get the current angular velocity of the body. |
3-tuple |
Return the current finite rotation axis of the body. |
mode (0/1) |
Return the current finite rotation mode of a body (0 or 1). |
3-tuple |
Return the current accumulated force. |
bool |
Return True if the body is influenced by the world's gravity. |
3-tuple |
Get the current linear velocity of the body. |
mass |
Return the mass properties as a Mass object. |
int |
Return the number of joints that are attached to this body. |
3-tuple |
Utility function that takes a point p on a body and returns that point's velocity in global coordinates. |
3-tuple |
Return the current position of the body. |
3-tuple |
This is the inverse of getRelPointPos(). |
4-tuple |
Return the current rotation as a quaternion. |
3-tuple |
Utility function that takes a point p on a body and returns that point's position in global coordinates. |
3-tuple |
Utility function that takes a point p on a body and returns that point's velocity in global coordinates. |
9-tuple |
Return the current rotation matrix as a tuple of 9 floats (row-major order). |
3-tuple |
Return the current accumulated torque. |
bool |
Check if a body is currently enabled. |
Set the angular velocity of the body. | |
Set the finite rotation axis of the body. | |
This function controls the way a body's orientation is updated at each time step. | |
Set the body force accumulation vector. | |
Set whether the body is influenced by the world's gravity or not. | |
Set the linear velocity of the body. | |
Set the mass properties of the body. | |
Set the position of the body. | |
Set the orientation of the body. | |
Set the orientation of the body. | |
Set the body torque accumulation vector. | |
3-tuple |
Given a vector v expressed in the world coordinate system, rotate it to the body coordinate system. |
3-tuple |
Given a vector v expressed in the body coordinate system, rotate it to the world coordinate system. |
Inherited from object | |
x.__hash__() <==> hash(x) | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__str__() <==> str(x) |
Method Details |
---|
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for
signature
|
__delattr__(...)x.__delattr__('name') <==> del x.name
|
__getattribute__(...)x.__getattribute__('name') <==> x.name
|
__new__(T, S, ...)T.__new__(S, ...) -> a new object with type S, a subtype of T
|
__setattr__(...)x.__setattr__('name', value) <==> x.name = value
|
addForce(f)Add an external force f given in absolute coordinates. The force is applied at the center of mass.
|
addForceAtPos(f, p)Add an external force f at position p. Both arguments must be given in absolute coordinates.
|
addForceAtRelPos(f, p)Add an external force f at position p. f is given in absolute coordinates and p in absolute coordinates.
|
addRelForce(f)Add an external force f given in relative coordinates (relative to the body's own frame of reference). The force is applied at the center of mass.
|
addRelForceAtPos(f, p)Add an external force f at position p. f is given in relative coordinates and p in relative coordinates.
|
addRelForceAtRelPos(f, p)Add an external force f at position p. Both arguments must be given in relative coordinates.
|
addRelTorque(t)Add an external torque t given in relative coordinates (relative to the body's own frame of reference).
|
addTorque(t)Add an external torque t given in absolute coordinates.
|
disable()Manually disable a body. Note that a disabled body that is connected through a joint to an enabled body will be automatically re-enabled at the next simulation step. |
enable()Manually enable a body. |
getAngularVel()Get the current angular velocity of the body.
|
getFiniteRotationAxis()Return the current finite rotation axis of the body.
|
getFiniteRotationMode()Return the current finite rotation mode of a body (0 or 1). See setFiniteRotationMode().
|
getForce()Return the current accumulated force.
|
getGravityMode()Return True if the body is influenced by the world's gravity.
|
getLinearVel()Get the current linear velocity of the body.
|
getMass()Return the mass properties as a Mass object.
|
getNumJoints()Return the number of joints that are attached to this body.
|
getPointVel(p)Utility function that takes a point p on a body and returns that point's velocity in global coordinates. The point p must be given in global coordinates.
|
getPosition()Return the current position of the body.
|
getPosRelPoint(p)This is the inverse of getRelPointPos(). It takes a point p in global coordinates and returns the point's position in body-relative coordinates.
|
getQuaternion()Return the current rotation as a quaternion. The return value is a list of 4 floats.
|
getRelPointPos(p)Utility function that takes a point p on a body and returns that point's position in global coordinates. The point p must be given in body relative coordinates.
|
getRelPointVel(p)Utility function that takes a point p on a body and returns that point's velocity in global coordinates. The point p must be given in body relative coordinates.
|
getRotation()Return the current rotation matrix as a tuple of 9 floats (row-major order).
|
getTorque()Return the current accumulated torque.
|
isEnabled()Check if a body is currently enabled.
|
setAngularVel(vel)Set the angular velocity of the body.
|
setFiniteRotationAxis(a)Set the finite rotation axis of the body. This axis only has a meaning when the finite rotation mode is set (see setFiniteRotationMode()).
|
setFiniteRotationMode(mode)This function controls the way a body's orientation is updated at each time step. The mode argument can be:
|
setForce(f)Set the body force accumulation vector.
|
setGravityMode(mode)Set whether the body is influenced by the world's gravity or not. If mode is True it is, otherwise it isn't. Newly created bodies are always influenced by the world's gravity.
|
setLinearVel(vel)Set the linear velocity of the body.
|
setMass(mass)Set the mass properties of the body. The argument mass must be an instance of a Mass object.
|
setPosition(pos)Set the position of the body.
|
setQuaternion(q)Set the orientation of the body. The quaternion must be given as a sequence of 4 floats.
|
setRotation(R)Set the orientation of the body. The rotation matrix must be given as a sequence of 9 floats which are the elements of the matrix in row-major order.
|
setTorque(t)Set the body torque accumulation vector.
|
vectorFromWorld(v)Given a vector v expressed in the world coordinate system, rotate it to the body coordinate system.
|
vectorToWorld(v)Given a vector v expressed in the body coordinate system, rotate it to the world coordinate system.
|
Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Sun Feb 4 17:54:12 2007 | http://epydoc.sf.net |