From d28b58064050d0a6af37b4cc30c6c2a0b46d36ad Mon Sep 17 00:00:00 2001 From: "bre..ns" Date: Mon, 16 Jan 2012 17:17:05 +0000 Subject: [PATCH] fixed bug in terrainQuad, uses worldTranslation for coordinate offset now for height adjustment git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9079 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../terrain/com/jme3/terrain/geomipmap/TerrainQuad.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainQuad.java b/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainQuad.java index 4471cafc9..567edde02 100644 --- a/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainQuad.java +++ b/engine/src/terrain/com/jme3/terrain/geomipmap/TerrainQuad.java @@ -1092,8 +1092,8 @@ public class TerrainQuad extends Node implements Terrain { public float getHeight(Vector2f xz) { // offset - float x = (float)(((xz.x - getLocalTranslation().x) / getWorldScale().x) + (float)totalSize / 2f); - float z = (float)(((xz.y - getLocalTranslation().z) / getWorldScale().z) + (float)totalSize / 2f); + 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 height = getHeight(x, z); height *= getWorldScale().y; return height; @@ -1132,8 +1132,8 @@ public class TerrainQuad extends Node implements Terrain { public Vector3f getNormal(Vector2f xz) { // offset - float x = (float)(((xz.x - getLocalTranslation().x) / getWorldScale().x) + (float)totalSize / 2f); - float z = (float)(((xz.y - getLocalTranslation().z) / getWorldScale().z) + (float)totalSize / 2f); + float x = (float)(((xz.x - getWorldTranslation().x) / getWorldScale().x) + (float)totalSize / 2f); + float z = (float)(((xz.y - getWorldTranslation().z) / getWorldScale().z) + (float)totalSize / 2f); Vector3f normal = getNormal(x, z, xz); return normal;