made components compatible with editor

beta.r3js.org
Theunis J. Botha 2016-11-10 14:12:41 +01:00
parent 517d75d3c2
commit 613474ba44
1 changed files with 19 additions and 1 deletions

View File

@ -15,6 +15,7 @@
* @param entities GameLib.D3.Entity[] * @param entities GameLib.D3.Entity[]
* @param progressCallback * @param progressCallback
* @param uploadUrl String * @param uploadUrl String
* @param components
* @constructor * @constructor
*/ */
GameLib.D3.Scene = function( GameLib.D3.Scene = function(
@ -32,7 +33,8 @@ GameLib.D3.Scene = function(
worlds, worlds,
entities, entities,
progressCallback, progressCallback,
uploadUrl uploadUrl,
components
) { ) {
this.id = id; this.id = id;
this.sceneId = GameLib.D3.Tools.RandomId(); this.sceneId = GameLib.D3.Tools.RandomId();
@ -98,6 +100,11 @@ GameLib.D3.Scene = function(
this.instance = this.createInstance(); this.instance = this.createInstance();
if (typeof components == 'undefined') {
components = [];
}
this.components = components;
// assoc array // assoc array
this.meshIdToMesh = {}; this.meshIdToMesh = {};
@ -112,6 +119,17 @@ GameLib.D3.Scene = function(
this.notifications = []; 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 * Notification objects manage the links between image filenames, instance texture
* map IDs, and instance materials. * map IDs, and instance materials.