replace float to double

master
Christopher 2020-08-06 04:47:51 +02:00
parent 027d8749a1
commit 0ff367ef6a
1 changed files with 11 additions and 11 deletions

View File

@ -35,7 +35,7 @@ namespace Flocking
public class FlowMap public class FlowMap
{ {
private Scene m_scene; private Scene m_scene;
private float[, ,] m_flowMap; private double[, ,] m_flowMap;
private uint regionX; private uint regionX;
private uint regionY; private uint regionY;
private uint regionZ; private uint regionZ;
@ -48,7 +48,7 @@ namespace Flocking
regionY = m_scene.RegionInfo.RegionSizeY; regionY = m_scene.RegionInfo.RegionSizeY;
regionZ = (uint)maxHeight; regionZ = (uint)maxHeight;
regionBorder = borderSize; regionBorder = borderSize;
m_flowMap = new float[regionX, regionY, regionZ]; m_flowMap = new double[regionX, regionY, regionZ];
} }
public int LengthX { public int LengthX {
@ -68,20 +68,20 @@ namespace Flocking
//fill in the boundaries //fill in the boundaries
for( int x = 0; x < regionX; x++ ) { for( int x = 0; x < regionX; x++ ) {
for( int y = 0; y < regionY; y++ ) { for( int y = 0; y < regionY; y++ ) {
m_flowMap[x,y,0] = 100f; m_flowMap[x,y,0] = 100;
m_flowMap[x,y, regionZ-1] = 100f; m_flowMap[x,y, regionZ-1] = 100;
} }
} }
for( int x = 0; x < regionX; x++ ) { for( int x = 0; x < regionX; x++ ) {
for( int z = 0; z < regionZ; z++ ) { for( int z = 0; z < regionZ; z++ ) {
m_flowMap[x,0,z] = 100f; m_flowMap[x,0,z] = 100;
m_flowMap[x,regionY-1,z] = 100f; m_flowMap[x,regionY-1,z] = 100;
} }
} }
for( int y = 0; y < regionY; y++ ) { for( int y = 0; y < regionY; y++ ) {
for( int z = 0; z < regionZ; z++ ) { for( int z = 0; z < regionZ; z++ ) {
m_flowMap[0,y,z] = 100f; m_flowMap[0,y,z] = 100;
m_flowMap[regionX-1,y,z] = 100f; m_flowMap[regionX-1,y,z] = 100;
} }
} }
@ -91,7 +91,7 @@ namespace Flocking
int zMax = Convert.ToInt32(m_scene.GetGroundHeight( x, y )); int zMax = Convert.ToInt32(m_scene.GetGroundHeight( x, y ));
for( int z = 1; z < zMax; z++ ) { for( int z = 1; z < zMax; z++ ) {
if (x < regionX && y < regionY && z < zMax) if (x < regionX && y < regionY && z < zMax)
m_flowMap[x,y,z] = 100f; m_flowMap[x,y,z] = 100;
} }
} }
} }
@ -119,7 +119,7 @@ namespace Flocking
for( int y = minY; y < maxY; y++ ) { for( int y = minY; y < maxY; y++ ) {
for( int z = minZ; z < maxZ; z++ ) { for( int z = minZ; z < maxZ; z++ ) {
if(x < maxX && y < maxY && z < maxX) if(x < maxX && y < maxY && z < maxX)
m_flowMap[x,y,z] = 100f; m_flowMap[x,y,z] = 100;
} }
} }
} }
@ -193,7 +193,7 @@ namespace Flocking
else if (x < 0 || y < 0 || z < 0) else if (x < 0 || y < 0 || z < 0)
{ {
retVal = true; retVal = true;
} else if (m_flowMap[x,y,z] > 50f) { } else if (m_flowMap[x,y,z] > 50) {
retVal = true; retVal = true;
} }
return retVal; return retVal;