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 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.