diff --git a/source/terrain/Patch.cpp b/source/terrain/Patch.cpp index bca87a03b2..0f12d710fe 100755 --- a/source/terrain/Patch.cpp +++ b/source/terrain/Patch.cpp @@ -27,27 +27,13 @@ void CPatch::Initialize (STerrainVertex *first_vertex) { m_pVertices = first_vertex; - m_Bounds.m_BoxMin.X = m_pVertices[0].m_Position.X; - m_Bounds.m_BoxMin.Z = m_pVertices[0].m_Position.Z; - - m_Bounds.m_BoxMax.X = m_Bounds.m_BoxMin.X + PATCH_SIZE*CELL_SIZE; - m_Bounds.m_BoxMax.Z = m_Bounds.m_BoxMin.Z + PATCH_SIZE*CELL_SIZE; + m_Bounds.SetEmpty(); - m_Bounds.m_BoxMin.Y = m_Bounds.m_BoxMin.Y = m_pVertices[0].m_Position.Y; - - int j; - - for (j=0; j m_Bounds.m_BoxMax.Y) - m_Bounds.m_BoxMax.Y = m_pVertices[pos].m_Position.Y; + m_Bounds+=m_pVertices[j*MAP_SIZE + i].m_Position; } } diff --git a/source/terrain/Patch.h b/source/terrain/Patch.h index 6f604414d4..c7418b4d74 100755 --- a/source/terrain/Patch.h +++ b/source/terrain/Patch.h @@ -12,8 +12,7 @@ #ifndef PATCH_H #define PATCH_H -#include "Matrix3D.h" -#include "Camera.h" +#include "Bound.h" #include "TerrGlobals.h" #include "MiniPatch.h" @@ -29,7 +28,7 @@ class CPatch // protected: CMiniPatch m_MiniPatches[16][16]; - SBoundingBox m_Bounds; + CBound m_Bounds; unsigned int m_LastVisFrame; STerrainVertex *m_pVertices;