@babylonjs/core 8.38.0 → 8.39.0
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/Animations/animation.d.ts +2 -1
- package/Animations/animation.js +3 -2
- package/Animations/animation.js.map +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.d.ts +4 -0
- package/Behaviors/Cameras/autoRotationBehavior.js +7 -0
- package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
- package/Behaviors/Cameras/bouncingBehavior.d.ts +5 -0
- package/Behaviors/Cameras/bouncingBehavior.js +8 -0
- package/Behaviors/Cameras/bouncingBehavior.js.map +1 -1
- package/Behaviors/Cameras/framingBehavior.d.ts +4 -0
- package/Behaviors/Cameras/framingBehavior.js +7 -0
- package/Behaviors/Cameras/framingBehavior.js.map +1 -1
- package/Behaviors/Cameras/interpolatingBehavior.d.ts +7 -1
- package/Behaviors/Cameras/interpolatingBehavior.js +11 -3
- package/Behaviors/Cameras/interpolatingBehavior.js.map +1 -1
- package/Behaviors/Meshes/attachToBoxBehavior.d.ts +5 -0
- package/Behaviors/Meshes/attachToBoxBehavior.js +8 -1
- package/Behaviors/Meshes/attachToBoxBehavior.js.map +1 -1
- package/Behaviors/Meshes/baseSixDofDragBehavior.d.ts +5 -2
- package/Behaviors/Meshes/baseSixDofDragBehavior.js +8 -0
- package/Behaviors/Meshes/baseSixDofDragBehavior.js.map +1 -1
- package/Behaviors/Meshes/fadeInOutBehavior.d.ts +5 -0
- package/Behaviors/Meshes/fadeInOutBehavior.js +6 -0
- package/Behaviors/Meshes/fadeInOutBehavior.js.map +1 -1
- package/Behaviors/Meshes/handConstraintBehavior.d.ts +5 -0
- package/Behaviors/Meshes/handConstraintBehavior.js +8 -0
- package/Behaviors/Meshes/handConstraintBehavior.js.map +1 -1
- package/Behaviors/Meshes/multiPointerScaleBehavior.d.ts +5 -0
- package/Behaviors/Meshes/multiPointerScaleBehavior.js +8 -0
- package/Behaviors/Meshes/multiPointerScaleBehavior.js.map +1 -1
- package/Behaviors/Meshes/sixDofDragBehavior.js +1 -1
- package/Behaviors/Meshes/sixDofDragBehavior.js.map +1 -1
- package/Behaviors/Meshes/surfaceMagnetismBehavior.d.ts +5 -0
- package/Behaviors/Meshes/surfaceMagnetismBehavior.js +7 -0
- package/Behaviors/Meshes/surfaceMagnetismBehavior.js.map +1 -1
- package/Behaviors/behavior.d.ts +4 -0
- package/Behaviors/behavior.js.map +1 -1
- package/Cameras/geospatialCamera.d.ts +11 -3
- package/Cameras/geospatialCamera.js +103 -36
- package/Cameras/geospatialCamera.js.map +1 -1
- package/Cameras/geospatialCameraMovement.d.ts +6 -2
- package/Cameras/geospatialCameraMovement.js +11 -11
- package/Cameras/geospatialCameraMovement.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.d.ts +2 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.js +5 -2
- package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.d.ts +1 -0
- package/Engines/WebGPU/webgpuTextureHelper.js +11 -0
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.d.ts +1 -0
- package/Engines/WebGPU/webgpuTextureManager.js +100 -9
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/renderTargetWrapper.js +6 -1
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.js +1 -1
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +7 -4
- package/Engines/webgpuEngine.js +45 -16
- package/Engines/webgpuEngine.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.d.ts +22 -5
- package/FrameGraph/Node/nodeRenderGraph.js +39 -18
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Passes/pass.d.ts +2 -0
- package/FrameGraph/Passes/pass.js +2 -0
- package/FrameGraph/Passes/pass.js.map +1 -1
- package/FrameGraph/Passes/renderPass.d.ts +2 -0
- package/FrameGraph/Passes/renderPass.js +4 -0
- package/FrameGraph/Passes/renderPass.js.map +1 -1
- package/FrameGraph/frameGraph.d.ts +13 -4
- package/FrameGraph/frameGraph.js +45 -5
- package/FrameGraph/frameGraph.js.map +1 -1
- package/FrameGraph/frameGraphRenderTarget.d.ts +1 -0
- package/FrameGraph/frameGraphRenderTarget.js +3 -0
- package/FrameGraph/frameGraphRenderTarget.js.map +1 -1
- package/FrameGraph/frameGraphTask.d.ts +6 -0
- package/FrameGraph/frameGraphTask.js +15 -0
- package/FrameGraph/frameGraphTask.js.map +1 -1
- package/FrameGraph/frameGraphTypes.d.ts +2 -0
- package/FrameGraph/frameGraphTypes.js.map +1 -1
- package/Helpers/sceneHelpers.js +1 -1
- package/Helpers/sceneHelpers.js.map +1 -1
- package/Lights/index.d.ts +1 -0
- package/Lights/index.js +1 -0
- package/Lights/index.js.map +1 -1
- package/Lights/lightingVolume.d.ts +89 -0
- package/Lights/lightingVolume.js +426 -0
- package/Lights/lightingVolume.js.map +1 -0
- package/Materials/Node/nodeMaterial.js +8 -2
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/floatingOriginMatrixOverrides.js +6 -5
- package/Materials/floatingOriginMatrixOverrides.js.map +1 -1
- package/Meshes/mesh.js +1 -1
- package/Meshes/mesh.js.map +1 -1
- package/Misc/screenshotTools.js +2 -8
- package/Misc/screenshotTools.js.map +1 -1
- package/Particles/solidParticle.d.ts +9 -0
- package/Particles/solidParticle.js +11 -0
- package/Particles/solidParticle.js.map +1 -1
- package/Particles/solidParticleSystem.d.ts +28 -0
- package/Particles/solidParticleSystem.js +75 -0
- package/Particles/solidParticleSystem.js.map +1 -1
- package/ShadersWGSL/lightingVolume.compute.d.ts +5 -0
- package/ShadersWGSL/lightingVolume.compute.js +27 -0
- package/ShadersWGSL/lightingVolume.compute.js.map +1 -0
- package/package.json +1 -1
- package/scene.js +6 -4
- package/scene.js.map +1 -1
|
@@ -121,6 +121,13 @@ export class SolidParticleSystem {
|
|
|
121
121
|
this._materialSortFunction = (p1, p2) => p1.materialIndex - p2.materialIndex;
|
|
122
122
|
this._autoUpdateSubMeshes = false;
|
|
123
123
|
this._recomputeInvisibles = false;
|
|
124
|
+
this._started = false;
|
|
125
|
+
this._stopped = false;
|
|
126
|
+
this._onBeforeRenderObserver = null;
|
|
127
|
+
/**
|
|
128
|
+
* The overall motion speed (0.01 is default update speed, faster updates = faster animation)
|
|
129
|
+
*/
|
|
130
|
+
this.updateSpeed = 0.01;
|
|
124
131
|
this.name = name;
|
|
125
132
|
this._scene = scene || EngineStore.LastCreatedScene;
|
|
126
133
|
this._camera = scene.activeCamera;
|
|
@@ -942,8 +949,20 @@ export class SolidParticleSystem {
|
|
|
942
949
|
const vpos = (index / 3) | 0;
|
|
943
950
|
colorIndex = vpos * 4;
|
|
944
951
|
uvIndex = vpos * 2;
|
|
952
|
+
// Calculate scaled update speed based on animation ratio (for FPS independence)
|
|
953
|
+
if (this._started && !this._stopped) {
|
|
954
|
+
this._scaledUpdateSpeed = this.updateSpeed * (this._scene?.getAnimationRatio() || 1);
|
|
955
|
+
}
|
|
945
956
|
for (let p = start; p <= end; p++) {
|
|
946
957
|
const particle = this.particles[p];
|
|
958
|
+
// Update particle age and check lifetime
|
|
959
|
+
if (this._started && !this._stopped) {
|
|
960
|
+
particle.age += this._scaledUpdateSpeed;
|
|
961
|
+
// Only check lifetime if it's finite (Infinity means particle never dies)
|
|
962
|
+
if (isFinite(particle.lifeTime) && particle.age >= particle.lifeTime) {
|
|
963
|
+
particle.alive = false;
|
|
964
|
+
}
|
|
965
|
+
}
|
|
947
966
|
// call to custom user function to update the particle properties
|
|
948
967
|
this.updateParticle(particle);
|
|
949
968
|
const shape = particle._model._shape;
|
|
@@ -1279,6 +1298,7 @@ export class SolidParticleSystem {
|
|
|
1279
1298
|
* Disposes the SPS.
|
|
1280
1299
|
*/
|
|
1281
1300
|
dispose() {
|
|
1301
|
+
this.stop();
|
|
1282
1302
|
this.mesh.dispose();
|
|
1283
1303
|
this.vars = null;
|
|
1284
1304
|
// drop references to internal big arrays for the GC
|
|
@@ -1770,5 +1790,60 @@ export class SolidParticleSystem {
|
|
|
1770
1790
|
*/
|
|
1771
1791
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1772
1792
|
afterUpdateParticles(start, stop, update) { }
|
|
1793
|
+
/**
|
|
1794
|
+
* Starts the particle system and begins to emit.
|
|
1795
|
+
* This will call buildMesh(), initParticles(), setParticles() and register the update loop.
|
|
1796
|
+
* @param delay defines the delay in milliseconds before starting the system (0 by default)
|
|
1797
|
+
*/
|
|
1798
|
+
start(delay = 0) {
|
|
1799
|
+
if (this._started) {
|
|
1800
|
+
return;
|
|
1801
|
+
}
|
|
1802
|
+
if (delay > 0) {
|
|
1803
|
+
setTimeout(() => {
|
|
1804
|
+
this.start(0);
|
|
1805
|
+
}, delay);
|
|
1806
|
+
return;
|
|
1807
|
+
}
|
|
1808
|
+
this.buildMesh();
|
|
1809
|
+
this.initParticles();
|
|
1810
|
+
this.setParticles();
|
|
1811
|
+
this._started = true;
|
|
1812
|
+
this._stopped = false;
|
|
1813
|
+
// Register update loop
|
|
1814
|
+
if (this._scene) {
|
|
1815
|
+
this._onBeforeRenderObserver = this._scene.onBeforeRenderObservable.add(() => {
|
|
1816
|
+
if (this._started && !this._stopped) {
|
|
1817
|
+
this.setParticles();
|
|
1818
|
+
}
|
|
1819
|
+
});
|
|
1820
|
+
}
|
|
1821
|
+
}
|
|
1822
|
+
/**
|
|
1823
|
+
* Stops the particle system.
|
|
1824
|
+
*/
|
|
1825
|
+
stop() {
|
|
1826
|
+
if (this._stopped) {
|
|
1827
|
+
return;
|
|
1828
|
+
}
|
|
1829
|
+
this._stopped = true;
|
|
1830
|
+
// Unregister update loop
|
|
1831
|
+
if (this._onBeforeRenderObserver && this._scene) {
|
|
1832
|
+
this._scene.onBeforeRenderObservable.remove(this._onBeforeRenderObserver);
|
|
1833
|
+
this._onBeforeRenderObserver = null;
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
/**
|
|
1837
|
+
* Gets if the particle system is started
|
|
1838
|
+
*/
|
|
1839
|
+
get started() {
|
|
1840
|
+
return this._started;
|
|
1841
|
+
}
|
|
1842
|
+
/**
|
|
1843
|
+
* Gets if the particle system is stopped
|
|
1844
|
+
*/
|
|
1845
|
+
get stopped() {
|
|
1846
|
+
return this._stopped;
|
|
1847
|
+
}
|
|
1773
1848
|
}
|
|
1774
1849
|
//# sourceMappingURL=solidParticleSystem.js.map
|