Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/collisionmesh.h')
-rw-r--r--src/model/collisionmesh.h31
1 files changed, 19 insertions, 12 deletions
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<std::string, CollisionMesh *> Registry;
+ /// type definition for the collisionmesh registry
+ typedef std::list<CollisionMesh *> 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