|
@@ -2041,10 +2041,12 @@ export class Scene extends AbstractScene implements IAnimatable {
|
|
* @param recursive if all child meshes should also be added to the scene
|
|
* @param recursive if all child meshes should also be added to the scene
|
|
*/
|
|
*/
|
|
public addMesh(newMesh: AbstractMesh, recursive = false) {
|
|
public addMesh(newMesh: AbstractMesh, recursive = false) {
|
|
- if (!this._blockEntityCollection) {
|
|
|
|
- this.meshes.push(newMesh);
|
|
|
|
|
|
+ if (this._blockEntityCollection) {
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ this.meshes.push(newMesh);
|
|
|
|
+
|
|
newMesh._resyncLightSources();
|
|
newMesh._resyncLightSources();
|
|
|
|
|
|
if (!newMesh.parent) {
|
|
if (!newMesh.parent) {
|
|
@@ -2092,6 +2094,9 @@ export class Scene extends AbstractScene implements IAnimatable {
|
|
* @param newTransformNode defines the transform node to add
|
|
* @param newTransformNode defines the transform node to add
|
|
*/
|
|
*/
|
|
public addTransformNode(newTransformNode: TransformNode) {
|
|
public addTransformNode(newTransformNode: TransformNode) {
|
|
|
|
+ if (this._blockEntityCollection) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
newTransformNode._indexInSceneTransformNodesArray = this.transformNodes.length;
|
|
newTransformNode._indexInSceneTransformNodesArray = this.transformNodes.length;
|
|
this.transformNodes.push(newTransformNode);
|
|
this.transformNodes.push(newTransformNode);
|
|
|
|
|
|
@@ -2334,6 +2339,9 @@ export class Scene extends AbstractScene implements IAnimatable {
|
|
* @param newLight The light to add
|
|
* @param newLight The light to add
|
|
*/
|
|
*/
|
|
public addLight(newLight: Light): void {
|
|
public addLight(newLight: Light): void {
|
|
|
|
+ if (this._blockEntityCollection) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
this.lights.push(newLight);
|
|
this.lights.push(newLight);
|
|
this.sortLightsByPriority();
|
|
this.sortLightsByPriority();
|
|
|
|
|
|
@@ -2366,6 +2374,10 @@ export class Scene extends AbstractScene implements IAnimatable {
|
|
* @param newCamera The camera to add
|
|
* @param newCamera The camera to add
|
|
*/
|
|
*/
|
|
public addCamera(newCamera: Camera): void {
|
|
public addCamera(newCamera: Camera): void {
|
|
|
|
+ if (this._blockEntityCollection) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
this.cameras.push(newCamera);
|
|
this.cameras.push(newCamera);
|
|
this.onNewCameraAddedObservable.notifyObservers(newCamera);
|
|
this.onNewCameraAddedObservable.notifyObservers(newCamera);
|
|
|
|
|
|
@@ -2484,6 +2496,9 @@ export class Scene extends AbstractScene implements IAnimatable {
|
|
* @param newTexture The texture to add
|
|
* @param newTexture The texture to add
|
|
*/
|
|
*/
|
|
public addTexture(newTexture: BaseTexture): void {
|
|
public addTexture(newTexture: BaseTexture): void {
|
|
|
|
+ if (this._blockEntityCollection) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
this.textures.push(newTexture);
|
|
this.textures.push(newTexture);
|
|
this.onNewTextureAddedObservable.notifyObservers(newTexture);
|
|
this.onNewTextureAddedObservable.notifyObservers(newTexture);
|
|
}
|
|
}
|