@babylonjs/core 8.16.0 → 8.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/core",
3
- "version": "8.16.0",
3
+ "version": "8.16.1",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "types": "index.d.ts",
package/scene.d.ts CHANGED
@@ -570,6 +570,22 @@ export declare class Scene implements IAnimatable, IClipPlanesHolder, IAssetCont
570
570
  * An event triggered when a skeleton is removed
571
571
  */
572
572
  onSkeletonRemovedObservable: Observable<Skeleton>;
573
+ /**
574
+ * An event triggered when a particle system is created
575
+ */
576
+ onNewParticleSystemAddedObservable: Observable<IParticleSystem>;
577
+ /**
578
+ * An event triggered when a particle system is removed
579
+ */
580
+ onParticleSystemRemovedObservable: Observable<IParticleSystem>;
581
+ /**
582
+ * An event triggered when an animation group is created
583
+ */
584
+ onNewAnimationGroupAddedObservable: Observable<AnimationGroup>;
585
+ /**
586
+ * An event triggered when an animation group is removed
587
+ */
588
+ onAnimationGroupRemovedObservable: Observable<AnimationGroup>;
573
589
  /**
574
590
  * An event triggered when a material is created
575
591
  */
@@ -594,6 +610,14 @@ export declare class Scene implements IAnimatable, IClipPlanesHolder, IAssetCont
594
610
  * An event triggered when a texture is removed
595
611
  */
596
612
  onTextureRemovedObservable: Observable<BaseTexture>;
613
+ /**
614
+ * An event triggered when a frame graph is created
615
+ */
616
+ onNewFrameGraphAddedObservable: Observable<FrameGraph>;
617
+ /**
618
+ * An event triggered when a frame graph is removed
619
+ */
620
+ onFrameGraphRemovedObservable: Observable<FrameGraph>;
597
621
  /**
598
622
  * An event triggered when render targets are about to be rendered
599
623
  * Can happen multiple times per frame.
@@ -1629,6 +1653,12 @@ export declare class Scene implements IAnimatable, IClipPlanesHolder, IAssetCont
1629
1653
  * @returns The index of the removed texture
1630
1654
  */
1631
1655
  removeTexture(toRemove: BaseTexture): number;
1656
+ /**
1657
+ * Removes the given frame graph from this scene.
1658
+ * @param toRemove The frame graph to remove
1659
+ * @returns The index of the removed frame graph
1660
+ */
1661
+ removeFrameGraph(toRemove: FrameGraph): number;
1632
1662
  /**
1633
1663
  * Adds the given light to this scene
1634
1664
  * @param newLight The light to add
@@ -1694,6 +1724,11 @@ export declare class Scene implements IAnimatable, IClipPlanesHolder, IAssetCont
1694
1724
  * @param newTexture The texture to add
1695
1725
  */
1696
1726
  addTexture(newTexture: BaseTexture): void;
1727
+ /**
1728
+ * Adds the given frame graph to this scene.
1729
+ * @param newFrameGraph The frame graph to add
1730
+ */
1731
+ addFrameGraph(newFrameGraph: FrameGraph): void;
1697
1732
  /**
1698
1733
  * Switch active camera
1699
1734
  * @param newCamera defines the new active camera
package/scene.js CHANGED
@@ -983,6 +983,22 @@ export class Scene {
983
983
  * An event triggered when a skeleton is removed
984
984
  */
985
985
  this.onSkeletonRemovedObservable = new Observable();
986
+ /**
987
+ * An event triggered when a particle system is created
988
+ */
989
+ this.onNewParticleSystemAddedObservable = new Observable();
990
+ /**
991
+ * An event triggered when a particle system is removed
992
+ */
993
+ this.onParticleSystemRemovedObservable = new Observable();
994
+ /**
995
+ * An event triggered when an animation group is created
996
+ */
997
+ this.onNewAnimationGroupAddedObservable = new Observable();
998
+ /**
999
+ * An event triggered when an animation group is removed
1000
+ */
1001
+ this.onAnimationGroupRemovedObservable = new Observable();
986
1002
  /**
987
1003
  * An event triggered when a material is created
988
1004
  */
