|
@@ -103,6 +103,7 @@
|
|
*/
|
|
*/
|
|
public lights = new Array<Light>();
|
|
public lights = new Array<Light>();
|
|
public onNewLightAdded: (newLight?: Light, positionInArray?: number, scene?: Scene) => void;
|
|
public onNewLightAdded: (newLight?: Light, positionInArray?: number, scene?: Scene) => void;
|
|
|
|
+ public onLightRemoved: (removedLight?: Light) => void;
|
|
|
|
|
|
// Cameras
|
|
// Cameras
|
|
/**
|
|
/**
|
|
@@ -112,6 +113,7 @@
|
|
*/
|
|
*/
|
|
public cameras = new Array<Camera>();
|
|
public cameras = new Array<Camera>();
|
|
public onNewCameraAdded: (newCamera?: Camera, positionInArray?: number, scene?: Scene) => void;
|
|
public onNewCameraAdded: (newCamera?: Camera, positionInArray?: number, scene?: Scene) => void;
|
|
|
|
+ public onCameraRemoved: (removedCamera?: Camera) => void;
|
|
public activeCameras = new Array<Camera>();
|
|
public activeCameras = new Array<Camera>();
|
|
public activeCamera: Camera;
|
|
public activeCamera: Camera;
|
|
|
|
|
|
@@ -123,6 +125,7 @@
|
|
*/
|
|
*/
|
|
public meshes = new Array<AbstractMesh>();
|
|
public meshes = new Array<AbstractMesh>();
|
|
public onNewMeshAdded: (newMesh?: AbstractMesh, positionInArray?: number, scene?: Scene) => void;
|
|
public onNewMeshAdded: (newMesh?: AbstractMesh, positionInArray?: number, scene?: Scene) => void;
|
|
|
|
+ public onMeshRemoved: (removedMesh?: AbstractMesh) => void;
|
|
|
|
|
|
// Geometries
|
|
// Geometries
|
|
private _geometries = new Array<Geometry>();
|
|
private _geometries = new Array<Geometry>();
|
|
@@ -725,6 +728,42 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public removeMesh(toRemove: AbstractMesh) : number {
|
|
|
|
+ var index = this.meshes.indexOf(toRemove);
|
|
|
|
+ if (index != -1) {
|
|
|
|
+ // Remove from the scene if mesh found
|
|
|
|
+ this.meshes.splice(index, 1);
|
|
|
|
+ }
|
|
|
|
+ if (this.onMeshRemoved) {
|
|
|
|
+ this.onMeshRemoved(toRemove);
|
|
|
|
+ }
|
|
|
|
+ return index;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public removeLight(toRemove: Light) : number {
|
|
|
|
+ var index = this.lights.indexOf(toRemove);
|
|
|
|
+ if (index != -1) {
|
|
|
|
+ // Remove from the scene if mesh found
|
|
|
|
+ this.lights.splice(index, 1);
|
|
|
|
+ }
|
|
|
|
+ if (this.onLightRemoved) {
|
|
|
|
+ this.onLightRemoved(toRemove);
|
|
|
|
+ }
|
|
|
|
+ return index;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public removeCamera(toRemove: Camera) : number {
|
|
|
|
+ var index = this.cameras.indexOf(toRemove);
|
|
|
|
+ if (index != -1) {
|
|
|
|
+ // Remove from the scene if mesh found
|
|
|
|
+ this.cameras.splice(index, 1);
|
|
|
|
+ }
|
|
|
|
+ if (this.onCameraRemoved) {
|
|
|
|
+ this.onCameraRemoved(toRemove);
|
|
|
|
+ }
|
|
|
|
+ return index;
|
|
|
|
+ }
|
|
|
|
+
|
|
public addLight(newLight: Light) {
|
|
public addLight(newLight: Light) {
|
|
var position = this.lights.push(newLight);
|
|
var position = this.lights.push(newLight);
|
|
if (this.onNewLightAdded) {
|
|
if (this.onNewLightAdded) {
|