void Terrain::CalcAllPatchBoundsY() { mPatchBoundsY.resize(mNumPatchQuadFaces); // For each patch for(UINT i = 0; i < mNumPatchVertRows-1; ++i) { for(UINT j = 0; j < mNumPatchVertCols-1; ++j) { CalcPatchBoundsY(i, j); } } }
std::vector<float2> Terrain::CalcAllPatchBoundsY() { std::vector<float2> patchBoundsY(m_HeightMap.size() / m_initInfo.CellsPerPatch); for (int j = 0; j < m_initInfo.HeightmapHeight; j++) { for (int i = 0; i < m_initInfo.HeightmapWidth; i += m_initInfo.CellsPerPatch) { const int patch_id = j + (i / m_initInfo.CellsPerPatch); patchBoundsY[patch_id] = CalcPatchBoundsY(patch_id); } } return patchBoundsY; }