@@ -1007,6 +1023,14 @@ export class Scene {
1007
1023
  * An event triggered when a texture is removed
1008
1024
  */
1009
1025
  this.onTextureRemovedObservable = new Observable();
1026
+ /**
1027
+ * An event triggered when a frame graph is created
1028
+ */
1029
+ this.onNewFrameGraphAddedObservable = new Observable();
1030
+ /**
1031
+ * An event triggered when a frame graph is removed
1032
+ */
1033
+ this.onFrameGraphRemovedObservable = new Observable();
1010
1034
  /**
1011
1035
  * An event triggered when render targets are about to be rendered
1012
1036
  * Can happen multiple times per frame.
@@ -2274,6 +2298,7 @@ export class Scene {
2274
2298
  // Clean active container
2275
2299
  this._executeActiveContainerCleanup(this._activeParticleSystems);
2276
2300
  }
2301
+ this.onParticleSystemRemovedObservable.notifyObservers(toRemove);
2277
2302
  return index;
2278
2303
  }
2279
2304
  /**
@@ -2307,6 +2332,7 @@ export class Scene {
2307
2332
  if (index !== -1) {
2308
2333
  this.animationGroups.splice(index, 1);
2309
2334
  }
2335
+ this.onAnimationGroupRemovedObservable.notifyObservers(toRemove);
2310
2336
  return index;
2311
2337
  }
2312
2338
  /**
@@ -2367,6 +2393,19 @@ export class Scene {
2367
2393
  this.onTextureRemovedObservable.notifyObservers(toRemove);
2368
2394
  return index;
2369
2395
  }
2396
+ /**
2397
+ * Removes the given frame graph from this scene.
2398
+ * @param toRemove The frame graph to remove
2399
+ * @returns The index of the removed frame graph
2400
+ */
2401
+ removeFrameGraph(toRemove) {
2402
+ const index = this.frameGraphs.indexOf(toRemove);
2403
+ if (index !== -1) {
2404
+ this.frameGraphs.splice(index, 1);
2405
+ }
2406
+ this.onFrameGraphRemovedObservable.notifyObservers(toRemove);
2407
+ return index;
2408
+ }
2370
2409
  /**
2371
2410
  * Adds the given light to this scene
2372
2411
  * @param newLight The light to add
@@ -2437,6 +2476,9 @@ export class Scene {
2437
2476
  return;
2438
2477
  }
2439
2478
  this.particleSystems.push(newParticleSystem);
2479
+ Tools.SetImmediate(() => {
2480
+ this.onNewParticleSystemAddedObservable.notifyObservers(newParticleSystem);
2481
+ });
2440
2482
  }
2441
2483
  /**
2442
2484
  * Adds the given animation to this scene
@@ -2457,6 +2499,9 @@ export class Scene {
2457
2499
  return;
2458
2500
  }
2459
2501
  this.animationGroups.push(newAnimationGroup);
2502
+ Tools.SetImmediate(() => {
2503
+ this.onNewAnimationGroupAddedObservable.notifyObservers(newAnimationGroup);
2504
+ });
2460
2505
  }
2461
2506
  /**
2462
2507
  * Adds the given multi-material to this scene
@@ -2531,6 +2576,16 @@ export class Scene {
2531
2576
  this.textures.push(newTexture);
2532
2577
  this.onNewTextureAddedObservable.notifyObservers(newTexture);
2533
2578
  }
2579
+ /**
2580
+ * Adds the given frame graph to this scene.
2581
+ * @param newFrameGraph The frame graph to add
2582
+ */
2583
+ addFrameGraph(newFrameGraph) {
2584
+ this.frameGraphs.push(newFrameGraph);
2585
+ Tools.SetImmediate(() => {
2586
+ this.onNewFrameGraphAddedObservable.notifyObservers(newFrameGraph);
2587
+ });
2588
+ }
2534
2589
  /**
2535
2590
  * Switch active camera
2536
2591
  * @param newCamera defines the new active camera