Fix to TerrainGrid: only clone the grid's material to child quad if it doesn't have a material of its own

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8970 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
sky..om 13 years ago
parent 1f2193a2b9
commit baba9d6b47
  1. 3
      engine/src/terrain/com/jme3/terrain/geomipmap/TerrainGrid.java

@ -147,7 +147,8 @@ public class TerrainGrid extends TerrainQuad {
log.log(Level.FINE, "Loaded TerrainQuad {0} from HeightMapGrid", q.getName()); log.log(Level.FINE, "Loaded TerrainQuad {0} from HeightMapGrid", q.getName());
} else if (gridTileLoader != null) { } else if (gridTileLoader != null) {
q = gridTileLoader.getTerrainQuadAt(quadCell); q = gridTileLoader.getTerrainQuadAt(quadCell);
q.setMaterial(material.clone()); // only clone the material to the quad if it doesn't have a material of its own
if(q.getMaterial()==null) q.setMaterial(material.clone());
log.log(Level.FINE, "Loaded TerrainQuad {0} from TerrainQuadGrid", q.getName()); log.log(Level.FINE, "Loaded TerrainQuad {0} from TerrainQuadGrid", q.getName());
} }
} }

Loading…
Cancel
Save