RobWorkProject
23.9.11-
|
Wrapper class for a bullet btRigidBody, that bridges between RobWork and Bullet. More...
#include <BtBody.hpp>
Classes | |
struct | BodyMetaData |
Data structure to attach to bullet bodies, allowing friction and restitution to be specified separately for each pair of bodies. More... | |
struct | GeometryMetaData |
Data structure to attch to bullet collision shapes. More... | |
Public Member Functions | |
BtBody (rw::core::Ptr< rwsim::dynamics::Body > body, const rwsim::dynamics::MaterialDataMap *frictionMap, const rwsim::dynamics::ContactDataMap *collisionMap, btDynamicsWorld *btWorld, const rw::kinematics::State &state) | |
Construct new bullet body for the given world. More... | |
virtual | ~BtBody () |
Destructor. | |
rw::core::Ptr< rwsim::dynamics::Body > | getRwBody () const |
Get the RobWork body. More... | |
btRigidBody * | getBulletBody () const |
Get the underlying btRigidBody from Bullet. More... | |
void | update (double dt, rw::kinematics::State &state) const |
Update the position of all kinematic bodies. More... | |
void | postupdate (rw::kinematics::State &state) const |
This method updates the state with state info of the Bullet object. Which means that Bullet states are converted to rw states. More... | |
bool | isDynamic () const |
Test whether the object is dynamic (equivalent to the RigidBody type in RobWork). More... | |
const rw::math::Transform3D & | getBodyTcom () const |
Get the transform from the body frame to the center of mass frame. More... | |
rw::math::Transform3D | getWorldTcom () const |
Get the current transform of the Bullet body. More... | |
Wrapper class for a bullet btRigidBody, that bridges between RobWork and Bullet.
BtBody | ( | rw::core::Ptr< rwsim::dynamics::Body > | body, |
const rwsim::dynamics::MaterialDataMap * | frictionMap, | ||
const rwsim::dynamics::ContactDataMap * | collisionMap, | ||
btDynamicsWorld * | btWorld, | ||
const rw::kinematics::State & | state | ||
) |
Construct new bullet body for the given world.
body | [in] the RobWork body to create bullet body for. |
frictionMap | [in] the friction map to look up in (must point to the same map for two objects in contact). |
collisionMap | [in] the collision map to look up in (must point to the same map for two objects in contact). |
btWorld | [in] the Bullet world to add the body to. |
state | [in] the initial state with the initial position and velocity for the body. |
const rw::math::Transform3D& getBodyTcom | ( | ) | const |
Get the transform from the body frame to the center of mass frame.
btRigidBody* getBulletBody | ( | ) | const |
Get the underlying btRigidBody from Bullet.
rw::core::Ptr<rwsim::dynamics::Body> getRwBody | ( | ) | const |
Get the RobWork body.
rw::math::Transform3D getWorldTcom | ( | ) | const |
Get the current transform of the Bullet body.
bool isDynamic | ( | ) | const |
Test whether the object is dynamic (equivalent to the RigidBody type in RobWork).
void postupdate | ( | rw::kinematics::State & | state | ) | const |
This method updates the state with state info of the Bullet object. Which means that Bullet states are converted to rw states.
state | [in/out] the state is updated with new positions and velocities. |
void update | ( | double | dt, |
rw::kinematics::State & | state | ||
) | const |
Update the position of all kinematic bodies.
dt | [in] the size of the timestep. |
state | [in/out] the state with updated position for kinematic bodies. |