27 const btTransform& cTransform = btTransform(
28 btQuaternion(c_orientation.
GetX(),
30 -c_orientation.
GetY(),
31 c_orientation.
GetW()),
32 btVector3(c_position.
GetX(),
37 cTransform *
m_vecBodies[0]->GetData().InverseCenterOfMassOffset;
55 btCollisionShape& cShape =
m_vecBodies[0]->GetShape();
59 cShape.getAabb(
m_vecBodies[0]->GetTransform(), cAabbMin, cAabbMax);
83 btRigidBody::btRigidBodyConstructionInfo cInfo(
m_sData.
Mass,
102 const std::shared_ptr<btCollisionShape>& ptr_shape,
103 const SData& s_data) :
105 m_cRigidBody(0.0f, nullptr, nullptr) {}
111 c_world.addRigidBody(&m_cRigidBody);
118 c_world.removeRigidBody(&m_cRigidBody);
125 m_cRigidBody.applyCentralForce(c_force);
132 const btVector3& c_offset) {
133 m_cRigidBody.applyForce(c_force, c_offset);
140 m_cRigidBody.applyTorque(c_torque);
147 return m_cRigidBody.getWorldTransform();
The namespace containing all the ARGoS related code.
Basic class for an entity that contains other entities.
An anchor related to the body of an entity.
const SBoundingBox & GetBoundingBox() const
Returns an axis-aligned box that contains the physics model.
Real GetX() const
Returns the x coordinate of this vector.
void Set(const Real f_x, const Real f_y, const Real f_z)
Sets the vector contents from Cartesian coordinates.
Real GetY() const
Returns the y coordinate of this vector.
Real GetZ() const
Returns the z coordinate of this vector.
std::vector< std::shared_ptr< CAbstractBody > > m_vecBodies
virtual void UpdateEntityStatus()
Updates the status of the associated entity.
btCollisionShape & GetShape()
CDynamics3DModel & m_cModel
btTransform InverseCenterOfMassOffset
btTransform StartTransform
virtual void CalculateBoundingBox()
Calculates the axis-aligned box that contains the entire physics model.
virtual void AddToWorld(btMultiBodyDynamicsWorld &c_world)
virtual void MoveTo(const CVector3 &c_position, const CQuaternion &c_orientation)
CDynamics3DSingleBodyObjectModel(CDynamics3DEngine &c_engine, CComposableEntity &c_entity)
virtual void RemoveFromWorld(btMultiBodyDynamicsWorld &c_world)
virtual void AddToWorld(btMultiBodyDynamicsWorld &c_world)
virtual btTransform & GetTransform()
virtual void RemoveFromWorld(btMultiBodyDynamicsWorld &c_world)
virtual void ApplyTorque(const btVector3 &c_torque)
virtual void ApplyForce(const btVector3 &c_force)
CBody(CDynamics3DModel &c_model, SAnchor *ps_anchor, const std::shared_ptr< btCollisionShape > &ptr_shape, const SData &s_data)