dynamics3d_shape_manager.h
Go to the documentation of this file.
1 
8 #ifndef DYNAMICS3D_SHAPE_MANAGER_H
9 #define DYNAMICS3D_SHAPE_MANAGER_H
10 
11 namespace argos {
12  class CDynamics3DShapeManager;
13 }
14 
15 #ifdef __APPLE__
16 #pragma clang diagnostic push
17 #pragma clang diagnostic ignored "-Wreorder"
18 #else
19 #pragma GCC diagnostic push
20 #pragma GCC diagnostic ignored "-Wreorder"
21 #endif
22 
23 #include <argos3/plugins/simulator/physics_engines/dynamics3d/bullet/BulletCollision/CollisionShapes/btBoxShape.h>
24 #include <argos3/plugins/simulator/physics_engines/dynamics3d/bullet/BulletCollision/CollisionShapes/btConvexHullShape.h>
25 #include <argos3/plugins/simulator/physics_engines/dynamics3d/bullet/BulletCollision/CollisionShapes/btCylinderShape.h>
26 #include <argos3/plugins/simulator/physics_engines/dynamics3d/bullet/BulletCollision/CollisionShapes/btSphereShape.h>
27 
28 #ifdef __APPLE__
29 #pragma clang diagnostic pop
30 #else
31 #pragma GCC diagnostic pop
32 #endif
33 
34 #include <vector>
35 #include <memory>
36 
37 namespace argos {
38 
40 
41  public:
42 
43  static std::shared_ptr<btCollisionShape>
44  RequestBox(const btVector3& c_half_extents);
45 
46  static std::shared_ptr<btCollisionShape>
47  RequestCylinder(const btVector3& c_half_extents);
48 
49  static std::shared_ptr<btCollisionShape>
50  RequestSphere(btScalar f_radius);
51 
52  static std::shared_ptr<btCollisionShape>
53  RequestConvexHull(const std::vector<btVector3>& vec_points);
54 
55  private:
56 
57  /* boxes */
58  struct SBoxResource {
59  SBoxResource(const btVector3& c_half_extents);
60  btVector3 HalfExtents;
61  std::shared_ptr<btBoxShape> Shape;
62  };
63  static std::vector<SBoxResource> m_vecBoxResources;
64 
65  /* cylinders */
66  struct SCylinderResource {
67  SCylinderResource(const btVector3& c_half_extents);
68  btVector3 HalfExtents;
69  std::shared_ptr<btCylinderShape> Shape;
70  };
71  static std::vector<SCylinderResource> m_vecCylinderResources;
72 
73  /* spheres */
74  struct SSphereResource {
75  SSphereResource(btScalar f_radius);
76  btScalar Radius;
77  std::shared_ptr<btSphereShape> Shape;
78  };
79  static std::vector<SSphereResource> m_vecSphereResources;
80 
81  /* convex hulls */
82  struct SConvexHullResource {
83  SConvexHullResource(const std::vector<btVector3>& vec_points);
84  std::vector<btVector3> Points;
85  std::shared_ptr<btConvexHullShape> Shape;
86  };
87  static std::vector<SConvexHullResource> m_vecConvexHullResources;
88  };
89 
90 }
91 
92 #endif
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
static std::shared_ptr< btCollisionShape > RequestBox(const btVector3 &c_half_extents)
static std::shared_ptr< btCollisionShape > RequestSphere(btScalar f_radius)
static std::shared_ptr< btCollisionShape > RequestConvexHull(const std::vector< btVector3 > &vec_points)
static std::shared_ptr< btCollisionShape > RequestCylinder(const btVector3 &c_half_extents)