Skip to content

Commit db97b8a

Browse files
committed
terrain : fix #64, level tool not working when the terrain isn't centered at (0,0,0)
1 parent 1ec6241 commit db97b8a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

jme3-terrain-editor/src/com/jme3/gde/terraineditor/tools/LevelTerrainToolAction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public LevelTerrainToolAction(Vector3f markerLocation, float radius, float heigh
6464
this.worldLoc = markerLocation.clone();
6565
this.radius = radius;
6666
this.height = height;
67-
this.levelTerrainLocation = levelTerrainLocation;
67+
this.levelTerrainLocation = levelTerrainLocation.clone();
6868
this.precision = precision;
6969
this.mesh = mesh;
7070
name = "Level terrain";
@@ -77,6 +77,7 @@ protected Object doApplyTool(AbstractSceneExplorerNode rootNode) {
7777
return null;
7878
Node terrainNode = getTerrainNode(rootNode.getLookup().lookup(Node.class));
7979
worldLoc.subtractLocal(terrainNode.getWorldTranslation());
80+
levelTerrainLocation.subtractLocal(terrainNode.getWorldTranslation());
8081
modifyHeight(terrain, levelTerrainLocation, worldLoc, radius, height, precision, mesh);
8182
return terrain;
8283
}

0 commit comments

Comments
 (0)