void Terrain::Filter3x3() { float** filteredHeightMap = new float*[width]; for (int i = 0; i < width; i++) { filteredHeightMap[i] = new float[height]; } for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { filteredHeightMap[x][y] = SampleHeight(x, y); } } for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { heightMap[x][y] = filteredHeightMap[x][y]; } } for (int i = 0; i < width; i++) { delete[] filteredHeightMap[i]; } delete[] filteredHeightMap; }
void cGround::SampleHeightVel(const tVector& pos, double& out_h, tVector& out_vel, bool& out_valid_sample) const { out_h = SampleHeight(pos, out_valid_sample); out_vel.setZero(); }
double cGround::SampleHeight(const tVector& pos) const { bool dummy_valid = true; return SampleHeight(pos, dummy_valid); }