|
@@ -26345,6 +26345,11 @@ declare module "babylonjs/Particles/solidParticleSystem" {
|
|
|
private _isNotBuilt;
|
|
|
private _lastParticleId;
|
|
|
private _idxOfId;
|
|
|
+ private _multimaterialEnabled;
|
|
|
+ private _indicesByMaterial;
|
|
|
+ private _materialIndexes;
|
|
|
+ private _depthSortFunction;
|
|
|
+ private _materialSortFunction;
|
|
|
/**
|
|
|
* Creates a SPS (Solid Particle System) object.
|
|
|
* @param name (String) is the SPS name, this will be the underlying mesh name.
|
|
@@ -26353,6 +26358,7 @@ declare module "babylonjs/Particles/solidParticleSystem" {
|
|
|
* * updatable (optional boolean, default true) : if the SPS must be updatable or immutable.
|
|
|
* * isPickable (optional boolean, default false) : if the solid particles must be pickable.
|
|
|
* * enableDepthSort (optional boolean, default false) : if the solid particles must be sorted in the geometry according to their distance to the camera.
|
|
|
+ * * enableMultiMaterial (optional boolean, default false) : if the solid particles can be given different materials.
|
|
|
* * expandable (optional boolean, default false) : if particles can still be added after the initial SPS mesh creation.
|
|
|
* * particleIntersection (optional boolean, default false) : if the solid particle intersections must be computed.
|
|
|
* * boundingSphereOnly (optional boolean, default false) : if the particle intersection must be computed only with the bounding sphere (no bounding box computation, so faster).
|
|
@@ -26367,6 +26373,7 @@ declare module "babylonjs/Particles/solidParticleSystem" {
|
|
|
boundingSphereOnly?: boolean;
|
|
|
bSphereRadiusFactor?: number;
|
|
|
expandable?: boolean;
|
|
|
+ enableMultiMaterial?: boolean;
|
|
|
});
|
|
|
/**
|
|
|
* Builds the SPS underlying mesh. Returns a standard Mesh.
|
|
@@ -26544,6 +26551,21 @@ declare module "babylonjs/Particles/solidParticleSystem" {
|
|
|
*/
|
|
|
getParticlesByShapeIdToRef(shapeId: number, ref: SolidParticle[]): SolidParticleSystem;
|
|
|
/**
|
|
|
+ * Computes the required SubMeshes according the materials assigned to the particles.
|
|
|
+ * @returns the solid particle system.
|
|
|
+ * Does nothing if called before the SPS mesh is built.
|
|
|
+ */
|
|
|
+ computeSubMeshes(): SolidParticleSystem;
|
|
|
+ /**
|
|
|
+ * Sorts the solid particles by material when MultiMaterial is enabled.
|
|
|
+ * Updates the indices32 array.
|
|
|
+ * Updates the indicesByMaterial array.
|
|
|
+ * Updates the mesh indices array.
|
|
|
+ * @returns the SPS
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
+ private _sortParticlesByMaterial;
|
|
|
+ /**
|
|
|
* 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.
|
|
@@ -26637,6 +26659,10 @@ declare module "babylonjs/Particles/solidParticleSystem" {
|
|
|
*/
|
|
|
readonly expandable: boolean;
|
|
|
/**
|
|
|
+ * Gets if the SPS supports the Multi Materials
|
|
|
+ */
|
|
|
+ readonly multimaterialEnabled: boolean;
|
|
|
+ /**
|
|
|
* This function does nothing. It may be overwritten to set all the particle first values.
|
|
|
* The SPS doesn't call this function, you may have to call it by your own.
|
|
|
* doc : http://doc.babylonjs.com/how_to/Solid_Particle_System#particle-management
|
|
@@ -26802,6 +26828,10 @@ declare module "babylonjs/Particles/solidParticle" {
|
|
|
*/
|
|
|
parentId: Nullable<number>;
|
|
|
/**
|
|
|
+ * The particle material identifier (integer) when MultiMaterials are enabled in the SPS.
|
|
|
+ */
|
|
|
+ materialIndex: Nullable<number>;
|
|
|
+ /**
|
|
|
* The culling strategy to use to check whether the solid particle must be culled or not when using isInFrustum().
|
|
|
* The possible values are :
|
|
|
* - AbstractMesh.CULLINGSTRATEGY_STANDARD
|
|
@@ -26828,8 +26858,9 @@ declare module "babylonjs/Particles/solidParticle" {
|
|
|
* @param idxInShape (integer) is the index of the particle in the current model (ex: the 10th box of addShape(box, 30))
|
|
|
* @param sps defines the sps it is associated to
|
|
|
* @param modelBoundingInfo is the reference to the model BoundingInfo used for intersection computations.
|
|
|
+ * @param materialIndex is the particle material identifier (integer) when the MultiMaterials are enabled in the SPS.
|
|
|
*/
|
|
|
- constructor(particleIndex: number, particleId: 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>, materialIndex?: Nullable<number>);
|
|
|
/**
|
|
|
* Copies the particle property values into the existing target : position, rotation, scaling, uvs, colors, pivot, parent, visibility, alive
|
|
|
* @param target the particle target
|
|
@@ -26929,6 +26960,7 @@ declare module "babylonjs/Particles/solidParticle" {
|
|
|
}
|
|
|
/**
|
|
|
* Represents a Depth Sorted Particle in the solid particle system.
|
|
|
+ * @hidden
|
|
|
*/
|
|
|
export class DepthSortedParticle {
|
|
|
/**
|
|
@@ -26943,6 +26975,15 @@ declare module "babylonjs/Particles/solidParticle" {
|
|
|
* Squared distance from the particle to the camera
|
|
|
*/
|
|
|
sqDistance: number;
|
|
|
+ /**
|
|
|
+ * Material index when used with MultiMaterials
|
|
|
+ */
|
|
|
+ materialIndex: number;
|
|
|
+ /**
|
|
|
+ * Creates a new sorted particle
|
|
|
+ * @param materialIndex
|
|
|
+ */
|
|
|
+ constructor(materialIndex: number);
|
|
|
}
|
|
|
}
|
|
|
declare module "babylonjs/Collisions/meshCollisionData" {
|
|
@@ -94061,6 +94102,11 @@ declare module BABYLON {
|
|
|
private _isNotBuilt;
|
|
|
private _lastParticleId;
|
|
|
private _idxOfId;
|
|
|
+ private _multimaterialEnabled;
|
|
|
+ private _indicesByMaterial;
|
|
|
+ private _materialIndexes;
|
|
|
+ private _depthSortFunction;
|
|
|
+ private _materialSortFunction;
|
|
|
/**
|
|
|
* Creates a SPS (Solid Particle System) object.
|
|
|
* @param name (String) is the SPS name, this will be the underlying mesh name.
|
|
@@ -94069,6 +94115,7 @@ declare module BABYLON {
|
|
|
* * updatable (optional boolean, default true) : if the SPS must be updatable or immutable.
|
|
|
* * isPickable (optional boolean, default false) : if the solid particles must be pickable.
|
|
|
* * enableDepthSort (optional boolean, default false) : if the solid particles must be sorted in the geometry according to their distance to the camera.
|
|
|
+ * * enableMultiMaterial (optional boolean, default false) : if the solid particles can be given different materials.
|
|
|
* * expandable (optional boolean, default false) : if particles can still be added after the initial SPS mesh creation.
|
|
|
* * particleIntersection (optional boolean, default false) : if the solid particle intersections must be computed.
|
|
|
* * boundingSphereOnly (optional boolean, default false) : if the particle intersection must be computed only with the bounding sphere (no bounding box computation, so faster).
|
|
@@ -94083,6 +94130,7 @@ declare module BABYLON {
|
|
|
boundingSphereOnly?: boolean;
|
|
|
bSphereRadiusFactor?: number;
|
|
|
expandable?: boolean;
|
|
|
+ enableMultiMaterial?: boolean;
|
|
|
});
|
|
|
/**
|
|
|
* Builds the SPS underlying mesh. Returns a standard Mesh.
|
|
@@ -94260,6 +94308,21 @@ declare module BABYLON {
|
|
|
*/
|
|
|
getParticlesByShapeIdToRef(shapeId: number, ref: SolidParticle[]): SolidParticleSystem;
|
|
|
/**
|
|
|
+ * Computes the required SubMeshes according the materials assigned to the particles.
|
|
|
+ * @returns the solid particle system.
|
|
|
+ * Does nothing if called before the SPS mesh is built.
|
|
|
+ */
|
|
|
+ computeSubMeshes(): SolidParticleSystem;
|
|
|
+ /**
|
|
|
+ * Sorts the solid particles by material when MultiMaterial is enabled.
|
|
|
+ * Updates the indices32 array.
|
|
|
+ * Updates the indicesByMaterial array.
|
|
|
+ * Updates the mesh indices array.
|
|
|
+ * @returns the SPS
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
+ private _sortParticlesByMaterial;
|
|
|
+ /**
|
|
|
* 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.
|
|
@@ -94353,6 +94416,10 @@ declare module BABYLON {
|
|
|
*/
|
|
|
readonly expandable: boolean;
|
|
|
/**
|
|
|
+ * Gets if the SPS supports the Multi Materials
|
|
|
+ */
|
|
|
+ readonly multimaterialEnabled: boolean;
|
|
|
+ /**
|
|
|
* This function does nothing. It may be overwritten to set all the particle first values.
|
|
|
* The SPS doesn't call this function, you may have to call it by your own.
|
|
|
* doc : http://doc.babylonjs.com/how_to/Solid_Particle_System#particle-management
|
|
@@ -94511,6 +94578,10 @@ declare module BABYLON {
|
|
|
*/
|
|
|
parentId: Nullable<number>;
|
|
|
/**
|
|
|
+ * The particle material identifier (integer) when MultiMaterials are enabled in the SPS.
|
|
|
+ */
|
|
|
+ materialIndex: Nullable<number>;
|
|
|
+ /**
|
|
|
* The culling strategy to use to check whether the solid particle must be culled or not when using isInFrustum().
|
|
|
* The possible values are :
|
|
|
* - AbstractMesh.CULLINGSTRATEGY_STANDARD
|
|
@@ -94537,8 +94608,9 @@ declare module BABYLON {
|
|
|
* @param idxInShape (integer) is the index of the particle in the current model (ex: the 10th box of addShape(box, 30))
|
|
|
* @param sps defines the sps it is associated to
|
|
|
* @param modelBoundingInfo is the reference to the model BoundingInfo used for intersection computations.
|
|
|
+ * @param materialIndex is the particle material identifier (integer) when the MultiMaterials are enabled in the SPS.
|
|
|
*/
|
|
|
- constructor(particleIndex: number, particleId: 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>, materialIndex?: Nullable<number>);
|
|
|
/**
|
|
|
* Copies the particle property values into the existing target : position, rotation, scaling, uvs, colors, pivot, parent, visibility, alive
|
|
|
* @param target the particle target
|
|
@@ -94638,6 +94710,7 @@ declare module BABYLON {
|
|
|
}
|
|
|
/**
|
|
|
* Represents a Depth Sorted Particle in the solid particle system.
|
|
|
+ * @hidden
|
|
|
*/
|
|
|
export class DepthSortedParticle {
|
|
|
/**
|
|
@@ -94652,6 +94725,15 @@ declare module BABYLON {
|
|
|
* Squared distance from the particle to the camera
|
|
|
*/
|
|
|
sqDistance: number;
|
|
|
+ /**
|
|
|
+ * Material index when used with MultiMaterials
|
|
|
+ */
|
|
|
+ materialIndex: number;
|
|
|
+ /**
|
|
|
+ * Creates a new sorted particle
|
|
|
+ * @param materialIndex
|
|
|
+ */
|
|
|
+ constructor(materialIndex: number);
|
|
|
}
|
|
|
}
|
|
|
declare module BABYLON {
|