fixed -1 offset in TerrainGrid

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7835 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
bre..ns 14 years ago
parent 1a08b7b0f6
commit 4eeab63f9f
  1. 2
      engine/src/terrain/com/jme3/terrain/geomipmap/TerrainGrid.java

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

Loading…
Cancel
Save