added get{Width,Depth,Height}() methods to WFObj

This commit is contained in:
Josh Holtrop 2010-11-24 15:42:38 -05:00
parent 993d09cccb
commit cdfc27bfbb
2 changed files with 7 additions and 0 deletions

View File

@ -396,6 +396,9 @@ void WFObj::updateAABB(const float * const vertex)
m_aabb[2] = m_aabb[5] = vertex[2]; m_aabb[2] = m_aabb[5] = vertex[2];
m_loadedVertex = true; 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<string> & parts) WFObj::Vertex WFObj::readVertex(const vector<string> & parts)

View File

@ -56,6 +56,9 @@ public:
GLuint render(bool doTextureInfo = true, GLuint render(bool doTextureInfo = true,
bool enableBlending = false); bool enableBlending = false);
const float * const getAABB() { return m_aabb; } const float * const getAABB() { return m_aabb; }
int getWidth() { return m_width; }
int getDepth() { return m_depth; }
int getHeight() { return m_height; }
protected: protected:
/* types */ /* types */
@ -83,6 +86,7 @@ protected:
std::vector< std::vector<std::string> > m_data; std::vector< std::vector<std::string> > m_data;
FileLoader::Path m_path; FileLoader::Path m_path;
float m_aabb[6]; float m_aabb[6];
int m_width, m_depth, m_height;
bool m_loadedVertex; bool m_loadedVertex;
FileLoader * m_fileLoader; FileLoader * m_fileLoader;
TextureLoader * m_textureLoader; TextureLoader * m_textureLoader;