From cdfc27bfbbe6f60b5d4983660fcfe0e1b2f04244 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Wed, 24 Nov 2010 15:42:38 -0500 Subject: [PATCH] added get{Width,Depth,Height}() methods to WFObj --- WFObj.cc | 3 +++ WFObj.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/WFObj.cc b/WFObj.cc index 68b0ab6..146c80b 100644 --- a/WFObj.cc +++ b/WFObj.cc @@ -396,6 +396,9 @@ void WFObj::updateAABB(const float * const vertex) m_aabb[2] = m_aabb[5] = vertex[2]; m_loadedVertex = true; } + m_width = m_aabb[3] - m_aabb[0]; + m_depth = m_aabb[4] - m_aabb[1]; + m_height = m_aabb[5] - m_aabb[2]; } WFObj::Vertex WFObj::readVertex(const vector & parts) diff --git a/WFObj.h b/WFObj.h index fd7a5a1..24c973e 100644 --- a/WFObj.h +++ b/WFObj.h @@ -56,6 +56,9 @@ public: GLuint render(bool doTextureInfo = true, bool enableBlending = false); const float * const getAABB() { return m_aabb; } + int getWidth() { return m_width; } + int getDepth() { return m_depth; } + int getHeight() { return m_height; } protected: /* types */ @@ -83,6 +86,7 @@ protected: std::vector< std::vector > m_data; FileLoader::Path m_path; float m_aabb[6]; + int m_width, m_depth, m_height; bool m_loadedVertex; FileLoader * m_fileLoader; TextureLoader * m_textureLoader;