From 6a21fb236977ed2f83e440acba61e56d0eb6a1c6 Mon Sep 17 00:00:00 2001 From: Peter Schaefer Date: Mon, 11 May 2015 21:20:53 +0200 Subject: [PATCH] removed BBoxTree --- Weave/BBoxTree.cpp | 0 Weave/BBoxTree.h | 0 Weave/Graphix/Model/IMesh.cpp | 10 ++++++++++ Weave/Graphix/Model/IMesh.h | 22 ++++++++++++++++++++++ Weave/Graphix/Model/Model.cpp | 8 ++++++++ Weave/Graphix/Model/Model.h | 11 +++++++++++ Weave/Weave.vcxproj | 2 -- Weave/Weave.vcxproj.filters | 6 ------ 8 files changed, 51 insertions(+), 8 deletions(-) delete mode 100644 Weave/BBoxTree.cpp delete mode 100644 Weave/BBoxTree.h diff --git a/Weave/BBoxTree.cpp b/Weave/BBoxTree.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Weave/BBoxTree.h b/Weave/BBoxTree.h deleted file mode 100644 index e69de29..0000000 diff --git a/Weave/Graphix/Model/IMesh.cpp b/Weave/Graphix/Model/IMesh.cpp index 6445c77..f89a1a6 100644 --- a/Weave/Graphix/Model/IMesh.cpp +++ b/Weave/Graphix/Model/IMesh.cpp @@ -192,3 +192,13 @@ IMesh::operator string() const { return "IMesh"; } + + +IMesh::Node::Node() +{ +} + +IMesh::Node::~Node() +{ +} + diff --git a/Weave/Graphix/Model/IMesh.h b/Weave/Graphix/Model/IMesh.h index d04f166..7ba1d95 100644 --- a/Weave/Graphix/Model/IMesh.h +++ b/Weave/Graphix/Model/IMesh.h @@ -42,4 +42,26 @@ protected: bool import(const std::string& modelpath, uint& numvertices, uint& numfaces, float*& vertex, float*& uvs, float*& normals, uint*& index , uint mindex = 0) const; bool import(const aiMesh* mesh, uint& numvertices, uint& numfaces, float*& vertex, float*& uvs, float*& normals, uint*& index) const; + class Node; + + Node* root; + + class Node + { + public: + Node(); + ~Node(); + + private: + vec3 center; + vec3 size_2; + + Node *lNode, *hNode; + Model::Triangle *element; + + int splitDim; + int splitCenter; + + }; + }; \ No newline at end of file diff --git a/Weave/Graphix/Model/Model.cpp b/Weave/Graphix/Model/Model.cpp index 412bbc0..89e5088 100644 --- a/Weave/Graphix/Model/Model.cpp +++ b/Weave/Graphix/Model/Model.cpp @@ -516,3 +516,11 @@ Model* Model::BoundingBox = nullptr; Model* Model::SkyBoxModel = nullptr; std::unordered_map Model::IMetaModel; std::unordered_map Model::IMetaModel_count; + +Model::Triangle::Triangle(const mat3& _vertex, const vec3& _normal) : vertex(_vertex), normal(normalize(_normal)) +{ +} + +Model::Triangle::~Triangle() +{ +} \ No newline at end of file diff --git a/Weave/Graphix/Model/Model.h b/Weave/Graphix/Model/Model.h index b7f2cdc..e8ca858 100644 --- a/Weave/Graphix/Model/Model.h +++ b/Weave/Graphix/Model/Model.h @@ -35,6 +35,7 @@ public: /* test self against other*/ + class Triangle; virtual Overlap checkColS2O(const mat4& mMat, const Model* model, const mat4& modelMat) const; virtual Overlap checkColO2SBox(const mat4& mMat, const vec3& pos, const vec3& size, const mat4& modelMat) const; virtual Overlap checkColO2STriangle(const mat4& mMat, const vec3& pos, const mat3& directions) const; @@ -51,6 +52,16 @@ public: virtual operator std::string() const = 0; + class Triangle + { + public: + Triangle(const mat3& vertex, const vec3& normal); + ~Triangle(); + + const mat3 vertex; + const vec3 normal; + + }; protected: Model(); virtual ~Model(); diff --git a/Weave/Weave.vcxproj b/Weave/Weave.vcxproj index be339e2..43bd48f 100644 --- a/Weave/Weave.vcxproj +++ b/Weave/Weave.vcxproj @@ -92,7 +92,6 @@ - @@ -117,7 +116,6 @@ - diff --git a/Weave/Weave.vcxproj.filters b/Weave/Weave.vcxproj.filters index db09c28..b03e930 100644 --- a/Weave/Weave.vcxproj.filters +++ b/Weave/Weave.vcxproj.filters @@ -75,9 +75,6 @@ Source Files - - Source Files - Source Files @@ -149,9 +146,6 @@ Header Files - - Header Files - Header Files -- 2.47.3