7 #ifndef DYNAMICS3D_MODEL_H
8 #define DYNAMICS3D_MODEL_H
11 class CDynamics3DEngine;
14 #include <argos3/core/simulator/physics_engine/physics_model.h>
15 #include <argos3/core/simulator/entity/composable_entity.h>
16 #include <argos3/core/utility/math/vector3.h>
17 #include <argos3/core/utility/math/quaternion.h>
20 #pragma clang diagnostic push
21 #pragma clang diagnostic ignored "-Wreorder"
23 #pragma GCC diagnostic push
24 #pragma GCC diagnostic ignored "-Wreorder"
27 #include <argos3/plugins/simulator/physics_engines/dynamics3d/bullet/btBulletCollisionCommon.h>
28 #include <argos3/plugins/simulator/physics_engines/dynamics3d/bullet/BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.h>
31 #pragma clang diagnostic pop
33 #pragma GCC diagnostic pop
47 typedef std::map<std::string, CDynamics3DModel*>
TMap;
55 using TVector = std::vector<std::shared_ptr<CAbstractBody> >;
63 SDipole(
const std::function<btVector3()>& fn_get_field,
64 const btTransform& c_offset) :
73 SData(
const btTransform& c_start_transform,
74 const btTransform& c_center_of_mass_offset,
75 const btVector3& c_inertia,
78 const std::vector<SDipole>& vec_dipoles = std::vector<SDipole>());
94 const std::shared_ptr<btCollisionShape>& ptr_shape,
109 virtual void AddToWorld(btMultiBodyDynamicsWorld& c_world) = 0;
115 virtual void ApplyForce(
const btVector3& c_force,
const btVector3& c_offset) = 0;
152 return m_cComposableEntity;
156 return m_cComposableEntity;
165 std::vector<std::shared_ptr<CAbstractBody> >&
GetBodies() {
169 virtual void AddToWorld(btMultiBodyDynamicsWorld& c_world) = 0;
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 CDynamics3DEngine & GetEngine() const
virtual void AddToWorld(btMultiBodyDynamicsWorld &c_world)=0
virtual bool IsCollidingWithSomething() const
Returns true if this model is colliding with another model.
virtual ~CDynamics3DModel()
std::vector< std::shared_ptr< CAbstractBody > > m_vecBodies
virtual void UpdateFromEntityStatus()
Updates the state of this model from the status of the associated entity.
std::vector< std::shared_ptr< CAbstractBody > > & GetBodies()
CComposableEntity & GetComposableEntity()
const CComposableEntity & GetComposableEntity() const
virtual void UpdateEntityStatus()
Updates the status of the associated entity.
std::map< std::string, CDynamics3DModel * > TMap
virtual void RemoveFromWorld(btMultiBodyDynamicsWorld &c_world)=0
CDynamics3DEngine & GetEngine()
CDynamics3DModel(CDynamics3DEngine &c_engine, CComposableEntity &c_entity)
virtual void ApplyTorque(const btVector3 &c_torque)=0
btCollisionShape & GetShape()
virtual void RemoveFromWorld(btMultiBodyDynamicsWorld &c_world)=0
CDynamics3DModel & m_cModel
virtual btTransform & GetTransform()=0
std::vector< std::shared_ptr< CAbstractBody > >::iterator TVectorIterator
CDynamics3DModel & GetModel()
std::shared_ptr< btCollisionShape > m_ptrShape
std::vector< std::shared_ptr< CAbstractBody > > TVector
virtual void ApplyForce(const btVector3 &c_force, const btVector3 &c_offset)=0
CAbstractBody(CDynamics3DModel &c_model, SAnchor *ps_anchor, const std::shared_ptr< btCollisionShape > &ptr_shape, const SData &s_data)
virtual void ApplyForce(const btVector3 &c_force)=0
virtual void AddToWorld(btMultiBodyDynamicsWorld &c_world)=0
const SData & GetData() const
btTransform CenterOfMassOffset
btTransform InverseStartTransform
btTransform InverseCenterOfMassOffset
SData(const btTransform &c_start_transform, const btTransform &c_center_of_mass_offset, const btVector3 &c_inertia, btScalar f_mass, btScalar f_friction, const std::vector< SDipole > &vec_dipoles=std::vector< SDipole >())
std::vector< SDipole > Dipoles
btTransform StartTransform
SDipole(const std::function< btVector3()> &fn_get_field, const btTransform &c_offset)
std::function< btVector3()> GetField