argos::CPointMass3DModel Class Referenceabstract

#include <pointmass3d_model.h>

Inheritance diagram for argos::CPointMass3DModel:
Collaboration diagram for argos::CPointMass3DModel:

Public Types

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

Public Member Functions

 CPointMass3DModel (CPointMass3DEngine &c_engine, CEmbodiedEntity &c_entity)
 
virtual ~CPointMass3DModel ()
 
virtual void MoveTo (const CVector3 &c_position, const CQuaternion &c_orientation)
 
virtual void Reset ()
 
virtual void Step ()=0
 
virtual void UpdateFromEntityStatus ()=0
 Updates the state of this model from the status of the associated entity. More...
 
virtual bool IsCollidingWithSomething () const
 Returns true if this model is colliding with another model. More...
 
virtual bool CheckIntersectionWithRay (Real &f_t_on_ray, const CRay3 &c_ray) const =0
 
virtual void UpdateOriginAnchor (SAnchor &s_anchor)
 Updates the origin anchor associated to the embodied entity. More...
 
CPointMass3DEngineGetPM3DEngine ()
 Returns a reference to the physics engine controlling this model. More...
 
const CPointMass3DEngineGetPM3DEngine () const
 Returns a const reference to the physics engine controlling this model. More...
 
- 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 UpdateEntityStatus ()
 Updates the status of the associated entity. More...
 
virtual void UpdatePhysics ()
 Performs extra work just before the physics update takes place. More...
 
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

CPointMass3DEnginem_cPM3DEngine
 Reference to the physics engine. More...
 
CVector3 m_cPosition
 The position of the model in this engine. More...
 
CVector3 m_cVelocity
 The linear velocity of this model in the engine. More...
 
CVector3 m_cAcceleration
 The acceleration of this model in the engine. More...
 

Detailed Description

Definition at line 21 of file pointmass3d_model.h.

Member Typedef Documentation

◆ TMap

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

Definition at line 25 of file pointmass3d_model.h.

Constructor & Destructor Documentation

◆ CPointMass3DModel()

argos::CPointMass3DModel::CPointMass3DModel ( CPointMass3DEngine c_engine,
CEmbodiedEntity c_entity 
)

Definition at line 9 of file pointmass3d_model.cpp.

◆ ~CPointMass3DModel()

virtual argos::CPointMass3DModel::~CPointMass3DModel ( )
inlinevirtual

Definition at line 32 of file pointmass3d_model.h.

Member Function Documentation

◆ CheckIntersectionWithRay()

virtual bool argos::CPointMass3DModel::CheckIntersectionWithRay ( Real f_t_on_ray,
const CRay3 c_ray 
) const
pure virtual

◆ GetPM3DEngine() [1/2]

CPointMass3DEngine& argos::CPointMass3DModel::GetPM3DEngine ( )
inline

Returns a reference to the physics engine controlling this model.

Returns
A reference to the physics engine controlling this model.

Definition at line 56 of file pointmass3d_model.h.

◆ GetPM3DEngine() [2/2]

const CPointMass3DEngine& argos::CPointMass3DModel::GetPM3DEngine ( ) const
inline

Returns a const reference to the physics engine controlling this model.

Returns
A const reference to the physics engine controlling this model.

Definition at line 64 of file pointmass3d_model.h.

◆ IsCollidingWithSomething()

bool argos::CPointMass3DModel::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 42 of file pointmass3d_model.cpp.

◆ MoveTo()

void argos::CPointMass3DModel::MoveTo ( const CVector3 c_position,
const CQuaternion c_orientation 
)
virtual

Moves the entity to the wanted position and orientation within this engine. When you create a new model, you must implement this method. Don't forget to call UpdateEntityStatus() after you've changed the position.

This method should never be called directly from user code. It is called internally by CEmbodiedEntity::MoveTo(), which is meant to be called from user code.

CEmbodiedEntity::MoveTo() never calls this method if the embodied entity is static. This is because static entities cannot be moved around. Thus, there's no need in your code to check whether the associated entity is static.

Parameters
c_positionThe wanted position.
c_orientationThe wanted orientation.

Implements argos::CPhysicsModel.

Definition at line 33 of file pointmass3d_model.cpp.

◆ Reset()

void argos::CPointMass3DModel::Reset ( )
virtual

◆ Step()

virtual void argos::CPointMass3DModel::Step ( )
pure virtual

◆ UpdateFromEntityStatus()

virtual void argos::CPointMass3DModel::UpdateFromEntityStatus ( )
pure virtual

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.

Implemented in argos::CPointMass3DQuadRotorModel, argos::CPointMass3DCylinderModel, argos::CPointMass3DBoxModel, and argos::CPointMass3DFootBotModel.

◆ UpdateOriginAnchor()

void argos::CPointMass3DModel::UpdateOriginAnchor ( SAnchor s_anchor)
virtual

Updates the origin anchor associated to the embodied entity.

Reimplemented in argos::CPointMass3DQuadRotorModel, and argos::CPointMass3DFootBotModel.

Definition at line 56 of file pointmass3d_model.cpp.

Member Data Documentation

◆ m_cAcceleration

CVector3 argos::CPointMass3DModel::m_cAcceleration
protected

The acceleration of this model in the engine.

Definition at line 80 of file pointmass3d_model.h.

◆ m_cPM3DEngine

CPointMass3DEngine& argos::CPointMass3DModel::m_cPM3DEngine
protected

Reference to the physics engine.

Definition at line 71 of file pointmass3d_model.h.

◆ m_cPosition

CVector3 argos::CPointMass3DModel::m_cPosition
protected

The position of the model in this engine.

Definition at line 74 of file pointmass3d_model.h.

◆ m_cVelocity

CVector3 argos::CPointMass3DModel::m_cVelocity
protected

The linear velocity of this model in the engine.

Definition at line 77 of file pointmass3d_model.h.