@babylonjs/core 5.38.0 → 5.40.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.
Files changed (63) hide show
  1. package/Audio/audioSceneComponent.d.ts +11 -6
  2. package/Audio/audioSceneComponent.js +78 -52
  3. package/Audio/audioSceneComponent.js.map +1 -1
  4. package/Audio/sound.js +6 -4
  5. package/Audio/sound.js.map +1 -1
  6. package/Culling/ray.d.ts +1 -1
  7. package/Culling/ray.js.map +1 -1
  8. package/Engines/Extensions/engine.renderTarget.js +3 -3
  9. package/Engines/Extensions/engine.renderTarget.js.map +1 -1
  10. package/Engines/nativeEngine.js +2 -1
  11. package/Engines/nativeEngine.js.map +1 -1
  12. package/Engines/thinEngine.js +2 -2
  13. package/Engines/thinEngine.js.map +1 -1
  14. package/Gizmos/gizmo.d.ts +1 -0
  15. package/Gizmos/gizmo.js +1 -0
  16. package/Gizmos/gizmo.js.map +1 -1
  17. package/Gizmos/positionGizmo.d.ts +4 -0
  18. package/Gizmos/positionGizmo.js +4 -0
  19. package/Gizmos/positionGizmo.js.map +1 -1
  20. package/Gizmos/rotationGizmo.d.ts +4 -0
  21. package/Gizmos/rotationGizmo.js +4 -0
  22. package/Gizmos/rotationGizmo.js.map +1 -1
  23. package/Layers/glowLayer.d.ts +3 -3
  24. package/Layers/glowLayer.js +2 -1
  25. package/Layers/glowLayer.js.map +1 -1
  26. package/Materials/Node/Blocks/index.d.ts +2 -0
  27. package/Materials/Node/Blocks/index.js +2 -0
  28. package/Materials/Node/Blocks/index.js.map +1 -1
  29. package/Materials/Node/Blocks/matrixDeterminantBlock.d.ts +27 -0
  30. package/Materials/Node/Blocks/matrixDeterminantBlock.js +46 -0
  31. package/Materials/Node/Blocks/matrixDeterminantBlock.js.map +1 -0
  32. package/Materials/Node/Blocks/matrixTransposeBlock.d.ts +27 -0
  33. package/Materials/Node/Blocks/matrixTransposeBlock.js +46 -0
  34. package/Materials/Node/Blocks/matrixTransposeBlock.js.map +1 -0
  35. package/Materials/Textures/renderTargetTexture.d.ts +32 -28
  36. package/Materials/Textures/renderTargetTexture.js +13 -9
  37. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  38. package/Materials/materialPluginManager.js +25 -4
  39. package/Materials/materialPluginManager.js.map +1 -1
  40. package/Maths/math.vector.d.ts +101 -9
  41. package/Maths/math.vector.js +101 -9
  42. package/Maths/math.vector.js.map +1 -1
  43. package/Meshes/linesMesh.d.ts +3 -1
  44. package/Meshes/linesMesh.js +8 -2
  45. package/Meshes/linesMesh.js.map +1 -1
  46. package/Meshes/subMesh.js +2 -2
  47. package/Meshes/subMesh.js.map +1 -1
  48. package/Misc/screenshotTools.d.ts +5 -2
  49. package/Misc/screenshotTools.js +7 -3
  50. package/Misc/screenshotTools.js.map +1 -1
  51. package/Particles/solidParticleSystem.d.ts +67 -63
  52. package/Particles/solidParticleSystem.js.map +1 -1
  53. package/PostProcesses/volumetricLightScatteringPostProcess.d.ts +5 -0
  54. package/PostProcesses/volumetricLightScatteringPostProcess.js +9 -1
  55. package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
  56. package/Rendering/boundingBoxRenderer.js +2 -0
  57. package/Rendering/boundingBoxRenderer.js.map +1 -1
  58. package/Rendering/depthRendererSceneComponent.d.ts +2 -1
  59. package/Rendering/depthRendererSceneComponent.js +2 -2
  60. package/Rendering/depthRendererSceneComponent.js.map +1 -1
  61. package/Shaders/ShadersInclude/pbrBlockFinalColorComposition.js +3 -3
  62. package/Shaders/ShadersInclude/pbrBlockFinalColorComposition.js.map +1 -1
  63. package/package.json +1 -1
@@ -1,7 +1,11 @@
1
- import type { Nullable } from "../types";
1
+ import type { Nullable, IndicesArray } from "../types";
2
+ import { Vector3 } from "../Maths/math.vector";
3
+ import { Color4 } from "../Maths/math.color";
2
4
  import { Mesh } from "../Meshes/mesh";
3
5
  import type { Scene, IDisposable } from "../scene";
4
- import { DepthSortedParticle, SolidParticle, SolidParticleVertex } from "./solidParticle";
6
+ import { DepthSortedParticle, SolidParticle, ModelShape, SolidParticleVertex } from "./solidParticle";
7
+ import type { TargetCamera } from "../Cameras/targetCamera";
8
+ import { BoundingInfo } from "../Culling/boundingInfo";
5
9
  import type { Material } from "../Materials/material";
