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;
 }
示例#2
0
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();
}
示例#3
0
double cGround::SampleHeight(const tVector& pos) const
{
	bool dummy_valid = true;
	return SampleHeight(pos, dummy_valid);
}