From 1687737ca713cd0baeca3cf79950ef4877640c99 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Thu, 5 May 2011 18:08:45 +0000 Subject: Initial support for btCompoundShape and the infrastructure required to accomodate multiple meshes per collision model, added prototype files for signals --- src/model/collisionmesh.h | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'src/model/collisionmesh.h') diff --git a/src/model/collisionmesh.h b/src/model/collisionmesh.h index 9efd21a..cbd063a 100644 --- a/src/model/collisionmesh.h +++ b/src/model/collisionmesh.h @@ -8,6 +8,7 @@ #define __INCLUDED_MODEL_COLLISIONMESH_H__ #include "math/mathlib.h" +#include "model/fragment.h" #include "BulletCollision/CollisionShapes/btTriangleMesh.h" @@ -17,23 +18,23 @@ namespace model { +/** + * @brief a collection of triangles, representing the collision geometry of a model + * A CollisionModel consists of a number of collisionmeshes. + * */ class CollisionMesh { public: - /// type definition for the material registry - typedef std::map Registry; + /// type definition for the collisionmesh registry + typedef std::list Registry; - CollisionMesh(const std::string &name); + CollisionMesh(); ~CollisionMesh(); /* ---- inspectors ----------------------------------------- */ - inline const std::string &name() const { - return collisionmesh_name; - } - /** * @brief the number of triangles in the collision mesh */ @@ -41,10 +42,6 @@ public: return collisionmesh_size; } - static bool initialized() { - return collisionmesh_initialized; - } - /** * @brief the bullet triangle mesh object */ @@ -53,6 +50,11 @@ public: } /* ---- mutators ------------------------------------------- */ + + /** + * @brief change the group type + * */ + void set_type(const FragmentGroup::Type type); /** * @brief add a triangle to the collision mesh @@ -86,15 +88,20 @@ public: */ static void add(CollisionMesh *collisionmesh); + + static bool initialized() { + return collisionmesh_initialized; + } + private: /// the materials registry static Registry collisionmesh_registry; static bool collisionmesh_initialized; - std::string collisionmesh_name; size_t collisionmesh_size; btTriangleMesh *collisionmesh_triangles; + FragmentGroup::Type collisionmesh_type; }; } // namespace model -- cgit v1.2.3