6
10
  import { MultiMaterial } from "../Materials/multiMaterial";
7
11
  import type { PickingInfo } from "../Collisions/pickingInfo";
@@ -94,55 +98,55 @@ export declare class SolidParticleSystem implements IDisposable {
94
98
  * @internal
95
99
  */
96
100
  _bSphereRadiusFactor: number;
97
- private _scene;
98
- private _positions;
99
- private _indices;
100
- private _normals;
101
- private _colors;
102
- private _uvs;
103
- private _indices32;
104
- private _positions32;
105
- private _normals32;
106
- private _fixedNormal32;
107
- private _colors32;
108
- private _uvs32;
109
- private _index;
110
- private _updatable;
111
- private _pickable;
112
- private _isVisibilityBoxLocked;
113
- private _alwaysVisible;
114
- private _depthSort;
115
- private _expandable;
116
- private _shapeCounter;
117
- private _copy;
118
- private _color;
119
- private _computeParticleColor;
120
- private _computeParticleTexture;
121
- private _computeParticleRotation;
122
- private _computeParticleVertex;
123
- private _computeBoundingBox;
124
- private _autoFixFaceOrientation;
125
- private _depthSortParticles;
126
- private _camera;
127
- private _mustUnrotateFixedNormals;
128
- private _particlesIntersect;
129
- private _needs32Bits;
130
- private _isNotBuilt;
131
- private _lastParticleId;
132
- private _idxOfId;
133
- private _multimaterialEnabled;
134
- private _useModelMaterial;
135
- private _indicesByMaterial;
136
- private _materialIndexes;
137
- private _depthSortFunction;
138
- private _materialSortFunction;
139
- private _materials;
140
- private _multimaterial;
141
- private _materialIndexesById;
142
- private _defaultMaterial;
143
- private _autoUpdateSubMeshes;
144
- private _tmpVertex;
145
- private _recomputeInvisibles;
101
+ protected _scene: Scene;
102
+ protected _positions: number[];
103
+ protected _indices: number[];
104
+ protected _normals: number[];
105
+ protected _colors: number[];
106
+ protected _uvs: number[];
107
+ protected _indices32: IndicesArray;
108
+ protected _positions32: Float32Array;
109
+ protected _normals32: Float32Array;
110
+ protected _fixedNormal32: Float32Array;
111
+ protected _colors32: Float32Array;
112
+ protected _uvs32: Float32Array;
113
+ protected _index: number;
114
+ protected _updatable: boolean;
115
+ protected _pickable: boolean;
116
+ protected _isVisibilityBoxLocked: boolean;
117
+ protected _alwaysVisible: boolean;
118
+ protected _depthSort: boolean;
119
+ protected _expandable: boolean;
120
+ protected _shapeCounter: number;
121
+ protected _copy: SolidParticle;
122
+ protected _color: Color4;
123
+ protected _computeParticleColor: boolean;
124
+ protected _computeParticleTexture: boolean;
125
+ protected _computeParticleRotation: boolean;
126
+ protected _computeParticleVertex: boolean;
127
+ protected _computeBoundingBox: boolean;
128
+ protected _autoFixFaceOrientation: boolean;
129
+ protected _depthSortParticles: boolean;
130
+ protected _camera: TargetCamera;
131
+ protected _mustUnrotateFixedNormals: boolean;
132
+ protected _particlesIntersect: boolean;
133
+ protected _needs32Bits: boolean;
134
+ protected _isNotBuilt: boolean;
135
+ protected _lastParticleId: number;
136
+ protected _idxOfId: number[];
137
+ protected _multimaterialEnabled: boolean;
138
+ protected _useModelMaterial: boolean;
139
+ protected _indicesByMaterial: number[];
140
+ protected _materialIndexes: number[];
141
+ protected _depthSortFunction: (p1: DepthSortedParticle, p2: DepthSortedParticle) => number;
142
+ protected _materialSortFunction: (p1: DepthSortedParticle, p2: DepthSortedParticle) => number;
143
+ protected _materials: Material[];
144
+ protected _multimaterial: MultiMaterial;
145
+ protected _materialIndexesById: any;
146
+ protected _defaultMaterial: Material;
147
+ protected _autoUpdateSubMeshes: boolean;
148
+ protected _tmpVertex: SolidParticleVertex;
149
+ protected _recomputeInvisibles: boolean;
146
150
  /**
147
151
  * Creates a SPS (Solid Particle System) object.
148
152
  * @param name (String) is the SPS name, this will be the underlying mesh name.
@@ -216,12 +220,12 @@ export declare class SolidParticleSystem implements IDisposable {
216
220
  * Unrotate the fixed normals in case the mesh was built with pre-rotated particles, ex : use of positionFunction in addShape()
217
221
  * @internal
218
222
  */
219
- private _unrotateFixedNormals;
223
+ protected _unrotateFixedNormals(): void;
220
224
  /**
221
225
  * Resets the temporary working copy particle
222
226
  * @internal
223
227
  */
224
- private _resetCopy;
228
+ protected _resetCopy(): void;
225
229
  /**
226
230
  * Inserts the shape model geometry in the global SPS mesh by updating the positions, indices, normals, colors, uvs arrays
227
231
  * @param p the current index in the positions array to be updated
@@ -243,21 +247,21 @@ export declare class SolidParticleSystem implements IDisposable {
243
247
  * @model the particle model
244
248
  * @internal
245
249
  */
246
- private _meshBuilder;
250
+ protected _meshBuilder(p: number, ind: number, shape: Vector3[], positions: number[], meshInd: IndicesArray, indices: number[], meshUV: number[] | Float32Array, uvs: number[], meshCol: number[] | Float32Array, colors: number[], meshNor: number[] | Float32Array, normals: number[], idx: number, idxInShape: number, options: any, model: ModelShape): SolidParticle;
247
251
  /**
248
252
  * Returns a shape Vector3 array from positions float array
249
253
  * @param positions float array
250
254
  * @returns a vector3 array
251
255
  * @internal
252
256
  */
253
- private _posToShape;
257
+ protected _posToShape(positions: number[] | Float32Array): Vector3[];
254
258
  /**
255
259
  * Returns a shapeUV array from a float uvs (array deep copy)
256
260
  * @param uvs as a float array
257
261
  * @returns a shapeUV array
258
262
  * @internal
259
263
  */
260
- private _uvsToShapeUV;
264
+ protected _uvsToShapeUV(uvs: number[] | Float32Array): number[];
261
265
  /**
262
266
  * Adds a new particle object in the particles array
263
267
  * @param idx particle index in particles array
@@ -271,7 +275,7 @@ export declare class SolidParticleSystem implements IDisposable {
271
275
  * @param storage target storage array, if any
272
276
  * @internal
273
277
  */
274
- private _addParticle;
278
+ protected _addParticle(idx: number, id: number, idxpos: number, idxind: number, model: ModelShape, shapeId: number, idxInShape: number, bInfo?: Nullable<BoundingInfo>, storage?: Nullable<[]>): SolidParticle;
275
279
  /**
276
280
  * Adds some particles to the SPS from the model shape. Returns the shape id.
277
281
  * Please read the doc : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/immutable_sps
@@ -294,7 +298,7 @@ export declare class SolidParticleSystem implements IDisposable {
294
298
  * Rebuilds a particle back to its just built status : if needed, recomputes the custom positions and vertices
295
299
  * @internal
296
300
  */
297
- private _rebuildParticle;
301
+ protected _rebuildParticle(particle: SolidParticle, reset?: boolean): void;
298
302
  /**
299
303
  * Rebuilds the whole mesh and updates the VBO : custom positions and vertices are recomputed if needed.
300
304
  * @param reset boolean, default false : if the particles must be reset at position and rotation zero, scaling 1, color white, initial UVs and not parented.
@@ -336,7 +340,7 @@ export declare class SolidParticleSystem implements IDisposable {
336
340
  * @options addShape() passed options
337
341
  * @internal
338
342
  */
339
- private _insertNewParticle;
343
+ protected _insertNewParticle(idx: number, i: number, modelShape: ModelShape, shape: Vector3[], meshInd: IndicesArray, meshUV: number[] | Float32Array, meshCol: number[] | Float32Array, meshNor: number[] | Float32Array, bbInfo: Nullable<BoundingInfo>, storage: Nullable<[]>, options: any): Nullable<SolidParticle>;
340
344
  /**
341
345
  * Sets all the particles : this method actually really updates the mesh according to the particle positions, rotations, colors, textures, etc.
342
346
  * This method calls `updateParticle()` for each particle of the SPS.
@@ -396,23 +400,23 @@ export declare class SolidParticleSystem implements IDisposable {
396
400
  * @returns the SPS
397
401
  * @internal
398
402
  */
399
- private _sortParticlesByMaterial;
403
+ protected _sortParticlesByMaterial(): SolidParticleSystem;
400
404
  /**
401
405
  * Sets the material indexes by id materialIndexesById[id] = materialIndex
402
406
  * @internal
403
407
  */
404
- private _setMaterialIndexesById;
408
+ protected _setMaterialIndexesById(): void;
405
409
  /**
406
410
  * Returns an array with unique values of Materials from the passed array
407
411
  * @param array the material array to be checked and filtered
408
412
  * @internal
409
413
  */
410
- private _filterUniqueMaterialId;
414
+ protected _filterUniqueMaterialId(array: Material[]): Material[];
411
415
  /**
412
416
  * Sets a new Standard Material as _defaultMaterial if not already set.
413
417
  * @internal
414
418
  */
415
- private _setDefaultMaterial;
419
+ protected _setDefaultMaterial(): Material;
416
420
  /**
417
421
  * Visibility helper : Recomputes the visible size according to the mesh bounding box
418
422
  * doc : https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/sps_visibility