OSDN Git Service

fixed -1 offset in TerrainGrid
authorbrentowens <brentowens@75d07b2b-3a1a-0410-a2c5-0572b91ccdca>
Thu, 7 Jul 2011 05:41:27 +0000 (05:41 +0000)
committerbrentowens <brentowens@75d07b2b-3a1a-0410-a2c5-0572b91ccdca>
Thu, 7 Jul 2011 05:41:27 +0000 (05:41 +0000)
git-svn-id: http://jmonkeyengine.googlecode.com/svn/trunk@7835 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

engine/src/terrain/com/jme3/terrain/geomipmap/TerrainGrid.java

index 04e28b7..0a195dd 100644 (file)
@@ -211,7 +211,7 @@ public class TerrainGrid extends TerrainQuad {
     }
 
     public Vector3f getCell(Vector3f location) {
-        final Vector3f v = location.clone().divideLocal(this.getLocalScale().mult(this.quadSize)).add(0.5f, 0, 0.5f);
+        final Vector3f v = location.clone().divideLocal(this.getLocalScale().mult(this.quadSize-1)).add(0.5f, 0, 0.5f);
         return new Vector3f(FastMath.floor(v.x), 0, FastMath.floor(v.z));
     }