have to start with refactoring meshes, shapes, scenes and worlds

beta.r3js.org
Theunis J. Botha 2016-11-15 17:12:27 +01:00
parent 758bfe0a2b
commit e7144a513c
1 changed files with 21 additions and 1 deletions

View File

@ -34,7 +34,8 @@ GameLib.D3.Scene = function(
entities,
progressCallback,
uploadUrl,
components
components,
shapes
) {
this.id = id;
this.sceneId = GameLib.D3.Tools.RandomId();
@ -105,6 +106,11 @@ GameLib.D3.Scene = function(
}
this.components = components;
if (typeof shapes == 'undefined') {
shapes = [];
}
this.components = shapes;
// assoc array
this.meshIdToMesh = {};
@ -710,10 +716,24 @@ GameLib.D3.Scene.LoadScene = function(
meshes: instanceMeshes
}
);
});
};
GameLib.D3.Scene.prototype.intitializeComponents = function() {
for (var c = 0; c < this.components.length; c++) {
var component = this.components[c];
this.scene3d.registerComponent(component);
if(component.setParentEntity && typeof component.setParentEntity == 'function') {
component.setParentEntity(this.parentScene, this);
}
}
};
GameLib.D3.Scene.FromAPIScene = function(
apiScene,
graphics,