diff --git a/src/game-lib-scene.js b/src/game-lib-scene.js index 1662b8b..90cd4be 100644 --- a/src/game-lib-scene.js +++ b/src/game-lib-scene.js @@ -15,6 +15,7 @@ * @param entities GameLib.D3.Entity[] * @param progressCallback * @param uploadUrl String + * @param components * @constructor */ GameLib.D3.Scene = function( @@ -32,7 +33,8 @@ GameLib.D3.Scene = function( worlds, entities, progressCallback, - uploadUrl + uploadUrl, + components ) { this.id = id; this.sceneId = GameLib.D3.Tools.RandomId(); @@ -98,6 +100,11 @@ GameLib.D3.Scene = function( this.instance = this.createInstance(); + if (typeof components == 'undefined') { + components = []; + } + this.components = components; + // assoc array this.meshIdToMesh = {}; @@ -112,6 +119,17 @@ GameLib.D3.Scene = function( this.notifications = []; }; +GameLib.D3.Scene.prototype.createInstance = function() { + + this.graphics.isNotThreeThrow(); + + var instance = new this.graphics.instance.Scene(); + + instance.render = true; + + return instance; +}; + /** * Notification objects manage the links between image filenames, instance texture * map IDs, and instance materials.