3 #include <btBulletCollisionCommon.h>
6 #include <OgreVector3.h>
7 #include <OgreQuaternion.h>
15 class StorageContainer;
31 using Ptr = std::shared_ptr<CollisionShape>;
68 static std::unique_ptr<CollisionShape>
93 virtual btCollisionShape*
125 #define SHAPE_CLASS(cls, type, bulletShapeClass) \
131 static const ShapeType SHAPE_TYPE = type; \
133 static std::unique_ptr<cls> \
135 const StorageContainer& storage \
138 static luabind::scope \
142 bulletShape() const override { \
143 return m_bulletShape.get(); \
147 shapeType() const override { \
152 storage() const override; \
156 std::unique_ptr<bulletShapeClass> m_bulletShape;
179 const
Ogre::Vector3& extents
184 const
Ogre::Vector3 m_extents;
213 CollisionShape::
Axis axis,
220 const CollisionShape::
Axis m_axis;
222 const btScalar m_height;
224 const btScalar m_radius;
259 const
Ogre::Vector3& translation,
260 const
Ogre::Quaternion& rotation,
261 CollisionShape::
Ptr shape
278 const CollisionShape::
Ptr& shape
284 Ogre::Vector3 translation;
285 Ogre::Quaternion rotation;
289 std::vector<ChildShape> m_childShapes;
318 CollisionShape::
Axis axis,
325 const CollisionShape::
Axis m_axis;
327 const btScalar m_height;
329 const btScalar m_radius;
358 CollisionShape::
Axis axis,
366 const CollisionShape::
Axis m_axis;
368 const btScalar m_height;
370 const btScalar m_radius;
423 const btScalar m_radius;
virtual ShapeType shapeType() const =0
The shape's type.
virtual btCollisionShape * bulletShape() const =0
Returns a pointer to the internal Bullet shape object.
virtual StorageContainer storage() const =0
Serializes the shape into a storage container.
Definition: collision_shape.cpp:57
static luabind::scope luaBindings()
Lua bindings.
Definition: collision_shape.cpp:41
ShapeType
Enumeration for the currently supported shape types.
Definition: collision_shape.h:49
A simple box shape.
Definition: collision_shape.h:166
Wrapper for Bullet's collision shapes.
Definition: collision_shape.h:24
Definition: bullet_to_ogre_system.h:5
Definition: bullet_ogre_conversion.h:6
A cylinder shape.
Definition: collision_shape.h:341
virtual ~CollisionShape()=0
Destructor.
Definition: collision_shape.cpp:53
Definition: debug_drawing.h:8
A shape compounded of multiple other shapes.
Definition: collision_shape.h:236
An empty shape.
Definition: collision_shape.h:384
A sphere shape.
Definition: collision_shape.h:405
Axis
Enumeration for the 3 axes.
Definition: collision_shape.h:38
A cone shape.
Definition: collision_shape.h:301
static std::unique_ptr< CollisionShape > load(const StorageContainer &storage)
Loads a shape from a storage container.
Definition: collision_shape.cpp:20
A capsule shape. Think cylinder with rounded caps.
Definition: collision_shape.h:196
A key-value storage for serialization.
Definition: serialization.h:36
std::shared_ptr< CollisionShape > Ptr
Convenience typedef.
Definition: collision_shape.h:31