|
@@ -326,13 +326,26 @@ var BABYLON = BABYLON || {};
|
|
|
};
|
|
|
|
|
|
// Methods
|
|
|
- BABYLON.Scene.prototype.activeCameraByID = function (id) {
|
|
|
- for (var index = 0; index < this.cameras.length; index++) {
|
|
|
- if (this.cameras[index].id === id) {
|
|
|
- this.activeCamera = this.cameras[index];
|
|
|
- return;
|
|
|
- }
|
|
|
+ BABYLON.Scene.prototype.setActiveCameraByID = function (id) {
|
|
|
+ var camera = this.getCameraByID(id);
|
|
|
+
|
|
|
+ if (camera) {
|
|
|
+ this.activeCamera = camera;
|
|
|
+ return camera;
|
|
|
}
|
|
|
+
|
|
|
+ return null;
|
|
|
+ };
|
|
|
+
|
|
|
+ BABYLON.Scene.prototype.setActiveCameraByName = function (name) {
|
|
|
+ var camera = this.getCameraByName(name);
|
|
|
+
|
|
|
+ if (camera) {
|
|
|
+ this.activeCamera = camera;
|
|
|
+ return camera;
|
|
|
+ }
|
|
|
+
|
|
|
+ return null;
|
|
|
};
|
|
|
|
|
|
BABYLON.Scene.prototype.getMaterialByID = function (id) {
|
|
@@ -355,6 +368,16 @@ var BABYLON = BABYLON || {};
|
|
|
return null;
|
|
|
};
|
|
|
|
|
|
+ BABYLON.Scene.prototype.getCameraByID = function (id) {
|
|
|
+ for (var index = 0; index < this.cameras.length; index++) {
|
|
|
+ if (this.cameras[index].id === id) {
|
|
|
+ return this.cameras[index];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return null;
|
|
|
+ };
|
|
|
+
|
|
|
BABYLON.Scene.prototype.getCameraByName = function (name) {
|
|
|
for (var index = 0; index < this.cameras.length; index++) {
|
|
|
if (this.cameras[index].name === name) {
|