Browse Source

initChunk separate

ncannasse 8 years ago
parent
commit
ad209356d5
1 changed files with 9 additions and 5 deletions
  1. 9 5
      h3d/scene/World.hx

+ 9 - 5
h3d/scene/World.hx

@@ -463,15 +463,19 @@ class World extends Object {
 			c.root.visible = c.bounds.inFrustum(ctx.camera.m);
 			if( c.root.visible ) {
 				c.lastFrame = ctx.frame;
-				if( !c.initialized ) {
-					c.initialized = true;
-					initChunkSoil(c);
-					initChunkElements(c);
-				}
+				initChunk(c);
 			}
 		}
 	}
 
+	function initChunk( c : WorldChunk ) {
+		if( !c.initialized ) {
+			c.initialized = true;
+			initChunkSoil(c);
+			initChunkElements(c);
+		}
+	}
+
 	#if hxbit
 	override function customUnserialize(ctx:hxbit.Serializer) {
 		super.customUnserialize(ctx);