From ebe064bf159a5c6e90f2bbe902efa16c6e654ff8 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Fri, 6 May 2011 16:32:55 +0000 Subject: Always use a btCompoundShape for complex collision, added infrastructure for collision mesh animation, minor API documentation updates --- src/core/entity.h | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'src/core/entity.h') diff --git a/src/core/entity.h b/src/core/entity.h index a356525..230ce1b 100644 --- a/src/core/entity.h +++ b/src/core/entity.h @@ -167,8 +167,17 @@ public: } /// physics collision shape - inline CollisionShapes collision_shapes() { - return entity_collision_shapes; + inline btCollisionShape *collision_shape() { + return entity_collision_shape; + } + + /** + * @brief physics collision child shapes + * if the collision_shape is not a btcompoundShape, + * this set will be empty + **/ + inline CollisionShapes & collision_child_shapes() { + return entity_collision_child_shapes; } /// indicates a server-side entity @@ -196,11 +205,6 @@ public: return entity_menus; } - /// entity collision shapes - inline CollisionShapes & shapes() { - return entity_collision_shapes; - } - /// extensions inline Extension *extension(size_t type) const { return entity_extension[type]; @@ -453,7 +457,12 @@ public: protected: btRigidBody *entity_body; btRigidBody::btRigidBodyConstructionInfo *entity_body_info; - CollisionShapes entity_collision_shapes; + + // the main bullet collision shape for this entity + btCollisionShape *entity_collision_shape; + + // bullet collision child shapes for this entity, + CollisionShapes entity_collision_child_shapes; // the zone the entity belongs to Zone* entity_zone; -- cgit v1.2.3