fixed -1 offset in TerrainGrid

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7835 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
bre..ns 2011-07-07 05:41:27 +00:00
parent 1a08b7b0f6
commit 4eeab63f9f

View 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));
}