From 28d95608608796091c2cc7a4bee5c617717504d7 Mon Sep 17 00:00:00 2001 From: Peter Schaefer Date: Thu, 23 Apr 2015 20:00:11 +0200 Subject: [PATCH] BBoxen sollten funktioniern --- Weave/Graphix/Model/IMetaMesh.cpp | 21 ++++++++++++--------- Weave/Graphix/Model/IMetaMesh.h | 2 +- Weave/Graphix/Model/Model.h | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Weave/Graphix/Model/IMetaMesh.cpp b/Weave/Graphix/Model/IMetaMesh.cpp index 69d7043..4ec9792 100644 --- a/Weave/Graphix/Model/IMetaMesh.cpp +++ b/Weave/Graphix/Model/IMetaMesh.cpp @@ -76,13 +76,16 @@ void IMetaMesh::drawModel(Shader* _shader, Texture* _texture, const mat4& _model } -//void IMetaMesh::drawBBox(Shader* _shader, const mat4 & _modelMat) const -//{ -// Model::drawBBox(_shader, _modelMat); -// for (auto i = models.begin(); i != models.end(); ++i) -// { -// (*i)->drawBBox(_shader, _modelMat); -// } -// -//} +void IMetaMesh::drawBBox(Shader* _shader, const mat4& _modelMat) const +{ + Model::drawBBox(_shader, _modelMat); + if (models.size() > 1) + { + for (auto i = models.begin(); i != models.end(); ++i) + { + (*i)->drawBBox(_shader, _modelMat); + } + } + +} diff --git a/Weave/Graphix/Model/IMetaMesh.h b/Weave/Graphix/Model/IMetaMesh.h index bc68bb6..0f20711 100644 --- a/Weave/Graphix/Model/IMetaMesh.h +++ b/Weave/Graphix/Model/IMetaMesh.h @@ -22,7 +22,7 @@ public: void drawModel(Shader* shader, Texture* texture, const mat4& modelMat) const; - //void drawBBox(Shader* shader, const mat4 & modelMat) const; + void drawBBox(Shader* shader, const mat4& modelMat) const; protected: std::list models; diff --git a/Weave/Graphix/Model/Model.h b/Weave/Graphix/Model/Model.h index 574a347..ea5645e 100644 --- a/Weave/Graphix/Model/Model.h +++ b/Weave/Graphix/Model/Model.h @@ -21,7 +21,7 @@ public: virtual void drawModel(Shader* shader, Texture* texture, const mat4& modelMat) const; /* Draws a BoundingBox around the Model */ - virtual void drawBBox(Shader* shader,const mat4 & modelMat) const; + virtual void drawBBox(Shader* shader, const mat4& modelMat) const; void getBBmm(vec3& min, vec3& max) const; void getBBsp(vec3& size, vec3& pos) const; -- 2.47.3