diff --git a/src/game-lib-game.js b/src/game-lib-game.js index 592b74f..e390d2b 100644 --- a/src/game-lib-game.js +++ b/src/game-lib-game.js @@ -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]); } }; diff --git a/src/game-lib-scene.js b/src/game-lib-scene.js index ca809d3..c4492dd 100644 --- a/src/game-lib-scene.js +++ b/src/game-lib-scene.js @@ -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; }; /**