check X Y Z for max value
parent
cd72e7b701
commit
027d8749a1
|
@ -90,7 +90,8 @@ namespace Flocking
|
|||
for( int y = 0; y < regionY; y++ ) {
|
||||
int zMax = Convert.ToInt32(m_scene.GetGroundHeight( x, y ));
|
||||
for( int z = 1; z < zMax; z++ ) {
|
||||
m_flowMap[x,y,z] = 100f;
|
||||
if (x < regionX && y < regionY && z < zMax)
|
||||
m_flowMap[x,y,z] = 100f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -99,8 +100,10 @@ namespace Flocking
|
|||
foreach( EntityBase entity in m_scene.GetEntities() ) {
|
||||
if( entity is SceneObjectGroup ) {
|
||||
SceneObjectGroup sog = (SceneObjectGroup)entity;
|
||||
|
||||
//todo: ignore phantom
|
||||
|
||||
if (sog.IsPhantom)
|
||||
continue;
|
||||
|
||||
float fmaxX, fminX, fmaxY, fminY, fmaxZ, fminZ;
|
||||
int maxX, minX, maxY, minY, maxZ, minZ;
|
||||
sog.GetAxisAlignedBoundingBoxRaw( out fminX, out fmaxX, out fminY, out fmaxY, out fminZ, out fmaxZ );
|
||||
|
@ -115,7 +118,8 @@ namespace Flocking
|
|||
for( int x = minX; x < maxX; x++ ) {
|
||||
for( int y = minY; y < maxY; y++ ) {
|
||||
for( int z = minZ; z < maxZ; z++ ) {
|
||||
m_flowMap[x,y,z] = 100f;
|
||||
if(x < maxX && y < maxY && z < maxX)
|
||||
m_flowMap[x,y,z] = 100f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue