|
@@ -26092,6 +26092,7 @@ declare module "babylonjs/Meshes/Builders/discBuilder" {
|
|
|
}
|
|
|
}
|
|
|
declare module "babylonjs/Particles/solidParticleSystem" {
|
|
|
+ import { Nullable } from "babylonjs/types";
|
|
|
import { Vector3 } from "babylonjs/Maths/math.vector";
|
|
|
import { Mesh } from "babylonjs/Meshes/mesh";
|
|
|
import { Scene, IDisposable } from "babylonjs/scene";
|
|
@@ -26200,6 +26201,8 @@ declare module "babylonjs/Particles/solidParticleSystem" {
|
|
|
private _particlesIntersect;
|
|
|
private _needs32Bits;
|
|
|
private _isNotBuilt;
|
|
|
+ private _lastParticleId;
|
|
|
+ private _idxOfId;
|
|
|
/**
|
|
|
* Creates a SPS (Solid Particle System) object.
|
|
|
* @param name (String) is the SPS name, this will be the underlying mesh name.
|
|
@@ -26237,18 +26240,71 @@ declare module "babylonjs/Particles/solidParticleSystem" {
|
|
|
* @param options {facetNb} (optional integer, default 1) is the number of mesh facets per particle, this parameter is overriden by the parameter `number` if any
|
|
|
* {delta} (optional integer, default 0) is the random extra number of facets per particle , each particle will have between `facetNb` and `facetNb + delta` facets
|
|
|
* {number} (optional positive integer) is the wanted number of particles : each particle is built with `mesh_total_facets / number` facets
|
|
|
+ * {storage} (optional existing array) is an array where the particles will be stored for a further use instead of being inserted in the SPS.
|
|
|
* @returns the current SPS
|
|
|
*/
|
|
|
digest(mesh: Mesh, options?: {
|
|
|
facetNb?: number;
|
|
|
number?: number;
|
|
|
delta?: number;
|
|
|
+ storage?: [];
|
|
|
}): SolidParticleSystem;
|
|
|
+ /**
|
|
|
+ * Unrotate the fixed normals in case the mesh was built with pre-rotated particles, ex : use of positionFunction in addShape()
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
private _unrotateFixedNormals;
|
|
|
+ /**
|
|
|
+ * Resets the temporary working copy particle
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
private _resetCopy;
|
|
|
+ /**
|
|
|
+ * Inserts the shape model geometry in the global SPS mesh by updating the positions, indices, normals, colors, uvs arrays
|
|
|
+ * @param p the current index in the positions array to be updated
|
|
|
+ * @param shape a Vector3 array, the shape geometry
|
|
|
+ * @param positions the positions array to be updated
|
|
|
+ * @param meshInd the shape indices array
|
|
|
+ * @param indices the indices array to be updated
|
|
|
+ * @param meshUV the shape uv array
|
|
|
+ * @param uvs the uv array to be updated
|
|
|
+ * @param meshCol the shape color array
|
|
|
+ * @param colors the color array to be updated
|
|
|
+ * @param meshNor the shape normals array
|
|
|
+ * @param normals the normals array to be updated
|
|
|
+ * @param idx the particle index
|
|
|
+ * @param idxInShape the particle index in its shape
|
|
|
+ * @param options the addShape() method passed options
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
private _meshBuilder;
|
|
|
+ /**
|
|
|
+ * Returns a shape Vector3 array from positions float array
|
|
|
+ * @param positions float array
|
|
|
+ * @returns a vector3 array
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
private _posToShape;
|
|
|
+ /**
|
|
|
+ * Returns a shapeUV array from a float uvs (array deep copy)
|
|
|
+ * @param uvs as a float array
|
|
|
+ * @returns a shapeUV array
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
private _uvsToShapeUV;
|
|
|
+ /**
|
|
|
+ * Adds a new particle object in the particles array
|
|
|
+ * @param idx particle index in particles array
|
|
|
+ * @param id particle id
|
|
|
+ * @param idxpos positionIndex : the starting index of the particle vertices in the SPS "positions" array
|
|
|
+ * @param idxind indiceIndex : he starting index of the particle indices in the SPS "indices" array
|
|
|
+ * @param model particle ModelShape object
|
|
|
+ * @param shapeId model shape identifier
|
|
|
+ * @param idxInShape index of the particle in the current model
|
|
|
+ * @param bInfo model bounding info object
|
|
|
+ * @param storage target storage array, if any
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
private _addParticle;
|
|
|
/**
|
|
|
* Adds some particles to the SPS from the model shape. Returns the shape id.
|
|
@@ -26257,12 +26313,18 @@ declare module "babylonjs/Particles/solidParticleSystem" {
|
|
|
* @param nb (positive integer) the number of particles to be created from this model
|
|
|
* @param options {positionFunction} is an optional javascript function to called for each particle on SPS creation.
|
|
|
* {vertexFunction} is an optional javascript function to called for each vertex of each particle on SPS creation
|
|
|
+ * {storage} (optional existing array) is an array where the particles will be stored for a further use instead of being inserted in the SPS.
|
|
|
* @returns the number of shapes in the system
|
|
|
*/
|
|
|
addShape(mesh: Mesh, nb: number, options?: {
|
|
|
positionFunction?: any;
|
|
|
vertexFunction?: any;
|
|
|
+ storage?: [];
|
|
|
}): number;
|
|
|
+ /**
|
|
|
+ * Rebuilds a particle back to its just built status : if needed, recomputes the custom positions and vertices
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
private _rebuildParticle;
|
|
|
/**
|
|
|
* Rebuilds the whole mesh and updates the VBO : custom positions and vertices are recomputed if needed.
|
|
@@ -26281,6 +26343,31 @@ declare module "babylonjs/Particles/solidParticleSystem" {
|
|
|
*/
|
|
|
removeParticles(start: number, end: number): SolidParticle[];
|
|
|
/**
|
|
|
+ * Inserts some pre-created particles in the solid particle system so that they can be managed by setParticles().
|
|
|
+ * @param solidParticleArray an array populated with Solid Particles objects
|
|
|
+ * @returns the SPS
|
|
|
+ */
|
|
|
+ insertParticlesFromArray(solidParticleArray: SolidParticle[]): SolidParticleSystem;
|
|
|
+ /**
|
|
|
+ * Creates a new particle and modifies the SPS mesh geometry :
|
|
|
+ * - calls _meshBuilder() to increase the SPS mesh geometry step by step
|
|
|
+ * - calls _addParticle() to populate the particle array
|
|
|
+ * factorized code from addShape() and insertParticlesFromArray()
|
|
|
+ * @param idx particle index in the particles array
|
|
|
+ * @param i particle index in its shape
|
|
|
+ * @param modelShape particle ModelShape object
|
|
|
+ * @param shape shape vertex array
|
|
|
+ * @param meshInd shape indices array
|
|
|
+ * @param meshUV shape uv array
|
|
|
+ * @param meshCol shape color array
|
|
|
+ * @param meshNor shape normals array
|
|
|
+ * @param bbInfo shape bounding info
|
|
|
+ * @param storage target particle storage
|
|
|
+ * @options addShape() passed options
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
+ private _insertNewParticle;
|
|
|
+ /**
|
|
|
* Sets all the particles : this method actually really updates the mesh according to the particle positions, rotations, colors, textures, etc.
|
|
|
* This method calls `updateParticle()` for each particle of the SPS.
|
|
|
* For an animated SPS, it is usually called within the render loop.
|
|
@@ -26296,6 +26383,25 @@ declare module "babylonjs/Particles/solidParticleSystem" {
|
|
|
*/
|
|
|
dispose(): void;
|
|
|
/**
|
|
|
+ * Returns a SolidParticle object from its identifier : particle.id
|
|
|
+ * @param id (integer) the particle Id
|
|
|
+ * @returns the searched particle or null if not found in the SPS.
|
|
|
+ */
|
|
|
+ getParticleById(id: number): Nullable<SolidParticle>;
|
|
|
+ /**
|
|
|
+ * Returns a new array populated with the particles having the passed shapeId.
|
|
|
+ * @param shapeId (integer) the shape identifier
|
|
|
+ * @returns a new solid particle array
|
|
|
+ */
|
|
|
+ getParticlesByShapeId(shapeId: number): SolidParticle[];
|
|
|
+ /**
|
|
|
+ * Populates the passed array "ref" with the particles having the passed shapeId.
|
|
|
+ * @param shapeId the shape identifier
|
|
|
+ * @returns the SPS
|
|
|
+ * @param ref
|
|
|
+ */
|
|
|
+ getParticlesByShapeIdToRef(shapeId: number, ref: SolidParticle[]): SolidParticleSystem;
|
|
|
+ /**
|
|
|
* Visibilty helper : Recomputes the visible size according to the mesh bounding box
|
|
|
* doc : http://doc.babylonjs.com/how_to/Solid_Particle_System#sps-visibility
|
|
|
* @returns the SPS.
|
|
@@ -26458,6 +26564,10 @@ declare module "babylonjs/Particles/solidParticle" {
|
|
|
*/
|
|
|
idx: number;
|
|
|
/**
|
|
|
+ * particle identifier
|
|
|
+ */
|
|
|
+ id: number;
|
|
|
+ /**
|
|
|
* The color of the particle
|
|
|
*/
|
|
|
color: Nullable<Color4>;
|
|
@@ -26567,7 +26677,8 @@ declare module "babylonjs/Particles/solidParticle" {
|
|
|
/**
|
|
|
* Creates a Solid Particle object.
|
|
|
* Don't create particles manually, use instead the Solid Particle System internal tools like _addParticle()
|
|
|
- * @param particleIndex (integer) is the particle index in the Solid Particle System pool. It's also the particle identifier.
|
|
|
+ * @param particleIndex (integer) is the particle index in the Solid Particle System pool.
|
|
|
+ * @param particleId (integer) is the particle identifier. Unless some particles are removed from the SPS, it's the same value than the particle idx.
|
|
|
* @param positionIndex (integer) is the starting index of the particle vertices in the SPS "positions" array.
|
|
|
* @param indiceIndex (integer) is the starting index of the particle indices in the SPS "indices" array.
|
|
|
* @param model (ModelShape) is a reference to the model shape on what the particle is designed.
|
|
@@ -26576,7 +26687,13 @@ declare module "babylonjs/Particles/solidParticle" {
|
|
|
* @param sps defines the sps it is associated to
|
|
|
* @param modelBoundingInfo is the reference to the model BoundingInfo used for intersection computations.
|
|
|
*/
|
|
|
- constructor(particleIndex: number, positionIndex: number, indiceIndex: number, model: Nullable<ModelShape>, shapeId: number, idxInShape: number, sps: SolidParticleSystem, modelBoundingInfo?: Nullable<BoundingInfo>);
|
|
|
+ constructor(particleIndex: number, particleId: number, positionIndex: number, indiceIndex: number, model: Nullable<ModelShape>, shapeId: number, idxInShape: number, sps: SolidParticleSystem, modelBoundingInfo?: Nullable<BoundingInfo>);
|
|
|
+ /**
|
|
|
+ * Copies the particle property values into the existing target : position, rotation, scaling, uvs, colors, pivot, parent, visibility, alive
|
|
|
+ * @param target the particle target
|
|
|
+ * @returns the current particle
|
|
|
+ */
|
|
|
+ copyToRef(target: SolidParticle): SolidParticle;
|
|
|
/**
|
|
|
* Legacy support, changed scale to scaling
|
|
|
*/
|
|
@@ -93349,6 +93466,8 @@ declare module BABYLON {
|
|
|
private _particlesIntersect;
|
|
|
private _needs32Bits;
|
|
|
private _isNotBuilt;
|
|
|
+ private _lastParticleId;
|
|
|
+ private _idxOfId;
|
|
|
/**
|
|
|
* Creates a SPS (Solid Particle System) object.
|
|
|
* @param name (String) is the SPS name, this will be the underlying mesh name.
|
|
@@ -93386,18 +93505,71 @@ declare module BABYLON {
|
|
|
* @param options {facetNb} (optional integer, default 1) is the number of mesh facets per particle, this parameter is overriden by the parameter `number` if any
|
|
|
* {delta} (optional integer, default 0) is the random extra number of facets per particle , each particle will have between `facetNb` and `facetNb + delta` facets
|
|
|
* {number} (optional positive integer) is the wanted number of particles : each particle is built with `mesh_total_facets / number` facets
|
|
|
+ * {storage} (optional existing array) is an array where the particles will be stored for a further use instead of being inserted in the SPS.
|
|
|
* @returns the current SPS
|
|
|
*/
|
|
|
digest(mesh: Mesh, options?: {
|
|
|
facetNb?: number;
|
|
|
number?: number;
|
|
|
delta?: number;
|
|
|
+ storage?: [];
|
|
|
}): SolidParticleSystem;
|
|
|
+ /**
|
|
|
+ * Unrotate the fixed normals in case the mesh was built with pre-rotated particles, ex : use of positionFunction in addShape()
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
private _unrotateFixedNormals;
|
|
|
+ /**
|
|
|
+ * Resets the temporary working copy particle
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
private _resetCopy;
|
|
|
+ /**
|
|
|
+ * Inserts the shape model geometry in the global SPS mesh by updating the positions, indices, normals, colors, uvs arrays
|
|
|
+ * @param p the current index in the positions array to be updated
|
|
|
+ * @param shape a Vector3 array, the shape geometry
|
|
|
+ * @param positions the positions array to be updated
|
|
|
+ * @param meshInd the shape indices array
|
|
|
+ * @param indices the indices array to be updated
|
|
|
+ * @param meshUV the shape uv array
|
|
|
+ * @param uvs the uv array to be updated
|
|
|
+ * @param meshCol the shape color array
|
|
|
+ * @param colors the color array to be updated
|
|
|
+ * @param meshNor the shape normals array
|
|
|
+ * @param normals the normals array to be updated
|
|
|
+ * @param idx the particle index
|
|
|
+ * @param idxInShape the particle index in its shape
|
|
|
+ * @param options the addShape() method passed options
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
private _meshBuilder;
|
|
|
+ /**
|
|
|
+ * Returns a shape Vector3 array from positions float array
|
|
|
+ * @param positions float array
|
|
|
+ * @returns a vector3 array
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
private _posToShape;
|
|
|
+ /**
|
|
|
+ * Returns a shapeUV array from a float uvs (array deep copy)
|
|
|
+ * @param uvs as a float array
|
|
|
+ * @returns a shapeUV array
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
private _uvsToShapeUV;
|
|
|
+ /**
|
|
|
+ * Adds a new particle object in the particles array
|
|
|
+ * @param idx particle index in particles array
|
|
|
+ * @param id particle id
|
|
|
+ * @param idxpos positionIndex : the starting index of the particle vertices in the SPS "positions" array
|
|
|
+ * @param idxind indiceIndex : he starting index of the particle indices in the SPS "indices" array
|
|
|
+ * @param model particle ModelShape object
|
|
|
+ * @param shapeId model shape identifier
|
|
|
+ * @param idxInShape index of the particle in the current model
|
|
|
+ * @param bInfo model bounding info object
|
|
|
+ * @param storage target storage array, if any
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
private _addParticle;
|
|
|
/**
|
|
|
* Adds some particles to the SPS from the model shape. Returns the shape id.
|
|
@@ -93406,12 +93578,18 @@ declare module BABYLON {
|
|
|
* @param nb (positive integer) the number of particles to be created from this model
|
|
|
* @param options {positionFunction} is an optional javascript function to called for each particle on SPS creation.
|
|
|
* {vertexFunction} is an optional javascript function to called for each vertex of each particle on SPS creation
|
|
|
+ * {storage} (optional existing array) is an array where the particles will be stored for a further use instead of being inserted in the SPS.
|
|
|
* @returns the number of shapes in the system
|
|
|
*/
|
|
|
addShape(mesh: Mesh, nb: number, options?: {
|
|
|
positionFunction?: any;
|
|
|
vertexFunction?: any;
|
|
|
+ storage?: [];
|
|
|
}): number;
|
|
|
+ /**
|
|
|
+ * Rebuilds a particle back to its just built status : if needed, recomputes the custom positions and vertices
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
private _rebuildParticle;
|
|
|
/**
|
|
|
* Rebuilds the whole mesh and updates the VBO : custom positions and vertices are recomputed if needed.
|
|
@@ -93430,6 +93608,31 @@ declare module BABYLON {
|
|
|
*/
|
|
|
removeParticles(start: number, end: number): SolidParticle[];
|
|
|
/**
|
|
|
+ * Inserts some pre-created particles in the solid particle system so that they can be managed by setParticles().
|
|
|
+ * @param solidParticleArray an array populated with Solid Particles objects
|
|
|
+ * @returns the SPS
|
|
|
+ */
|
|
|
+ insertParticlesFromArray(solidParticleArray: SolidParticle[]): SolidParticleSystem;
|
|
|
+ /**
|
|
|
+ * Creates a new particle and modifies the SPS mesh geometry :
|
|
|
+ * - calls _meshBuilder() to increase the SPS mesh geometry step by step
|
|
|
+ * - calls _addParticle() to populate the particle array
|
|
|
+ * factorized code from addShape() and insertParticlesFromArray()
|
|
|
+ * @param idx particle index in the particles array
|
|
|
+ * @param i particle index in its shape
|
|
|
+ * @param modelShape particle ModelShape object
|
|
|
+ * @param shape shape vertex array
|
|
|
+ * @param meshInd shape indices array
|
|
|
+ * @param meshUV shape uv array
|
|
|
+ * @param meshCol shape color array
|
|
|
+ * @param meshNor shape normals array
|
|
|
+ * @param bbInfo shape bounding info
|
|
|
+ * @param storage target particle storage
|
|
|
+ * @options addShape() passed options
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
+ private _insertNewParticle;
|
|
|
+ /**
|
|
|
* Sets all the particles : this method actually really updates the mesh according to the particle positions, rotations, colors, textures, etc.
|
|
|
* This method calls `updateParticle()` for each particle of the SPS.
|
|
|
* For an animated SPS, it is usually called within the render loop.
|
|
@@ -93445,6 +93648,25 @@ declare module BABYLON {
|
|
|
*/
|
|
|
dispose(): void;
|
|
|
/**
|
|
|
+ * Returns a SolidParticle object from its identifier : particle.id
|
|
|
+ * @param id (integer) the particle Id
|
|
|
+ * @returns the searched particle or null if not found in the SPS.
|
|
|
+ */
|
|
|
+ getParticleById(id: number): Nullable<SolidParticle>;
|
|
|
+ /**
|
|
|
+ * Returns a new array populated with the particles having the passed shapeId.
|
|
|
+ * @param shapeId (integer) the shape identifier
|
|
|
+ * @returns a new solid particle array
|
|
|
+ */
|
|
|
+ getParticlesByShapeId(shapeId: number): SolidParticle[];
|
|
|
+ /**
|
|
|
+ * Populates the passed array "ref" with the particles having the passed shapeId.
|
|
|
+ * @param shapeId the shape identifier
|
|
|
+ * @returns the SPS
|
|
|
+ * @param ref
|
|
|
+ */
|
|
|
+ getParticlesByShapeIdToRef(shapeId: number, ref: SolidParticle[]): SolidParticleSystem;
|
|
|
+ /**
|
|
|
* Visibilty helper : Recomputes the visible size according to the mesh bounding box
|
|
|
* doc : http://doc.babylonjs.com/how_to/Solid_Particle_System#sps-visibility
|
|
|
* @returns the SPS.
|
|
@@ -93600,6 +93822,10 @@ declare module BABYLON {
|
|
|
*/
|
|
|
idx: number;
|
|
|
/**
|
|
|
+ * particle identifier
|
|
|
+ */
|
|
|
+ id: number;
|
|
|
+ /**
|
|
|
* The color of the particle
|
|
|
*/
|
|
|
color: Nullable<Color4>;
|
|
@@ -93709,7 +93935,8 @@ declare module BABYLON {
|
|
|
/**
|
|
|
* Creates a Solid Particle object.
|
|
|
* Don't create particles manually, use instead the Solid Particle System internal tools like _addParticle()
|
|
|
- * @param particleIndex (integer) is the particle index in the Solid Particle System pool. It's also the particle identifier.
|
|
|
+ * @param particleIndex (integer) is the particle index in the Solid Particle System pool.
|
|
|
+ * @param particleId (integer) is the particle identifier. Unless some particles are removed from the SPS, it's the same value than the particle idx.
|
|
|
* @param positionIndex (integer) is the starting index of the particle vertices in the SPS "positions" array.
|
|
|
* @param indiceIndex (integer) is the starting index of the particle indices in the SPS "indices" array.
|
|
|
* @param model (ModelShape) is a reference to the model shape on what the particle is designed.
|
|
@@ -93718,7 +93945,13 @@ declare module BABYLON {
|
|
|
* @param sps defines the sps it is associated to
|
|
|
* @param modelBoundingInfo is the reference to the model BoundingInfo used for intersection computations.
|
|
|
*/
|
|
|
- constructor(particleIndex: number, positionIndex: number, indiceIndex: number, model: Nullable<ModelShape>, shapeId: number, idxInShape: number, sps: SolidParticleSystem, modelBoundingInfo?: Nullable<BoundingInfo>);
|
|
|
+ constructor(particleIndex: number, particleId: number, positionIndex: number, indiceIndex: number, model: Nullable<ModelShape>, shapeId: number, idxInShape: number, sps: SolidParticleSystem, modelBoundingInfo?: Nullable<BoundingInfo>);
|
|
|
+ /**
|
|
|
+ * Copies the particle property values into the existing target : position, rotation, scaling, uvs, colors, pivot, parent, visibility, alive
|
|
|
+ * @param target the particle target
|
|
|
+ * @returns the current particle
|
|
|
+ */
|
|
|
+ copyToRef(target: SolidParticle): SolidParticle;
|
|
|
/**
|
|
|
* Legacy support, changed scale to scaling
|
|
|
*/
|