have to start with refactoring meshes, shapes, scenes and worlds
parent
758bfe0a2b
commit
e7144a513c
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue