|
@@ -55835,10 +55835,6 @@ declare module "babylonjs/Materials/Node/nodeMaterialBuildState" {
|
|
*/
|
|
*/
|
|
constants: string[];
|
|
constants: string[];
|
|
/**
|
|
/**
|
|
- * Gets the list of emitted uniform buffers
|
|
|
|
- */
|
|
|
|
- uniformBuffers: string[];
|
|
|
|
- /**
|
|
|
|
* Gets the list of emitted samplers
|
|
* Gets the list of emitted samplers
|
|
*/
|
|
*/
|
|
samplers: string[];
|
|
samplers: string[];
|
|
@@ -55901,6 +55897,8 @@ declare module "babylonjs/Materials/Node/nodeMaterialBuildState" {
|
|
/** @hidden */
|
|
/** @hidden */
|
|
_excludeVariableName(name: string): void;
|
|
_excludeVariableName(name: string): void;
|
|
/** @hidden */
|
|
/** @hidden */
|
|
|
|
+ _emit2DSampler(name: string): void;
|
|
|
|
+ /** @hidden */
|
|
_getGLType(type: NodeMaterialBlockConnectionPointTypes): string;
|
|
_getGLType(type: NodeMaterialBlockConnectionPointTypes): string;
|
|
/** @hidden */
|
|
/** @hidden */
|
|
_emitExtension(name: string, extension: string): void;
|
|
_emitExtension(name: string, extension: string): void;
|
|
@@ -56087,8 +56085,9 @@ declare module "babylonjs/Materials/Node/nodeMaterialBlock" {
|
|
* @param state defines the state to update
|
|
* @param state defines the state to update
|
|
* @param nodeMaterial defines the node material requesting the update
|
|
* @param nodeMaterial defines the node material requesting the update
|
|
* @param defines defines the material defines to update
|
|
* @param defines defines the material defines to update
|
|
|
|
+ * @param uniformBuffers defines the list of uniform buffer names
|
|
*/
|
|
*/
|
|
- updateUniformsAndSamples(state: NodeMaterialBuildState, nodeMaterial: NodeMaterial, defines: NodeMaterialDefines): void;
|
|
|
|
|
|
+ updateUniformsAndSamples(state: NodeMaterialBuildState, nodeMaterial: NodeMaterial, defines: NodeMaterialDefines, uniformBuffers: string[]): void;
|
|
/**
|
|
/**
|
|
* Add potential fallbacks if shader compilation fails
|
|
* Add potential fallbacks if shader compilation fails
|
|
* @param mesh defines the mesh to be rendered
|
|
* @param mesh defines the mesh to be rendered
|
|
@@ -56933,7 +56932,7 @@ declare module "babylonjs/Materials/Node/Blocks/Dual/lightBlock" {
|
|
readonly specularOutput: NodeMaterialConnectionPoint;
|
|
readonly specularOutput: NodeMaterialConnectionPoint;
|
|
autoConfigure(material: NodeMaterial): void;
|
|
autoConfigure(material: NodeMaterial): void;
|
|
prepareDefines(mesh: AbstractMesh, nodeMaterial: NodeMaterial, defines: NodeMaterialDefines): void;
|
|
prepareDefines(mesh: AbstractMesh, nodeMaterial: NodeMaterial, defines: NodeMaterialDefines): void;
|
|
- updateUniformsAndSamples(state: NodeMaterialBuildState, nodeMaterial: NodeMaterial, defines: NodeMaterialDefines): void;
|
|
|
|
|
|
+ updateUniformsAndSamples(state: NodeMaterialBuildState, nodeMaterial: NodeMaterial, defines: NodeMaterialDefines, uniformBuffers: string[]): void;
|
|
bind(effect: Effect, nodeMaterial: NodeMaterial, mesh?: Mesh): void;
|
|
bind(effect: Effect, nodeMaterial: NodeMaterial, mesh?: Mesh): void;
|
|
private _injectVertexCode;
|
|
private _injectVertexCode;
|
|
protected _buildBlock(state: NodeMaterialBuildState): this | undefined;
|
|
protected _buildBlock(state: NodeMaterialBuildState): this | undefined;
|
|
@@ -61311,6 +61310,420 @@ declare module "babylonjs/Particles/particleSystemComponent" {
|
|
*/
|
|
*/
|
|
export var _IDoNeedToBeInTheBuild: number;
|
|
export var _IDoNeedToBeInTheBuild: number;
|
|
}
|
|
}
|
|
|
|
+declare module "babylonjs/Particles/pointsCloudSystem" {
|
|
|
|
+ import { Color4 } from "babylonjs/Maths/math";
|
|
|
|
+ import { Mesh } from "babylonjs/Meshes/mesh";
|
|
|
|
+ import { Scene, IDisposable } from "babylonjs/scene";
|
|
|
|
+ import { CloudPoint } from "babylonjs/Particles/cloudPoint";
|
|
|
|
+ /** Defines the 4 color options */
|
|
|
|
+ export enum PointColor {
|
|
|
|
+ /** color value */
|
|
|
|
+ Color = 2,
|
|
|
|
+ /** uv value */
|
|
|
|
+ UV = 1,
|
|
|
|
+ /** random value */
|
|
|
|
+ Random = 0,
|
|
|
|
+ /** stated value */
|
|
|
|
+ Stated = 3
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * The PointCloudSystem (PCS) is a single updatable mesh. The points corresponding to the vertices of this big mesh.
|
|
|
|
+ * As it is just a mesh, the PointCloudSystem has all the same properties as any other BJS mesh : not more, not less. It can be scaled, rotated, translated, enlighted, textured, moved, etc.
|
|
|
|
+
|
|
|
|
+ * The PointCloudSytem is also a particle system, with each point being a particle. It provides some methods to manage the particles.
|
|
|
|
+ * However it is behavior agnostic. This means it has no emitter, no particle physics, no particle recycler. You have to implement your own behavior.
|
|
|
|
+ *
|
|
|
|
+ * Full documentation here : TO BE ENTERED
|
|
|
|
+ */
|
|
|
|
+ export class PointsCloudSystem implements IDisposable {
|
|
|
|
+ /**
|
|
|
|
+ * The PCS array of cloud point objects. Just access each particle as with any classic array.
|
|
|
|
+ * Example : var p = SPS.particles[i];
|
|
|
|
+ */
|
|
|
|
+ particles: CloudPoint[];
|
|
|
|
+ /**
|
|
|
|
+ * The PCS total number of particles. Read only. Use PCS.counter instead if you need to set your own value.
|
|
|
|
+ */
|
|
|
|
+ nbParticles: number;
|
|
|
|
+ /**
|
|
|
|
+ * This a counter for your own usage. It's not set by any SPS functions.
|
|
|
|
+ */
|
|
|
|
+ counter: number;
|
|
|
|
+ /**
|
|
|
|
+ * The PCS name. This name is also given to the underlying mesh.
|
|
|
|
+ */
|
|
|
|
+ name: string;
|
|
|
|
+ /**
|
|
|
|
+ * The PCS mesh. It's a standard BJS Mesh, so all the methods from the Mesh class are avalaible.
|
|
|
|
+ */
|
|
|
|
+ mesh: Mesh;
|
|
|
|
+ /**
|
|
|
|
+ * This empty object is intended to store some PCS specific or temporary values in order to lower the Garbage Collector activity.
|
|
|
|
+ * Please read :
|
|
|
|
+ */
|
|
|
|
+ vars: any;
|
|
|
|
+ /**
|
|
|
|
+ * @hidden
|
|
|
|
+ */
|
|
|
|
+ _size: number;
|
|
|
|
+ private _scene;
|
|
|
|
+ private _promises;
|
|
|
|
+ private _positions;
|
|
|
|
+ private _indices;
|
|
|
|
+ private _normals;
|
|
|
|
+ private _colors;
|
|
|
|
+ private _uvs;
|
|
|
|
+ private _indices32;
|
|
|
|
+ private _positions32;
|
|
|
|
+ private _colors32;
|
|
|
|
+ private _uvs32;
|
|
|
|
+ private _updatable;
|
|
|
|
+ private _isVisibilityBoxLocked;
|
|
|
|
+ private _alwaysVisible;
|
|
|
|
+ private _groups;
|
|
|
|
+ private _groupCounter;
|
|
|
|
+ private _computeParticleColor;
|
|
|
|
+ private _computeParticleTexture;
|
|
|
|
+ private _computeParticleRotation;
|
|
|
|
+ private _computeBoundingBox;
|
|
|
|
+ private _isReady;
|
|
|
|
+ /**
|
|
|
|
+ * Creates a PCS (Points Cloud System) object
|
|
|
|
+ * @param name (String) is the PCS name, this will be the underlying mesh name
|
|
|
|
+ * @param pointSize (number) is the size for each point
|
|
|
|
+ * @param scene (Scene) is the scene in which the PCS is added
|
|
|
|
+ * @param options defines the options of the PCS e.g.
|
|
|
|
+ * * updatable (optional boolean, default true) : if the PCS must be updatable or immutable
|
|
|
|
+ */
|
|
|
|
+ constructor(name: string, pointSize: number, scene: Scene, options?: {
|
|
|
|
+ updatable?: boolean;
|
|
|
|
+ });
|
|
|
|
+ /**
|
|
|
|
+ * Builds the PCS underlying mesh. Returns a standard Mesh.
|
|
|
|
+ * If no points were added to the PCS, the returned mesh is just a single point.
|
|
|
|
+ * @returns a promise for the created mesh
|
|
|
|
+ */
|
|
|
|
+ buildMeshAsync(): Promise<Mesh>;
|
|
|
|
+ /**
|
|
|
|
+ * @hidden
|
|
|
|
+ */
|
|
|
|
+ private _buildMesh;
|
|
|
|
+ private _addParticle;
|
|
|
|
+ private _randomUnitVector;
|
|
|
|
+ private _getColorIndicesForCoord;
|
|
|
|
+ private _setPointsColorOrUV;
|
|
|
|
+ private _colorFromTexture;
|
|
|
|
+ private _calculateDensity;
|
|
|
|
+ /**
|
|
|
|
+ * Adds points to the PCS in random positions within a unit sphere
|
|
|
|
+ * @param nb (positive integer) the number of particles to be created from this model
|
|
|
|
+ * @param pointFunction is an optional javascript function to be called for each particle on PCS creation
|
|
|
|
+ * @returns the number of groups in the system
|
|
|
|
+ */
|
|
|
|
+ addPoints(nb: number, pointFunction?: any): number;
|
|
|
|
+ /**
|
|
|
|
+ * Adds points to the PCS from the surface of the model shape
|
|
|
|
+ * @param mesh is any Mesh object that will be used as a surface model for the points
|
|
|
|
+ * @param nb (positive integer) the number of particles to be created from this model
|
|
|
|
+ * @param colorWith determines whether a point is colored using color (default), uv, random, stated or none (invisible)
|
|
|
|
+ * @param color (color3) to be used when colorWith is stated
|
|
|
|
+ * @param range (number from 0 to 1) to determine the variation in shape and tone for a stated color
|
|
|
|
+ * @returns the number of groups in the system
|
|
|
|
+ */
|
|
|
|
+ addSurfacePoints(mesh: Mesh, nb: number, colorWith?: number, color?: Color4, range?: number): number;
|
|
|
|
+ /**
|
|
|
|
+ * Adds points to the PCS inside the model shape
|
|
|
|
+ * @param mesh is any Mesh object that will be used as a surface model for the points
|
|
|
|
+ * @param nb (positive integer) the number of particles to be created from this model
|
|
|
|
+ * @param colorWith determines whether a point is colored using color (default), uv, random, stated or none (invisible),
|
|
|
|
+ * @param color (color4) to be used when colorWith is stated
|
|
|
|
+ * @param range (number from 0 to 1) to determine the variation in shape and tone for a stated color
|
|
|
|
+ * @returns the number of groups in the system
|
|
|
|
+ */
|
|
|
|
+ addVolumePoints(mesh: Mesh, nb: number, colorWith?: number, color?: Color4, range?: number): number;
|
|
|
|
+ /**
|
|
|
|
+ * 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.
|
|
|
|
+ * @param start The particle index in the particle array where to start to compute the particle property values _(default 0)_
|
|
|
|
+ * @param end The particle index in the particle array where to stop to compute the particle property values _(default nbParticle - 1)_
|
|
|
|
+ * @param update If the mesh must be finally updated on this call after all the particle computations _(default true)_
|
|
|
|
+ * @returns the PCS.
|
|
|
|
+ */
|
|
|
|
+ setParticles(start?: number, end?: number, update?: boolean): PointsCloudSystem;
|
|
|
|
+ /**
|
|
|
|
+ * Disposes the PCS.
|
|
|
|
+ */
|
|
|
|
+ dispose(): void;
|
|
|
|
+ /**
|
|
|
|
+ * Visibilty helper : Recomputes the visible size according to the mesh bounding box
|
|
|
|
+ * doc :
|
|
|
|
+ * @returns the PCS.
|
|
|
|
+ */
|
|
|
|
+ refreshVisibleSize(): PointsCloudSystem;
|
|
|
|
+ /**
|
|
|
|
+ * Visibility helper : Sets the size of a visibility box, this sets the underlying mesh bounding box.
|
|
|
|
+ * @param size the size (float) of the visibility box
|
|
|
|
+ * note : this doesn't lock the PCS mesh bounding box.
|
|
|
|
+ * doc :
|
|
|
|
+ */
|
|
|
|
+ setVisibilityBox(size: number): void;
|
|
|
|
+ /**
|
|
|
|
+ * Gets whether the PCS is always visible or not
|
|
|
|
+ * doc :
|
|
|
|
+ */
|
|
|
|
+ /**
|
|
|
|
+ * Sets the PCS as always visible or not
|
|
|
|
+ * doc :
|
|
|
|
+ */
|
|
|
|
+ isAlwaysVisible: boolean;
|
|
|
|
+ /**
|
|
|
|
+ * Tells to `setParticles()` to compute the particle rotations or not
|
|
|
|
+ * Default value : false. The PCS is faster when it's set to false
|
|
|
|
+ * Note : particle rotations are only applied to parent particles
|
|
|
|
+ * Note : the particle rotations aren't stored values, so setting `computeParticleRotation` to false will prevents the particle to rotate
|
|
|
|
+ */
|
|
|
|
+ computeParticleRotation: boolean;
|
|
|
|
+ /**
|
|
|
|
+ * Tells to `setParticles()` to compute the particle colors or not.
|
|
|
|
+ * Default value : true. The PCS is faster when it's set to false.
|
|
|
|
+ * Note : the particle colors are stored values, so setting `computeParticleColor` to false will keep yet the last colors set.
|
|
|
|
+ */
|
|
|
|
+ /**
|
|
|
|
+ * Gets if `setParticles()` computes the particle colors or not.
|
|
|
|
+ * Default value : false. The PCS is faster when it's set to false.
|
|
|
|
+ * Note : the particle colors are stored values, so setting `computeParticleColor` to false will keep yet the last colors set.
|
|
|
|
+ */
|
|
|
|
+ computeParticleColor: boolean;
|
|
|
|
+ /**
|
|
|
|
+ * Gets if `setParticles()` computes the particle textures or not.
|
|
|
|
+ * Default value : false. The PCS is faster when it's set to false.
|
|
|
|
+ * Note : the particle textures are stored values, so setting `computeParticleTexture` to false will keep yet the last colors set.
|
|
|
|
+ */
|
|
|
|
+ computeParticleTexture: boolean;
|
|
|
|
+ /**
|
|
|
|
+ * Tells to `setParticles()` to compute or not the mesh bounding box when computing the particle positions.
|
|
|
|
+ */
|
|
|
|
+ /**
|
|
|
|
+ * Gets if `setParticles()` computes or not the mesh bounding box when computing the particle positions.
|
|
|
|
+ */
|
|
|
|
+ computeBoundingBox: boolean;
|
|
|
|
+ /**
|
|
|
|
+ * This function does nothing. It may be overwritten to set all the particle first values.
|
|
|
|
+ * The PCS doesn't call this function, you may have to call it by your own.
|
|
|
|
+ * doc :
|
|
|
|
+ */
|
|
|
|
+ initParticles(): void;
|
|
|
|
+ /**
|
|
|
|
+ * This function does nothing. It may be overwritten to recycle a particle
|
|
|
|
+ * The PCS doesn't call this function, you can to call it
|
|
|
|
+ * doc :
|
|
|
|
+ * @param particle The particle to recycle
|
|
|
|
+ * @returns the recycled particle
|
|
|
|
+ */
|
|
|
|
+ recycleParticle(particle: CloudPoint): CloudPoint;
|
|
|
|
+ /**
|
|
|
|
+ * Updates a particle : this function should be overwritten by the user.
|
|
|
|
+ * It is called on each particle by `setParticles()`. This is the place to code each particle behavior.
|
|
|
|
+ * doc :
|
|
|
|
+ * @example : just set a particle position or velocity and recycle conditions
|
|
|
|
+ * @param particle The particle to update
|
|
|
|
+ * @returns the updated particle
|
|
|
|
+ */
|
|
|
|
+ updateParticle(particle: CloudPoint): CloudPoint;
|
|
|
|
+ /**
|
|
|
|
+ * This will be called before any other treatment by `setParticles()` and will be passed three parameters.
|
|
|
|
+ * This does nothing and may be overwritten by the user.
|
|
|
|
+ * @param start the particle index in the particle array where to start to iterate, same than the value passed to setParticle()
|
|
|
|
+ * @param stop the particle index in the particle array where to stop to iterate, same than the value passed to setParticle()
|
|
|
|
+ * @param update the boolean update value actually passed to setParticles()
|
|
|
|
+ */
|
|
|
|
+ beforeUpdateParticles(start?: number, stop?: number, update?: boolean): void;
|
|
|
|
+ /**
|
|
|
|
+ * This will be called by `setParticles()` after all the other treatments and just before the actual mesh update.
|
|
|
|
+ * This will be passed three parameters.
|
|
|
|
+ * This does nothing and may be overwritten by the user.
|
|
|
|
+ * @param start the particle index in the particle array where to start to iterate, same than the value passed to setParticle()
|
|
|
|
+ * @param stop the particle index in the particle array where to stop to iterate, same than the value passed to setParticle()
|
|
|
|
+ * @param update the boolean update value actually passed to setParticles()
|
|
|
|
+ */
|
|
|
|
+ afterUpdateParticles(start?: number, stop?: number, update?: boolean): void;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+declare module "babylonjs/Particles/cloudPoint" {
|
|
|
|
+ import { Nullable } from "babylonjs/types";
|
|
|
|
+ import { Color4, Vector2, Vector3, Matrix, Quaternion } from "babylonjs/Maths/math";
|
|
|
|
+ import { Mesh } from "babylonjs/Meshes/mesh";
|
|
|
|
+ import { BoundingInfo } from "babylonjs/Culling/boundingInfo";
|
|
|
|
+ import { PointsCloudSystem } from "babylonjs/Particles/pointsCloudSystem";
|
|
|
|
+ /**
|
|
|
|
+ * Represents one particle of a points cloud system.
|
|
|
|
+ */
|
|
|
|
+ export class CloudPoint {
|
|
|
|
+ /**
|
|
|
|
+ * particle global index
|
|
|
|
+ */
|
|
|
|
+ idx: number;
|
|
|
|
+ /**
|
|
|
|
+ * The color of the particle
|
|
|
|
+ */
|
|
|
|
+ color: Nullable<Color4>;
|
|
|
|
+ /**
|
|
|
|
+ * The world space position of the particle.
|
|
|
|
+ */
|
|
|
|
+ position: Vector3;
|
|
|
|
+ /**
|
|
|
|
+ * The world space rotation of the particle. (Not use if rotationQuaternion is set)
|
|
|
|
+ */
|
|
|
|
+ rotation: Vector3;
|
|
|
|
+ /**
|
|
|
|
+ * The world space rotation quaternion of the particle.
|
|
|
|
+ */
|
|
|
|
+ rotationQuaternion: Nullable<Quaternion>;
|
|
|
|
+ /**
|
|
|
|
+ * The uv of the particle.
|
|
|
|
+ */
|
|
|
|
+ uv: Nullable<Vector2>;
|
|
|
|
+ /**
|
|
|
|
+ * The current speed of the particle.
|
|
|
|
+ */
|
|
|
|
+ velocity: Vector3;
|
|
|
|
+ /**
|
|
|
|
+ * The pivot point in the particle local space.
|
|
|
|
+ */
|
|
|
|
+ pivot: Vector3;
|
|
|
|
+ /**
|
|
|
|
+ * Must the particle be translated from its pivot point in its local space ?
|
|
|
|
+ * In this case, the pivot point is set at the origin of the particle local space and the particle is translated.
|
|
|
|
+ * Default : false
|
|
|
|
+ */
|
|
|
|
+ translateFromPivot: boolean;
|
|
|
|
+ /**
|
|
|
|
+ * Index of this particle in the global "positions" array (Internal use)
|
|
|
|
+ * @hidden
|
|
|
|
+ */
|
|
|
|
+ _pos: number;
|
|
|
|
+ /**
|
|
|
|
+ * @hidden Index of this particle in the global "indices" array (Internal use)
|
|
|
|
+ */
|
|
|
|
+ _ind: number;
|
|
|
|
+ /**
|
|
|
|
+ * Group this particle belongs to
|
|
|
|
+ */
|
|
|
|
+ _group: PointsGroup;
|
|
|
|
+ /**
|
|
|
|
+ * Group id of this particle
|
|
|
|
+ */
|
|
|
|
+ groupId: number;
|
|
|
|
+ /**
|
|
|
|
+ * Index of the particle in its group id (Internal use)
|
|
|
|
+ */
|
|
|
|
+ idxInGroup: number;
|
|
|
|
+ /**
|
|
|
|
+ * @hidden Particle BoundingInfo object (Internal use)
|
|
|
|
+ */
|
|
|
|
+ _boundingInfo: BoundingInfo;
|
|
|
|
+ /**
|
|
|
|
+ * @hidden Reference to the PCS that the particle belongs to (Internal use)
|
|
|
|
+ */
|
|
|
|
+ _pcs: PointsCloudSystem;
|
|
|
|
+ /**
|
|
|
|
+ * @hidden Still set as invisible in order to skip useless computations (Internal use)
|
|
|
|
+ */
|
|
|
|
+ _stillInvisible: boolean;
|
|
|
|
+ /**
|
|
|
|
+ * @hidden Last computed particle rotation matrix
|
|
|
|
+ */
|
|
|
|
+ _rotationMatrix: number[];
|
|
|
|
+ /**
|
|
|
|
+ * Parent particle Id, if any.
|
|
|
|
+ * Default null.
|
|
|
|
+ */
|
|
|
|
+ parentId: Nullable<number>;
|
|
|
|
+ /**
|
|
|
|
+ * @hidden Internal global position in the PCS.
|
|
|
|
+ */
|
|
|
|
+ _globalPosition: Vector3;
|
|
|
|
+ /**
|
|
|
|
+ * Creates a Point Cloud object.
|
|
|
|
+ * Don't create particles manually, use instead the PCS internal tools like _addParticle()
|
|
|
|
+ * @param particleIndex (integer) is the particle index in the PCS pool. It's also the particle identifier.
|
|
|
|
+ * @param group (PointsGroup) is the group the particle belongs to
|
|
|
|
+ * @param groupId (integer) is the group identifier in the PCS.
|
|
|
|
+ * @param idxInGroup (integer) is the index of the particle in the current point group (ex: the 10th point of addPoints(30))
|
|
|
|
+ * @param pcs defines the PCS it is associated to
|
|
|
|
+ */
|
|
|
|
+ constructor(particleIndex: number, group: PointsGroup, groupId: number, idxInGroup: number, pcs: PointsCloudSystem);
|
|
|
|
+ /**
|
|
|
|
+ * get point size
|
|
|
|
+ */
|
|
|
|
+ /**
|
|
|
|
+ * Set point size
|
|
|
|
+ */
|
|
|
|
+ size: Vector3;
|
|
|
|
+ /**
|
|
|
|
+ * Legacy support, changed quaternion to rotationQuaternion
|
|
|
|
+ */
|
|
|
|
+ /**
|
|
|
|
+ * Legacy support, changed quaternion to rotationQuaternion
|
|
|
|
+ */
|
|
|
|
+ quaternion: Nullable<Quaternion>;
|
|
|
|
+ /**
|
|
|
|
+ * Returns a boolean. True if the particle intersects another particle or another mesh, else false.
|
|
|
|
+ * The intersection is computed on the particle bounding sphere and Axis Aligned Bounding Box (AABB)
|
|
|
|
+ * @param target is the object (point or mesh) what the intersection is computed against.
|
|
|
|
+ * @returns true if it intersects
|
|
|
|
+ */
|
|
|
|
+ intersectsMesh(target: Mesh | CloudPoint): boolean;
|
|
|
|
+ /**
|
|
|
|
+ * get the rotation matrix of the particle
|
|
|
|
+ * @hidden
|
|
|
|
+ */
|
|
|
|
+ getRotationMatrix(m: Matrix): void;
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * Represents a group of points in a points cloud system
|
|
|
|
+ * * PCS internal tool, don't use it manually.
|
|
|
|
+ */
|
|
|
|
+ export class PointsGroup {
|
|
|
|
+ /**
|
|
|
|
+ * The group id
|
|
|
|
+ * @hidden
|
|
|
|
+ */
|
|
|
|
+ groupID: number;
|
|
|
|
+ /**
|
|
|
|
+ * image data for group (internal use)
|
|
|
|
+ * @hidden
|
|
|
|
+ */
|
|
|
|
+ _groupImageData: Nullable<ArrayBufferView>;
|
|
|
|
+ /**
|
|
|
|
+ * Image Width (internal use)
|
|
|
|
+ * @hidden
|
|
|
|
+ */
|
|
|
|
+ _groupImgWidth: number;
|
|
|
|
+ /**
|
|
|
|
+ * Image Height (internal use)
|
|
|
|
+ * @hidden
|
|
|
|
+ */
|
|
|
|
+ _groupImgHeight: number;
|
|
|
|
+ /**
|
|
|
|
+ * Custom position function (internal use)
|
|
|
|
+ * @hidden
|
|
|
|
+ */
|
|
|
|
+ _positionFunction: Nullable<(particle: CloudPoint, i?: number, s?: number) => void>;
|
|
|
|
+ /**
|
|
|
|
+ * density per facet for surface points
|
|
|
|
+ * @hidden
|
|
|
|
+ */
|
|
|
|
+ _groupDensity: number[];
|
|
|
|
+ /**
|
|
|
|
+ * Creates a points group object. This is an internal reference to produce particles for the PCS.
|
|
|
|
+ * PCS internal tool, don't use it manually.
|
|
|
|
+ * @hidden
|
|
|
|
+ */
|
|
|
|
+ constructor(id: number, posFunction: Nullable<(particle: CloudPoint, i?: number, s?: number) => void>);
|
|
|
|
+ }
|
|
|
|
+}
|
|
declare module "babylonjs/Particles/index" {
|
|
declare module "babylonjs/Particles/index" {
|
|
export * from "babylonjs/Particles/baseParticleSystem";
|
|
export * from "babylonjs/Particles/baseParticleSystem";
|
|
export * from "babylonjs/Particles/EmitterTypes/index";
|
|
export * from "babylonjs/Particles/EmitterTypes/index";
|
|
@@ -61323,6 +61736,8 @@ declare module "babylonjs/Particles/index" {
|
|
export * from "babylonjs/Particles/particleSystemSet";
|
|
export * from "babylonjs/Particles/particleSystemSet";
|
|
export * from "babylonjs/Particles/solidParticle";
|
|
export * from "babylonjs/Particles/solidParticle";
|
|
export * from "babylonjs/Particles/solidParticleSystem";
|
|
export * from "babylonjs/Particles/solidParticleSystem";
|
|
|
|
+ export * from "babylonjs/Particles/cloudPoint";
|
|
|
|
+ export * from "babylonjs/Particles/pointsCloudSystem";
|
|
export * from "babylonjs/Particles/subEmitter";
|
|
export * from "babylonjs/Particles/subEmitter";
|
|
}
|
|
}
|
|
declare module "babylonjs/Physics/physicsEngineComponent" {
|
|
declare module "babylonjs/Physics/physicsEngineComponent" {
|
|
@@ -120140,10 +120555,6 @@ declare module BABYLON {
|
|
*/
|
|
*/
|
|
constants: string[];
|
|
constants: string[];
|
|
/**
|
|
/**
|
|
- * Gets the list of emitted uniform buffers
|
|
|
|
- */
|
|
|
|
- uniformBuffers: string[];
|
|
|
|
- /**
|
|
|
|
* Gets the list of emitted samplers
|
|
* Gets the list of emitted samplers
|
|
*/
|
|
*/
|
|
samplers: string[];
|
|
samplers: string[];
|
|
@@ -120206,6 +120617,8 @@ declare module BABYLON {
|
|
/** @hidden */
|
|
/** @hidden */
|
|
_excludeVariableName(name: string): void;
|
|
_excludeVariableName(name: string): void;
|
|
/** @hidden */
|
|
/** @hidden */
|
|
|
|
+ _emit2DSampler(name: string): void;
|
|
|
|
+ /** @hidden */
|
|
_getGLType(type: NodeMaterialBlockConnectionPointTypes): string;
|
|
_getGLType(type: NodeMaterialBlockConnectionPointTypes): string;
|
|
/** @hidden */
|
|
/** @hidden */
|
|
_emitExtension(name: string, extension: string): void;
|
|
_emitExtension(name: string, extension: string): void;
|
|
@@ -120381,8 +120794,9 @@ declare module BABYLON {
|
|
* @param state defines the state to update
|
|
* @param state defines the state to update
|
|
* @param nodeMaterial defines the node material requesting the update
|
|
* @param nodeMaterial defines the node material requesting the update
|
|
* @param defines defines the material defines to update
|
|
* @param defines defines the material defines to update
|
|
|
|
+ * @param uniformBuffers defines the list of uniform buffer names
|
|
*/
|
|
*/
|
|
- updateUniformsAndSamples(state: NodeMaterialBuildState, nodeMaterial: NodeMaterial, defines: NodeMaterialDefines): void;
|
|
|
|
|
|
+ updateUniformsAndSamples(state: NodeMaterialBuildState, nodeMaterial: NodeMaterial, defines: NodeMaterialDefines, uniformBuffers: string[]): void;
|
|
/**
|
|
/**
|
|
* Add potential fallbacks if shader compilation fails
|
|
* Add potential fallbacks if shader compilation fails
|
|
* @param mesh defines the mesh to be rendered
|
|
* @param mesh defines the mesh to be rendered
|
|
@@ -121116,7 +121530,7 @@ declare module BABYLON {
|
|
readonly specularOutput: NodeMaterialConnectionPoint;
|
|
readonly specularOutput: NodeMaterialConnectionPoint;
|
|
autoConfigure(material: NodeMaterial): void;
|
|
autoConfigure(material: NodeMaterial): void;
|
|
prepareDefines(mesh: AbstractMesh, nodeMaterial: NodeMaterial, defines: NodeMaterialDefines): void;
|
|
prepareDefines(mesh: AbstractMesh, nodeMaterial: NodeMaterial, defines: NodeMaterialDefines): void;
|
|
- updateUniformsAndSamples(state: NodeMaterialBuildState, nodeMaterial: NodeMaterial, defines: NodeMaterialDefines): void;
|
|
|
|
|
|
+ updateUniformsAndSamples(state: NodeMaterialBuildState, nodeMaterial: NodeMaterial, defines: NodeMaterialDefines, uniformBuffers: string[]): void;
|
|
bind(effect: Effect, nodeMaterial: NodeMaterial, mesh?: Mesh): void;
|
|
bind(effect: Effect, nodeMaterial: NodeMaterial, mesh?: Mesh): void;
|
|
private _injectVertexCode;
|
|
private _injectVertexCode;
|
|
protected _buildBlock(state: NodeMaterialBuildState): this | undefined;
|
|
protected _buildBlock(state: NodeMaterialBuildState): this | undefined;
|
|
@@ -125104,6 +125518,410 @@ declare module BABYLON {
|
|
export var _IDoNeedToBeInTheBuild: number;
|
|
export var _IDoNeedToBeInTheBuild: number;
|
|
}
|
|
}
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
|
|
+ /** Defines the 4 color options */
|
|
|
|
+ export enum PointColor {
|
|
|
|
+ /** color value */
|
|
|
|
+ Color = 2,
|
|
|
|
+ /** uv value */
|
|
|
|
+ UV = 1,
|
|
|
|
+ /** random value */
|
|
|
|
+ Random = 0,
|
|
|
|
+ /** stated value */
|
|
|
|
+ Stated = 3
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * The PointCloudSystem (PCS) is a single updatable mesh. The points corresponding to the vertices of this big mesh.
|
|
|
|
+ * As it is just a mesh, the PointCloudSystem has all the same properties as any other BJS mesh : not more, not less. It can be scaled, rotated, translated, enlighted, textured, moved, etc.
|
|
|
|
+ * The PointCloudSytem is also a particle system, with each point being a particle. It provides some methods to manage the particles.
|
|
|
|
+ * However it is behavior agnostic. This means it has no emitter, no particle physics, no particle recycler. You have to implement your own behavior.
|
|
|
|
+ *
|
|
|
|
+ * Full documentation here : TO BE ENTERED
|
|
|
|
+ */
|
|
|
|
+ export class PointsCloudSystem implements IDisposable {
|
|
|
|
+ /**
|
|
|
|
+ * The PCS array of cloud point objects. Just access each particle as with any classic array.
|
|
|
|
+ * Example : var p = SPS.particles[i];
|
|
|
|
+ */
|
|
|
|
+ particles: CloudPoint[];
|
|
|
|
+ /**
|
|
|
|
+ * The PCS total number of particles. Read only. Use PCS.counter instead if you need to set your own value.
|
|
|
|
+ */
|
|
|
|
+ nbParticles: number;
|
|
|
|
+ /**
|
|
|
|
+ * This a counter for your own usage. It's not set by any SPS functions.
|
|
|
|
+ */
|
|
|
|
+ counter: number;
|
|
|
|
+ /**
|
|
|
|
+ * The PCS name. This name is also given to the underlying mesh.
|
|
|
|
+ */
|
|
|
|
+ name: string;
|
|
|
|
+ /**
|
|
|
|
+ * The PCS mesh. It's a standard BJS Mesh, so all the methods from the Mesh class are avalaible.
|
|
|
|
+ */
|
|
|
|
+ mesh: Mesh;
|
|
|
|
+ /**
|
|
|
|
+ * This empty object is intended to store some PCS specific or temporary values in order to lower the Garbage Collector activity.
|
|
|
|
+ * Please read :
|
|
|
|
+ */
|
|
|
|
+ vars: any;
|
|
|
|
+ /**
|
|
|
|
+ * @hidden
|
|
|
|
+ */
|
|
|
|
+ _size: number;
|
|
|
|
+ private _scene;
|
|
|
|
+ private _promises;
|
|
|
|
+ private _positions;
|
|
|
|
+ private _indices;
|
|
|
|
+ private _normals;
|
|
|
|
+ private _colors;
|
|
|
|
+ private _uvs;
|
|
|
|
+ private _indices32;
|
|
|
|
+ private _positions32;
|
|
|
|
+ private _colors32;
|
|
|
|
+ private _uvs32;
|
|
|
|
+ private _updatable;
|
|
|
|
+ private _isVisibilityBoxLocked;
|
|
|
|
+ private _alwaysVisible;
|
|
|
|
+ private _groups;
|
|
|
|
+ private _groupCounter;
|
|
|
|
+ private _computeParticleColor;
|
|
|
|
+ private _computeParticleTexture;
|
|
|
|
+ private _computeParticleRotation;
|
|
|
|
+ private _computeBoundingBox;
|
|
|
|
+ private _isReady;
|
|
|
|
+ /**
|
|
|
|
+ * Creates a PCS (Points Cloud System) object
|
|
|
|
+ * @param name (String) is the PCS name, this will be the underlying mesh name
|
|
|
|
+ * @param pointSize (number) is the size for each point
|
|
|
|
+ * @param scene (Scene) is the scene in which the PCS is added
|
|
|
|
+ * @param options defines the options of the PCS e.g.
|
|
|
|
+ * * updatable (optional boolean, default true) : if the PCS must be updatable or immutable
|
|
|
|
+ */
|
|
|
|
+ constructor(name: string, pointSize: number, scene: Scene, options?: {
|
|
|
|
+ updatable?: boolean;
|
|
|
|
+ });
|
|
|
|
+ /**
|
|
|
|
+ * Builds the PCS underlying mesh. Returns a standard Mesh.
|
|
|
|
+ * If no points were added to the PCS, the returned mesh is just a single point.
|
|
|
|
+ * @returns a promise for the created mesh
|
|
|
|
+ */
|
|
|
|
+ buildMeshAsync(): Promise<Mesh>;
|
|
|
|
+ /**
|
|
|
|
+ * @hidden
|
|
|
|
+ */
|
|
|
|
+ private _buildMesh;
|
|
|
|
+ private _addParticle;
|
|
|
|
+ private _randomUnitVector;
|
|
|
|
+ private _getColorIndicesForCoord;
|
|
|
|
+ private _setPointsColorOrUV;
|
|
|
|
+ private _colorFromTexture;
|
|
|
|
+ private _calculateDensity;
|
|
|
|
+ /**
|
|
|
|
+ * Adds points to the PCS in random positions within a unit sphere
|
|
|
|
+ * @param nb (positive integer) the number of particles to be created from this model
|
|
|
|
+ * @param pointFunction is an optional javascript function to be called for each particle on PCS creation
|
|
|
|
+ * @returns the number of groups in the system
|
|
|
|
+ */
|
|
|
|
+ addPoints(nb: number, pointFunction?: any): number;
|
|
|
|
+ /**
|
|
|
|
+ * Adds points to the PCS from the surface of the model shape
|
|
|
|
+ * @param mesh is any Mesh object that will be used as a surface model for the points
|
|
|
|
+ * @param nb (positive integer) the number of particles to be created from this model
|
|
|
|
+ * @param colorWith determines whether a point is colored using color (default), uv, random, stated or none (invisible)
|
|
|
|
+ * @param color (color3) to be used when colorWith is stated
|
|
|
|
+ * @param range (number from 0 to 1) to determine the variation in shape and tone for a stated color
|
|
|
|
+ * @returns the number of groups in the system
|
|
|
|
+ */
|
|
|
|
+ addSurfacePoints(mesh: Mesh, nb: number, colorWith?: number, color?: Color4, range?: number): number;
|
|
|
|
+ /**
|
|
|
|
+ * Adds points to the PCS inside the model shape
|
|
|
|
+ * @param mesh is any Mesh object that will be used as a surface model for the points
|
|
|
|
+ * @param nb (positive integer) the number of particles to be created from this model
|
|
|
|
+ * @param colorWith determines whether a point is colored using color (default), uv, random, stated or none (invisible),
|
|
|
|
+ * @param color (color4) to be used when colorWith is stated
|
|
|
|
+ * @param range (number from 0 to 1) to determine the variation in shape and tone for a stated color
|
|
|
|
+ * @returns the number of groups in the system
|
|
|
|
+ */
|
|
|
|
+ addVolumePoints(mesh: Mesh, nb: number, colorWith?: number, color?: Color4, range?: number): number;
|
|
|
|
+ /**
|
|
|
|
+ * 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.
|
|
|
|
+ * @param start The particle index in the particle array where to start to compute the particle property values _(default 0)_
|
|
|
|
+ * @param end The particle index in the particle array where to stop to compute the particle property values _(default nbParticle - 1)_
|
|
|
|
+ * @param update If the mesh must be finally updated on this call after all the particle computations _(default true)_
|
|
|
|
+ * @returns the PCS.
|
|
|
|
+ */
|
|
|
|
+ setParticles(start?: number, end?: number, update?: boolean): PointsCloudSystem;
|
|
|
|
+ /**
|
|
|
|
+ * Disposes the PCS.
|
|
|
|
+ */
|
|
|
|
+ dispose(): void;
|
|
|
|
+ /**
|
|
|
|
+ * Visibilty helper : Recomputes the visible size according to the mesh bounding box
|
|
|
|
+ * doc :
|
|
|
|
+ * @returns the PCS.
|
|
|
|
+ */
|
|
|
|
+ refreshVisibleSize(): PointsCloudSystem;
|
|
|
|
+ /**
|
|
|
|
+ * Visibility helper : Sets the size of a visibility box, this sets the underlying mesh bounding box.
|
|
|
|
+ * @param size the size (float) of the visibility box
|
|
|
|
+ * note : this doesn't lock the PCS mesh bounding box.
|
|
|
|
+ * doc :
|
|
|
|
+ */
|
|
|
|
+ setVisibilityBox(size: number): void;
|
|
|
|
+ /**
|
|
|
|
+ * Gets whether the PCS is always visible or not
|
|
|
|
+ * doc :
|
|
|
|
+ */
|
|
|
|
+ /**
|
|
|
|
+ * Sets the PCS as always visible or not
|
|
|
|
+ * doc :
|
|
|
|
+ */
|
|
|
|
+ isAlwaysVisible: boolean;
|
|
|
|
+ /**
|
|
|
|
+ * Tells to `setParticles()` to compute the particle rotations or not
|
|
|
|
+ * Default value : false. The PCS is faster when it's set to false
|
|
|
|
+ * Note : particle rotations are only applied to parent particles
|
|
|
|
+ * Note : the particle rotations aren't stored values, so setting `computeParticleRotation` to false will prevents the particle to rotate
|
|
|
|
+ */
|
|
|
|
+ computeParticleRotation: boolean;
|
|
|
|
+ /**
|
|
|
|
+ * Tells to `setParticles()` to compute the particle colors or not.
|
|
|
|
+ * Default value : true. The PCS is faster when it's set to false.
|
|
|
|
+ * Note : the particle colors are stored values, so setting `computeParticleColor` to false will keep yet the last colors set.
|
|
|
|
+ */
|
|
|
|
+ /**
|
|
|
|
+ * Gets if `setParticles()` computes the particle colors or not.
|
|
|
|
+ * Default value : false. The PCS is faster when it's set to false.
|
|
|
|
+ * Note : the particle colors are stored values, so setting `computeParticleColor` to false will keep yet the last colors set.
|
|
|
|
+ */
|
|
|
|
+ computeParticleColor: boolean;
|
|
|
|
+ /**
|
|
|
|
+ * Gets if `setParticles()` computes the particle textures or not.
|
|
|
|
+ * Default value : false. The PCS is faster when it's set to false.
|
|
|
|
+ * Note : the particle textures are stored values, so setting `computeParticleTexture` to false will keep yet the last colors set.
|
|
|
|
+ */
|
|
|
|
+ computeParticleTexture: boolean;
|
|
|
|
+ /**
|
|
|
|
+ * Tells to `setParticles()` to compute or not the mesh bounding box when computing the particle positions.
|
|
|
|
+ */
|
|
|
|
+ /**
|
|
|
|
+ * Gets if `setParticles()` computes or not the mesh bounding box when computing the particle positions.
|
|
|
|
+ */
|
|
|
|
+ computeBoundingBox: boolean;
|
|
|
|
+ /**
|
|
|
|
+ * This function does nothing. It may be overwritten to set all the particle first values.
|
|
|
|
+ * The PCS doesn't call this function, you may have to call it by your own.
|
|
|
|
+ * doc :
|
|
|
|
+ */
|
|
|
|
+ initParticles(): void;
|
|
|
|
+ /**
|
|
|
|
+ * This function does nothing. It may be overwritten to recycle a particle
|
|
|
|
+ * The PCS doesn't call this function, you can to call it
|
|
|
|
+ * doc :
|
|
|
|
+ * @param particle The particle to recycle
|
|
|
|
+ * @returns the recycled particle
|
|
|
|
+ */
|
|
|
|
+ recycleParticle(particle: CloudPoint): CloudPoint;
|
|
|
|
+ /**
|
|
|
|
+ * Updates a particle : this function should be overwritten by the user.
|
|
|
|
+ * It is called on each particle by `setParticles()`. This is the place to code each particle behavior.
|
|
|
|
+ * doc :
|
|
|
|
+ * @example : just set a particle position or velocity and recycle conditions
|
|
|
|
+ * @param particle The particle to update
|
|
|
|
+ * @returns the updated particle
|
|
|
|
+ */
|
|
|
|
+ updateParticle(particle: CloudPoint): CloudPoint;
|
|
|
|
+ /**
|
|
|
|
+ * This will be called before any other treatment by `setParticles()` and will be passed three parameters.
|
|
|
|
+ * This does nothing and may be overwritten by the user.
|
|
|
|
+ * @param start the particle index in the particle array where to start to iterate, same than the value passed to setParticle()
|
|
|
|
+ * @param stop the particle index in the particle array where to stop to iterate, same than the value passed to setParticle()
|
|
|
|
+ * @param update the boolean update value actually passed to setParticles()
|
|
|
|
+ */
|
|
|
|
+ beforeUpdateParticles(start?: number, stop?: number, update?: boolean): void;
|
|
|
|
+ /**
|
|
|
|
+ * This will be called by `setParticles()` after all the other treatments and just before the actual mesh update.
|
|
|
|
+ * This will be passed three parameters.
|
|
|
|
+ * This does nothing and may be overwritten by the user.
|
|
|
|
+ * @param start the particle index in the particle array where to start to iterate, same than the value passed to setParticle()
|
|
|
|
+ * @param stop the particle index in the particle array where to stop to iterate, same than the value passed to setParticle()
|
|
|
|
+ * @param update the boolean update value actually passed to setParticles()
|
|
|
|
+ */
|
|
|
|
+ afterUpdateParticles(start?: number, stop?: number, update?: boolean): void;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+declare module BABYLON {
|
|
|
|
+ /**
|
|
|
|
+ * Represents one particle of a points cloud system.
|
|
|
|
+ */
|
|
|
|
+ export class CloudPoint {
|
|
|
|
+ /**
|
|
|
|
+ * particle global index
|
|
|
|
+ */
|
|
|
|
+ idx: number;
|
|
|
|
+ /**
|
|
|
|
+ * The color of the particle
|
|
|
|
+ */
|
|
|
|
+ color: Nullable<Color4>;
|
|
|
|
+ /**
|
|
|
|
+ * The world space position of the particle.
|
|
|
|
+ */
|
|
|
|
+ position: Vector3;
|
|
|
|
+ /**
|
|
|
|
+ * The world space rotation of the particle. (Not use if rotationQuaternion is set)
|
|
|
|
+ */
|
|
|
|
+ rotation: Vector3;
|
|
|
|
+ /**
|
|
|
|
+ * The world space rotation quaternion of the particle.
|
|
|
|
+ */
|
|
|
|
+ rotationQuaternion: Nullable<Quaternion>;
|
|
|
|
+ /**
|
|
|
|
+ * The uv of the particle.
|
|
|
|
+ */
|
|
|
|
+ uv: Nullable<Vector2>;
|
|
|
|
+ /**
|
|
|
|
+ * The current speed of the particle.
|
|
|
|
+ */
|
|
|
|
+ velocity: Vector3;
|
|
|
|
+ /**
|
|
|
|
+ * The pivot point in the particle local space.
|
|
|
|
+ */
|
|
|
|
+ pivot: Vector3;
|
|
|
|
+ /**
|
|
|
|
+ * Must the particle be translated from its pivot point in its local space ?
|
|
|
|
+ * In this case, the pivot point is set at the origin of the particle local space and the particle is translated.
|
|
|
|
+ * Default : false
|
|
|
|
+ */
|
|
|
|
+ translateFromPivot: boolean;
|
|
|
|
+ /**
|
|
|
|
+ * Index of this particle in the global "positions" array (Internal use)
|
|
|
|
+ * @hidden
|
|
|
|
+ */
|
|
|
|
+ _pos: number;
|
|
|
|
+ /**
|
|
|
|
+ * @hidden Index of this particle in the global "indices" array (Internal use)
|
|
|
|
+ */
|
|
|
|
+ _ind: number;
|
|
|
|
+ /**
|
|
|
|
+ * Group this particle belongs to
|
|
|
|
+ */
|
|
|
|
+ _group: PointsGroup;
|
|
|
|
+ /**
|
|
|
|
+ * Group id of this particle
|
|
|
|
+ */
|
|
|
|
+ groupId: number;
|
|
|
|
+ /**
|
|
|
|
+ * Index of the particle in its group id (Internal use)
|
|
|
|
+ */
|
|
|
|
+ idxInGroup: number;
|
|
|
|
+ /**
|
|
|
|
+ * @hidden Particle BoundingInfo object (Internal use)
|
|
|
|
+ */
|
|
|
|
+ _boundingInfo: BoundingInfo;
|
|
|
|
+ /**
|
|
|
|
+ * @hidden Reference to the PCS that the particle belongs to (Internal use)
|
|
|
|
+ */
|
|
|
|
+ _pcs: PointsCloudSystem;
|
|
|
|
+ /**
|
|
|
|
+ * @hidden Still set as invisible in order to skip useless computations (Internal use)
|
|
|
|
+ */
|
|
|
|
+ _stillInvisible: boolean;
|
|
|
|
+ /**
|
|
|
|
+ * @hidden Last computed particle rotation matrix
|
|
|
|
+ */
|
|
|
|
+ _rotationMatrix: number[];
|
|
|
|
+ /**
|
|
|
|
+ * Parent particle Id, if any.
|
|
|
|
+ * Default null.
|
|
|
|
+ */
|
|
|
|
+ parentId: Nullable<number>;
|
|
|
|
+ /**
|
|
|
|
+ * @hidden Internal global position in the PCS.
|
|
|
|
+ */
|
|
|
|
+ _globalPosition: Vector3;
|
|
|
|
+ /**
|
|
|
|
+ * Creates a Point Cloud object.
|
|
|
|
+ * Don't create particles manually, use instead the PCS internal tools like _addParticle()
|
|
|
|
+ * @param particleIndex (integer) is the particle index in the PCS pool. It's also the particle identifier.
|
|
|
|
+ * @param group (PointsGroup) is the group the particle belongs to
|
|
|
|
+ * @param groupId (integer) is the group identifier in the PCS.
|
|
|
|
+ * @param idxInGroup (integer) is the index of the particle in the current point group (ex: the 10th point of addPoints(30))
|
|
|
|
+ * @param pcs defines the PCS it is associated to
|
|
|
|
+ */
|
|
|
|
+ constructor(particleIndex: number, group: PointsGroup, groupId: number, idxInGroup: number, pcs: PointsCloudSystem);
|
|
|
|
+ /**
|
|
|
|
+ * get point size
|
|
|
|
+ */
|
|
|
|
+ /**
|
|
|
|
+ * Set point size
|
|
|
|
+ */
|
|
|
|
+ size: Vector3;
|
|
|
|
+ /**
|
|
|
|
+ * Legacy support, changed quaternion to rotationQuaternion
|
|
|
|
+ */
|
|
|
|
+ /**
|
|
|
|
+ * Legacy support, changed quaternion to rotationQuaternion
|
|
|
|
+ */
|
|
|
|
+ quaternion: Nullable<Quaternion>;
|
|
|
|
+ /**
|
|
|
|
+ * Returns a boolean. True if the particle intersects another particle or another mesh, else false.
|
|
|
|
+ * The intersection is computed on the particle bounding sphere and Axis Aligned Bounding Box (AABB)
|
|
|
|
+ * @param target is the object (point or mesh) what the intersection is computed against.
|
|
|
|
+ * @returns true if it intersects
|
|
|
|
+ */
|
|
|
|
+ intersectsMesh(target: Mesh | CloudPoint): boolean;
|
|
|
|
+ /**
|
|
|
|
+ * get the rotation matrix of the particle
|
|
|
|
+ * @hidden
|
|
|
|
+ */
|
|
|
|
+ getRotationMatrix(m: Matrix): void;
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * Represents a group of points in a points cloud system
|
|
|
|
+ * * PCS internal tool, don't use it manually.
|
|
|
|
+ */
|
|
|
|
+ export class PointsGroup {
|
|
|
|
+ /**
|
|
|
|
+ * The group id
|
|
|
|
+ * @hidden
|
|
|
|
+ */
|
|
|
|
+ groupID: number;
|
|
|
|
+ /**
|
|
|
|
+ * image data for group (internal use)
|
|
|
|
+ * @hidden
|
|
|
|
+ */
|
|
|
|
+ _groupImageData: Nullable<ArrayBufferView>;
|
|
|
|
+ /**
|
|
|
|
+ * Image Width (internal use)
|
|
|
|
+ * @hidden
|
|
|
|
+ */
|
|
|
|
+ _groupImgWidth: number;
|
|
|
|
+ /**
|
|
|
|
+ * Image Height (internal use)
|
|
|
|
+ * @hidden
|
|
|
|
+ */
|
|
|
|
+ _groupImgHeight: number;
|
|
|
|
+ /**
|
|
|
|
+ * Custom position function (internal use)
|
|
|
|
+ * @hidden
|
|
|
|
+ */
|
|
|
|
+ _positionFunction: Nullable<(particle: CloudPoint, i?: number, s?: number) => void>;
|
|
|
|
+ /**
|
|
|
|
+ * density per facet for surface points
|
|
|
|
+ * @hidden
|
|
|
|
+ */
|
|
|
|
+ _groupDensity: number[];
|
|
|
|
+ /**
|
|
|
|
+ * Creates a points group object. This is an internal reference to produce particles for the PCS.
|
|
|
|
+ * PCS internal tool, don't use it manually.
|
|
|
|
+ * @hidden
|
|
|
|
+ */
|
|
|
|
+ constructor(id: number, posFunction: Nullable<(particle: CloudPoint, i?: number, s?: number) => void>);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+declare module BABYLON {
|
|
interface Scene {
|
|
interface Scene {
|
|
/** @hidden (Backing field) */
|
|
/** @hidden (Backing field) */
|
|
_physicsEngine: Nullable<IPhysicsEngine>;
|
|
_physicsEngine: Nullable<IPhysicsEngine>;
|