fixed the terrain normal calc for the edges

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9584 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
bre..ns 2012-07-25 13:34:31 +00:00
parent b59ec271ca
commit f5cd1e97c4

View File

@ -1066,8 +1066,8 @@ public class TerrainQuad extends Node implements Terrain {
public Vector3f getNormal(Vector2f xz) {
// offset
float x = (float)(((xz.x - getWorldTranslation().x) / getWorldScale().x) + (float)totalSize / 2f);
float z = (float)(((xz.y - getWorldTranslation().z) / getWorldScale().z) + (float)totalSize / 2f);
float x = (float)(((xz.x - getWorldTranslation().x) / getWorldScale().x) + (float)(totalSize-1) / 2f);
float z = (float)(((xz.y - getWorldTranslation().z) / getWorldScale().z) + (float)(totalSize-1) / 2f);
Vector3f normal = getNormal(x, z, xz);
return normal;