argos::CDynamics3DModel Class Referenceabstract

#include <dynamics3d_model.h>

Inheritance diagram for argos::CDynamics3DModel:
Collaboration diagram for argos::CDynamics3DModel:

Classes

class  CAbstractBody
 

Public Types

typedef std::map< std::string, CDynamics3DModel * > TMap
 
- Public Types inherited from argos::CPhysicsModel
typedef std::map< std::string, CPhysicsModel * > TMap
 
typedef std::vector< CPhysicsModel * > TVector
 

Public Member Functions

 CDynamics3DModel (CDynamics3DEngine &c_engine, CComposableEntity &c_entity)
 
virtual ~CDynamics3DModel ()
 
virtual void Reset ()=0
 
CDynamics3DEngineGetEngine ()
 
const CDynamics3DEngineGetEngine () const
 
CComposableEntityGetComposableEntity ()
 
const CComposableEntityGetComposableEntity () const
 
virtual bool IsCollidingWithSomething () const
 Returns true if this model is colliding with another model. More...
 
virtual void UpdateEntityStatus ()
 Updates the status of the associated entity. More...
 
virtual void UpdateFromEntityStatus ()
 Updates the state of this model from the status of the associated entity. More...
 
std::vector< CAbstractBody * > & GetBodies ()
 
virtual void AddToWorld (btMultiBodyDynamicsWorld &c_world)=0
 
virtual void RemoveFromWorld (btMultiBodyDynamicsWorld &c_world)=0
 
- Public Member Functions inherited from argos::CPhysicsModel
 CPhysicsModel (CPhysicsEngine &c_engine, CEmbodiedEntity &c_entity)
 
virtual ~CPhysicsModel ()
 
CPhysicsEngineGetEngine ()
 Returns the physics engine associated to this physics model. More...
 
CEmbodiedEntityGetEmbodiedEntity ()
 Returns the embodied entity associated to this physics model. More...
 
const CEmbodiedEntityGetEmbodiedEntity () const
 Returns the embodied entity associated to this physics model. More...
 
virtual void MoveTo (const CVector3 &c_position, const CQuaternion &c_orientation)=0
 
const SBoundingBoxGetBoundingBox () const
 Returns an axis-aligned box that contains the physics model. More...
 
virtual void CalculateBoundingBox ()=0
 Calculates the axis-aligned box that contains the entire physics model. More...
 
virtual void CalculateAnchors ()
 Calculates the anchors associated to this model. More...
 
SBoundingBoxGetBoundingBox ()
 Returns an axis-aligned box that contains the physics model. More...
 
template<typename MODEL >
void RegisterAnchorMethod (const SAnchor &s_anchor, void(MODEL::*pt_method)(SAnchor &))
 Registers an anchor method. More...
 

Protected Attributes

std::vector< CAbstractBody * > m_vecBodies
 

Detailed Description

Definition at line 26 of file dynamics3d_model.h.

Member Typedef Documentation

typedef std::map<std::string, CDynamics3DModel*> argos::CDynamics3DModel::TMap

Definition at line 30 of file dynamics3d_model.h.

Constructor & Destructor Documentation

argos::CDynamics3DModel::CDynamics3DModel ( CDynamics3DEngine c_engine,
CComposableEntity c_entity 
)

Definition at line 95 of file dynamics3d_model.cpp.

argos::CDynamics3DModel::~CDynamics3DModel ( )
virtual

Definition at line 104 of file dynamics3d_model.cpp.

Member Function Documentation

virtual void argos::CDynamics3DModel::AddToWorld ( btMultiBodyDynamicsWorld &  c_world)
pure virtual
std::vector<CAbstractBody*>& argos::CDynamics3DModel::GetBodies ( )
inline

Definition at line 134 of file dynamics3d_model.h.

CComposableEntity& argos::CDynamics3DModel::GetComposableEntity ( )
inline

Definition at line 120 of file dynamics3d_model.h.

const CComposableEntity& argos::CDynamics3DModel::GetComposableEntity ( ) const
inline

Definition at line 124 of file dynamics3d_model.h.

CDynamics3DEngine& argos::CDynamics3DModel::GetEngine ( )
inline

Definition at line 112 of file dynamics3d_model.h.

const CDynamics3DEngine& argos::CDynamics3DModel::GetEngine ( ) const
inline

Definition at line 116 of file dynamics3d_model.h.

bool argos::CDynamics3DModel::IsCollidingWithSomething ( ) const
virtual

Returns true if this model is colliding with another model.

Returns
true if this model is colliding with another model.

Implements argos::CPhysicsModel.

Definition at line 114 of file dynamics3d_model.cpp.

virtual void argos::CDynamics3DModel::RemoveFromWorld ( btMultiBodyDynamicsWorld &  c_world)
pure virtual
virtual void argos::CDynamics3DModel::Reset ( )
pure virtual
void argos::CDynamics3DModel::UpdateEntityStatus ( )
virtual

Updates the status of the associated entity.

This method performs all the calculations to update the status of the entity associated to this model. In particular, it is in this method that anchors get updated and transfer to other engines is scheduled. This method internally calls:

See also
CalculateBoundingBox()
CalculateAnchors()
CComposableEntity::UpdateComponents()

Reimplemented from argos::CPhysicsModel.

Reimplemented in argos::CDynamics3DPrototypeModel.

Definition at line 154 of file dynamics3d_model.cpp.

virtual void argos::CDynamics3DModel::UpdateFromEntityStatus ( )
inlinevirtual

Updates the state of this model from the status of the associated entity.

This method takes the current state of the associated entity (e.g., desired wheel speed, turret rotationss, etc.) and updates the state of this model. Typically, in this method you apply forces and set speeds.

Implements argos::CPhysicsModel.

Reimplemented in argos::CDynamics3DPrototypeModel.

Definition at line 132 of file dynamics3d_model.h.

Member Data Documentation

std::vector<CAbstractBody*> argos::CDynamics3DModel::m_vecBodies
protected

Definition at line 144 of file dynamics3d_model.h.