9 #include <argos3/plugins/simulator/entities/cylinder_entity.h>
10 #include <argos3/plugins/simulator/physics_engines/dynamics3d/dynamics3d_engine.h>
11 #include <argos3/plugins/simulator/physics_engines/dynamics3d/dynamics3d_single_body_object_model.h>
12 #include <argos3/plugins/simulator/physics_engines/dynamics3d/dynamics3d_shape_manager.h>
24 const std::shared_ptr<btCollisionShape>& ptrShape =
34 const btTransform& cStartTransform = btTransform(
35 btQuaternion(cOrientation.
GetX(),
39 btVector3(cPosition.
GetX(),
43 const btTransform& cCenterOfMassOffset = btTransform(
44 btQuaternion(0.0f, 0.0f, 0.0f, 1.0f),
45 btVector3(0.0f, -c_cylinder.
GetHeight() * 0.5f, 0.0f));
48 btVector3 cInertia(0.0f, 0.0f, 0.0f);
52 ptrShape->calculateLocalInertia(fMass, cInertia);
57 CBody::SData sData(cStartTransform, cCenterOfMassOffset, cInertia, fMass, fFriction);
59 m_ptrBody = std::make_shared<CBody>(*
this, &sAnchor, ptrShape, sData);
float Real
Collects all ARGoS code.
The namespace containing all the ARGoS related code.
REGISTER_STANDARD_DYNAMICS3D_OPERATIONS_ON_ENTITY(CEPuckEntity, CDynamics3DEPuckModel)
bool IsMovable() const
Returns true if the entity is movable.
const SAnchor & GetOriginAnchor() const
Returns a const reference to the origin anchor associated to this entity.
An anchor related to the body of an entity.
CQuaternion Orientation
The orientation of the anchor wrt the global coordinate system.
CVector3 Position
The position of the anchor wrt the global coordinate system.
Real GetX() const
Returns the x coordinate of this vector.
Real GetY() const
Returns the y coordinate of this vector.
Real GetZ() const
Returns the z coordinate of this vector.
CEmbodiedEntity & GetEmbodiedEntity()
CDynamics3DCylinderModel(CDynamics3DEngine &c_engine, CCylinderEntity &c_cylinder)
btScalar GetDefaultFriction() const
std::vector< std::shared_ptr< CAbstractBody > > m_vecBodies
CDynamics3DEngine & GetEngine()
static std::shared_ptr< btCollisionShape > RequestCylinder(const btVector3 &c_half_extents)