|
@@ -151,7 +151,7 @@ class Terrain extends Object3D {
|
|
|
|
|
|
override function makeInstance(ctx:Context):Context {
|
|
override function makeInstance(ctx:Context):Context {
|
|
ctx = ctx.clone(this);
|
|
ctx = ctx.clone(this);
|
|
-
|
|
|
|
|
|
+
|
|
#if editor
|
|
#if editor
|
|
if(cachedInstance != null) {
|
|
if(cachedInstance != null) {
|
|
ctx.local3d.addChild(cachedInstance);
|
|
ctx.local3d.addChild(cachedInstance);
|
|
@@ -166,7 +166,6 @@ class Terrain extends Object3D {
|
|
terrain.cellCount = getCellCount();
|
|
terrain.cellCount = getCellCount();
|
|
terrain.cellSize = getCellSize();
|
|
terrain.cellSize = getCellSize();
|
|
terrain.tileSize = terrain.cellCount * terrain.cellSize;
|
|
terrain.tileSize = terrain.cellCount * terrain.cellSize;
|
|
- terrain.refreshMesh();
|
|
|
|
terrain.heightMapResolution = heightMapResolution;
|
|
terrain.heightMapResolution = heightMapResolution;
|
|
terrain.weightMapResolution = weightMapResolution;
|
|
terrain.weightMapResolution = weightMapResolution;
|
|
terrain.parallaxAmount = parallaxAmount / 10;
|
|
terrain.parallaxAmount = parallaxAmount / 10;
|
|
@@ -175,7 +174,7 @@ class Terrain extends Object3D {
|
|
terrain.heightBlendStrength = heightBlendStrength;
|
|
terrain.heightBlendStrength = heightBlendStrength;
|
|
terrain.heightBlendSharpness = heightBlendSharpness;
|
|
terrain.heightBlendSharpness = heightBlendSharpness;
|
|
terrain.name = "terrain";
|
|
terrain.name = "terrain";
|
|
-
|
|
|
|
|
|
+
|
|
#if editor
|
|
#if editor
|
|
cachedInstance = terrain;
|
|
cachedInstance = terrain;
|
|
#end
|
|
#end
|
|
@@ -187,11 +186,11 @@ class Terrain extends Object3D {
|
|
for(surface in terrain.surfaces)
|
|
for(surface in terrain.surfaces)
|
|
if(surface == null || surface.albedo == null || surface.normal == null || surface.pbr == null )
|
|
if(surface == null || surface.albedo == null || surface.normal == null || surface.pbr == null )
|
|
return;
|
|
return;
|
|
-
|
|
|
|
terrain.generateSurfaceArray();
|
|
terrain.generateSurfaceArray();
|
|
loadTerrain(ctx);
|
|
loadTerrain(ctx);
|
|
- for(tile in terrain.tiles)
|
|
|
|
- tile.blendEdges();
|
|
|
|
|
|
+
|
|
|
|
+ for( t in terrain.tiles)
|
|
|
|
+ t.computeEdgesNormals();
|
|
}
|
|
}
|
|
|
|
|
|
for(surfaceProps in tmpSurfacesProps){
|
|
for(surfaceProps in tmpSurfacesProps){
|