|
@@ -760,6 +760,16 @@
|
|
// Remove from the scene if mesh found
|
|
// Remove from the scene if mesh found
|
|
this.cameras.splice(index, 1);
|
|
this.cameras.splice(index, 1);
|
|
}
|
|
}
|
|
|
|
+ // Remove from activeCameras
|
|
|
|
+ var index2 = this.activeCameras.indexOf(toRemove);
|
|
|
|
+ if (index2 !== -1) {
|
|
|
|
+ // Remove from the scene if mesh found
|
|
|
|
+ this.activeCameras.splice(index2, 1);
|
|
|
|
+ }
|
|
|
|
+ // Reset the activeCamera
|
|
|
|
+ if (this.activeCamera === toRemove) {
|
|
|
|
+ this.activeCamera = null;
|
|
|
|
+ }
|
|
if (this.onCameraRemoved) {
|
|
if (this.onCameraRemoved) {
|
|
this.onCameraRemoved(toRemove);
|
|
this.onCameraRemoved(toRemove);
|
|
}
|
|
}
|
|
@@ -2160,4 +2170,4 @@
|
|
return this._getByTags(this.materials, tagsQuery, forEach).concat(this._getByTags(this.multiMaterials, tagsQuery, forEach));
|
|
return this._getByTags(this.materials, tagsQuery, forEach).concat(this._getByTags(this.multiMaterials, tagsQuery, forEach));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+}
|