active camera index
parent
50f04fd988
commit
1a855bbf3d
|
@ -30,7 +30,7 @@ GameLib.D3.Game.prototype.render = function(
|
|||
) {
|
||||
for(var s in this.scenes) {
|
||||
var scene = this.scenes[s];
|
||||
scene.render(dt, renderer, scene.camera);
|
||||
scene.render(dt, renderer, scene.cameras[scene.activeCameraIndex]);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -68,7 +68,9 @@ GameLib.D3.Scene.API = function(
|
|||
worlds,
|
||||
entities,
|
||||
components,
|
||||
shapes
|
||||
shapes,
|
||||
cameras,
|
||||
activeCameraIndex
|
||||
) {
|
||||
if (GameLib.D3.Utils.UndefinedOrNull(id)) {
|
||||
id = GameLib.D3.Tools.RandomId();
|
||||
|
@ -139,6 +141,16 @@ GameLib.D3.Scene.API = function(
|
|||
shapes = [];
|
||||
}
|
||||
this.shapes = shapes;
|
||||
|
||||
if (GameLib.D3.Utils.UndefinedOrNull(cameras)) {
|
||||
cameras = [];
|
||||
}
|
||||
this.cameras = cameras;
|
||||
|
||||
if (GameLib.D3.Utils.UndefinedOrNull(activeCameraIndex)) {
|
||||
activeCameraIndex = 0;
|
||||
}
|
||||
this.activeCameraIndex = activeCameraIndex;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue