|
@@ -3706,401 +3706,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
- class Particle {
|
|
|
- position: Vector3;
|
|
|
- direction: Vector3;
|
|
|
- color: Color4;
|
|
|
- colorStep: Color4;
|
|
|
- lifeTime: number;
|
|
|
- age: number;
|
|
|
- size: number;
|
|
|
- angle: number;
|
|
|
- angularSpeed: number;
|
|
|
- copyTo(other: Particle): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class ParticleSystem implements IDisposable, IAnimatable {
|
|
|
- name: string;
|
|
|
- static BLENDMODE_ONEONE: number;
|
|
|
- static BLENDMODE_STANDARD: number;
|
|
|
- animations: Animation[];
|
|
|
- id: string;
|
|
|
- renderingGroupId: number;
|
|
|
- emitter: any;
|
|
|
- emitRate: number;
|
|
|
- manualEmitCount: number;
|
|
|
- updateSpeed: number;
|
|
|
- targetStopDuration: number;
|
|
|
- disposeOnStop: boolean;
|
|
|
- minEmitPower: number;
|
|
|
- maxEmitPower: number;
|
|
|
- minLifeTime: number;
|
|
|
- maxLifeTime: number;
|
|
|
- minSize: number;
|
|
|
- maxSize: number;
|
|
|
- minAngularSpeed: number;
|
|
|
- maxAngularSpeed: number;
|
|
|
- particleTexture: Texture;
|
|
|
- layerMask: number;
|
|
|
- onDispose: () => void;
|
|
|
- updateFunction: (particles: Particle[]) => void;
|
|
|
- blendMode: number;
|
|
|
- forceDepthWrite: boolean;
|
|
|
- gravity: Vector3;
|
|
|
- direction1: Vector3;
|
|
|
- direction2: Vector3;
|
|
|
- minEmitBox: Vector3;
|
|
|
- maxEmitBox: Vector3;
|
|
|
- color1: Color4;
|
|
|
- color2: Color4;
|
|
|
- colorDead: Color4;
|
|
|
- textureMask: Color4;
|
|
|
- startDirectionFunction: (emitPower: number, worldMatrix: Matrix, directionToUpdate: Vector3, particle: Particle) => void;
|
|
|
- startPositionFunction: (worldMatrix: Matrix, positionToUpdate: Vector3, particle: Particle) => void;
|
|
|
- private particles;
|
|
|
- private _capacity;
|
|
|
- private _scene;
|
|
|
- private _vertexDeclaration;
|
|
|
- private _vertexStrideSize;
|
|
|
- private _stockParticles;
|
|
|
- private _newPartsExcess;
|
|
|
- private _vertexBuffer;
|
|
|
- private _indexBuffer;
|
|
|
- private _vertices;
|
|
|
- private _effect;
|
|
|
- private _customEffect;
|
|
|
- private _cachedDefines;
|
|
|
- private _scaledColorStep;
|
|
|
- private _colorDiff;
|
|
|
- private _scaledDirection;
|
|
|
- private _scaledGravity;
|
|
|
- private _currentRenderId;
|
|
|
- private _alive;
|
|
|
- private _started;
|
|
|
- private _stopped;
|
|
|
- private _actualFrame;
|
|
|
- private _scaledUpdateSpeed;
|
|
|
- constructor(name: string, capacity: number, scene: Scene, customEffect?: Effect);
|
|
|
- recycleParticle(particle: Particle): void;
|
|
|
- getCapacity(): number;
|
|
|
- isAlive(): boolean;
|
|
|
- isStarted(): boolean;
|
|
|
- start(): void;
|
|
|
- stop(): void;
|
|
|
- _appendParticleVertex(index: number, particle: Particle, offsetX: number, offsetY: number): void;
|
|
|
- private _update(newParticles);
|
|
|
- private _getEffect();
|
|
|
- animate(): void;
|
|
|
- render(): number;
|
|
|
- dispose(): void;
|
|
|
- clone(name: string, newEmitter: any): ParticleSystem;
|
|
|
- serialize(): any;
|
|
|
- static Parse(parsedParticleSystem: any, scene: Scene, rootUrl: string): ParticleSystem;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class SolidParticle {
|
|
|
- idx: number;
|
|
|
- color: Color4;
|
|
|
- position: Vector3;
|
|
|
- rotation: Vector3;
|
|
|
- quaternion: Vector4;
|
|
|
- scale: Vector3;
|
|
|
- uvs: Vector4;
|
|
|
- velocity: Vector3;
|
|
|
- alive: boolean;
|
|
|
- _pos: number;
|
|
|
- _model: ModelShape;
|
|
|
- shapeId: number;
|
|
|
- idxInShape: number;
|
|
|
- constructor(particleIndex: number, positionIndex: number, model: ModelShape, shapeId: number, idxInShape: number);
|
|
|
- }
|
|
|
- class ModelShape {
|
|
|
- shapeID: number;
|
|
|
- _shape: Vector3[];
|
|
|
- _shapeUV: number[];
|
|
|
- _positionFunction: (particle: SolidParticle, i: number, s: number) => void;
|
|
|
- _vertexFunction: (particle: SolidParticle, vertex: Vector3, i: number) => void;
|
|
|
- constructor(id: number, shape: Vector3[], shapeUV: number[], posFunction: (particle: SolidParticle, i: number, s: number) => void, vtxFunction: (particle: SolidParticle, vertex: Vector3, i: number) => void);
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- /**
|
|
|
- * Full documentation here : http://doc.babylonjs.com/tutorials/Solid_Particle_System
|
|
|
- */
|
|
|
- class SolidParticleSystem implements IDisposable {
|
|
|
- /**
|
|
|
- * The SPS array of Solid Particle objects. Just access each particle as with any classic array.
|
|
|
- * Example : var p = SPS.particles[i];
|
|
|
- */
|
|
|
- particles: SolidParticle[];
|
|
|
- /**
|
|
|
- * The SPS total number of particles. Read only. Use SPS.counter instead if you need to set your own value.
|
|
|
- */
|
|
|
- nbParticles: number;
|
|
|
- /**
|
|
|
- * If the particles must ever face the camera (default false). Useful for planar particles.
|
|
|
- */
|
|
|
- billboard: boolean;
|
|
|
- /**
|
|
|
- * This a counter ofr your own usage. It's not set by any SPS functions.
|
|
|
- */
|
|
|
- counter: number;
|
|
|
- /**
|
|
|
- * The SPS name. This name is also given to the underlying mesh.
|
|
|
- */
|
|
|
- name: string;
|
|
|
- /**
|
|
|
- * The SPS 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 SPS specific or temporary values in order to lower the Garbage Collector activity.
|
|
|
- * Please read : http://doc.babylonjs.com/tutorials/Solid_Particle_System#garbage-collector-concerns
|
|
|
- */
|
|
|
- vars: any;
|
|
|
- /**
|
|
|
- * This array is populated when the SPS is set as 'pickable'.
|
|
|
- * Each key of this array is a faceId value that you can get from a pickResult object.
|
|
|
- * Each element of this array is an object {idx: int, faceId: int}.
|
|
|
- * idx is the picked particle index in the SPS.particles array
|
|
|
- * faceId is the picked face index counted within this particles
|
|
|
- * Please read : http://doc.babylonjs.com/tutorials/Solid_Particle_System#pickable-particles
|
|
|
- */
|
|
|
- pickedParticles: {
|
|
|
- idx: number;
|
|
|
- faceId: number;
|
|
|
- }[];
|
|
|
- private _scene;
|
|
|
- private _positions;
|
|
|
- private _indices;
|
|
|
- private _normals;
|
|
|
- private _colors;
|
|
|
- private _uvs;
|
|
|
- private _positions32;
|
|
|
- private _normals32;
|
|
|
- private _fixedNormal32;
|
|
|
- private _colors32;
|
|
|
- private _uvs32;
|
|
|
- private _index;
|
|
|
- private _updatable;
|
|
|
- private _pickable;
|
|
|
- private _isVisibilityBoxLocked;
|
|
|
- private _alwaysVisible;
|
|
|
- private _shapeCounter;
|
|
|
- private _copy;
|
|
|
- private _shape;
|
|
|
- private _shapeUV;
|
|
|
- private _color;
|
|
|
- private _computeParticleColor;
|
|
|
- private _computeParticleTexture;
|
|
|
- private _computeParticleRotation;
|
|
|
- private _computeParticleVertex;
|
|
|
- private _computeBoundingBox;
|
|
|
- private _cam_axisZ;
|
|
|
- private _cam_axisY;
|
|
|
- private _cam_axisX;
|
|
|
- private _axisX;
|
|
|
- private _axisY;
|
|
|
- private _axisZ;
|
|
|
- private _camera;
|
|
|
- private _particle;
|
|
|
- private _fakeCamPos;
|
|
|
- private _rotMatrix;
|
|
|
- private _invertMatrix;
|
|
|
- private _rotated;
|
|
|
- private _quaternion;
|
|
|
- private _vertex;
|
|
|
- private _normal;
|
|
|
- private _yaw;
|
|
|
- private _pitch;
|
|
|
- private _roll;
|
|
|
- private _halfroll;
|
|
|
- private _halfpitch;
|
|
|
- private _halfyaw;
|
|
|
- private _sinRoll;
|
|
|
- private _cosRoll;
|
|
|
- private _sinPitch;
|
|
|
- private _cosPitch;
|
|
|
- private _sinYaw;
|
|
|
- private _cosYaw;
|
|
|
- private _w;
|
|
|
- private _minimum;
|
|
|
- private _maximum;
|
|
|
- /**
|
|
|
- * Creates a SPS (Solid Particle System) object.
|
|
|
- * @param name the SPS name, this will be the underlying mesh name
|
|
|
- * @param scene the scene in which the SPS is added
|
|
|
- * @param options "updatable" (default true) : if the SPS must be updatable or immutable, "isPickable" (default false) : if the solid particles must be pickable
|
|
|
- */
|
|
|
- constructor(name: string, scene: Scene, options?: {
|
|
|
- updatable?: boolean;
|
|
|
- isPickable?: boolean;
|
|
|
- });
|
|
|
- /**
|
|
|
- * Builds the SPS underlying mesh. Returns a standard Mesh.
|
|
|
- * If no model shape was added to the SPS, the return mesh is only a single triangular plane.
|
|
|
- */
|
|
|
- buildMesh(): Mesh;
|
|
|
- /**
|
|
|
- * Digests the mesh and generates as many solid particles in the system as wanted.
|
|
|
- * These particles will have the same geometry than the mesh parts and will be positioned at the same localisation than the mesh original places.
|
|
|
- * Thus the particles generated from digest() have their property "positiion" yet set.
|
|
|
- * @param mesh the mesh to be digested
|
|
|
- * @param facetNb the number of mesh facets per particle (optional, default 1), this parameter is overriden by the parameter "number" if any
|
|
|
- * @param delta the random extra number of facets per partical (optional, default 0), each particle will have between facetNb and facetNb + delta facets
|
|
|
- * @param number the wanted number of particles : each particle is built with mesh_total_facets / number facets (optional)
|
|
|
- */
|
|
|
- digest(mesh: Mesh, options?: {
|
|
|
- facetNb?: number;
|
|
|
- number?: number;
|
|
|
- delta?: number;
|
|
|
- }): void;
|
|
|
- private _resetCopy();
|
|
|
- private _meshBuilder(p, shape, positions, meshInd, indices, meshUV, uvs, meshCol, colors, idx, idxInShape, options);
|
|
|
- private _posToShape(positions);
|
|
|
- private _uvsToShapeUV(uvs);
|
|
|
- private _addParticle(idx, idxpos, model, shapeId, idxInShape);
|
|
|
- /**
|
|
|
- * Adds some particles to the SPS from the model shape.
|
|
|
- * Please read the doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#create-an-immutable-sps
|
|
|
- * @param mesh any Mesh object that will be used as a model for the solid particles.
|
|
|
- * @param nb 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 an optional javascript function to called for each vertex of each particle on SPS creation
|
|
|
- */
|
|
|
- addShape(mesh: Mesh, nb: number, options?: {
|
|
|
- positionFunction?: any;
|
|
|
- vertexFunction?: any;
|
|
|
- }): number;
|
|
|
- private _rebuildParticle(particle);
|
|
|
- /**
|
|
|
- * Rebuilds the whole mesh and updates the VBO : custom positions and vertices are recomputed if needed.
|
|
|
- */
|
|
|
- rebuildMesh(): void;
|
|
|
- /**
|
|
|
- * 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 particles of the SPS.
|
|
|
- * For an animated SPS, it is usually called within the render loop.
|
|
|
- * @param start (default 0) the particle index in the particle array where to start to compute the particle property values
|
|
|
- * @param end (default nbParticle - 1) the particle index in the particle array where to stop to compute the particle property values
|
|
|
- * @param update (default true) if the mesh must be finally updated on this call after all the particle computations.
|
|
|
- */
|
|
|
- setParticles(start?: number, end?: number, update?: boolean): void;
|
|
|
- private _quaternionRotationYPR();
|
|
|
- private _quaternionToRotationMatrix();
|
|
|
- /**
|
|
|
- * Disposes the SPS
|
|
|
- */
|
|
|
- dispose(): void;
|
|
|
- /**
|
|
|
- * Visibilty helper : Recomputes the visible size according to the mesh bounding box
|
|
|
- * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#sps-visibility
|
|
|
- */
|
|
|
- refreshVisibleSize(): void;
|
|
|
- /** 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 SPS mesh bounding box.
|
|
|
- * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#sps-visibility
|
|
|
- */
|
|
|
- setVisibilityBox(size: number): void;
|
|
|
- /**
|
|
|
- * True if the SPS is set as always visible
|
|
|
- */
|
|
|
- /**
|
|
|
- * Sets the SPS as always visible or not
|
|
|
- * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#sps-visibility
|
|
|
- */
|
|
|
- isAlwaysVisible: boolean;
|
|
|
- /**
|
|
|
- * True if the SPS visibility box is locked. The underlying mesh bounding box is then not updatable any more.
|
|
|
- */
|
|
|
- /**
|
|
|
- * Sets the SPS visibility box as locked or not. This enables/disables the underlying mesh bounding box updates.
|
|
|
- * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#sps-visibility
|
|
|
- */
|
|
|
- isVisibilityBoxLocked: boolean;
|
|
|
- /**
|
|
|
- * Tells to setParticles() to compute the particle rotations or not.
|
|
|
- * Default value : true. The SPS is faster when it's set to false.
|
|
|
- * 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 SPS 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;
|
|
|
- /**
|
|
|
- * Tells to setParticles() to compute the particle textures or not.
|
|
|
- * Default value : true. The SPS 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 call the vertex function for each vertex of each particle, or not.
|
|
|
- * Default value : false. The SPS is faster when it's set to false.
|
|
|
- * Note : the particle custom vertex positions aren't stored values.
|
|
|
- */
|
|
|
- computeParticleVertex: boolean;
|
|
|
- /**
|
|
|
- * Tells to setParticles() to compute 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 particles first values.
|
|
|
- * The SPS doesn't call this function, you may have to call it by your own.
|
|
|
- * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#particle-management
|
|
|
- */
|
|
|
- initParticles(): void;
|
|
|
- /**
|
|
|
- * This function does nothing. It may be overwritten to recycle a particle.
|
|
|
- * The SPS doesn't call this function, you may have to call it by your own.
|
|
|
- * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#particle-management
|
|
|
- */
|
|
|
- recycleParticle(particle: SolidParticle): SolidParticle;
|
|
|
- /**
|
|
|
- * 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 : http://doc.babylonjs.com/tutorials/Solid_Particle_System#particle-management
|
|
|
- * ex : just set a particle position or velocity and recycle conditions
|
|
|
- */
|
|
|
- updateParticle(particle: SolidParticle): SolidParticle;
|
|
|
- /**
|
|
|
- * Updates a vertex of a particle : it can be overwritten by the user.
|
|
|
- * This will be called on each vertex particle by setParticles() if computeParticleVertex is set to true only.
|
|
|
- * @param particle the current particle
|
|
|
- * @param vertex the current index of the current particle
|
|
|
- * @param pt the index of the current vertex in the particle shape
|
|
|
- * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#update-each-particle-shape
|
|
|
- * ex : just set a vertex particle position
|
|
|
- */
|
|
|
- updateParticleVertex(particle: SolidParticle, vertex: Vector3, pt: number): Vector3;
|
|
|
- /**
|
|
|
- * 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 stop 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 stop 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 {
|
|
|
class AbstractMesh extends Node implements IDisposable {
|
|
|
private static _BILLBOARDMODE_NONE;
|
|
|
private static _BILLBOARDMODE_X;
|
|
@@ -5460,32 +5065,427 @@ declare module BABYLON {
|
|
|
update(data: number[] | Float32Array): void;
|
|
|
updateDirectly(data: Float32Array, offset: number): void;
|
|
|
dispose(): void;
|
|
|
- private static _PositionKind;
|
|
|
- private static _NormalKind;
|
|
|
- private static _UVKind;
|
|
|
- private static _UV2Kind;
|
|
|
- private static _UV3Kind;
|
|
|
- private static _UV4Kind;
|
|
|
- private static _UV5Kind;
|
|
|
- private static _UV6Kind;
|
|
|
- private static _ColorKind;
|
|
|
- private static _MatricesIndicesKind;
|
|
|
- private static _MatricesWeightsKind;
|
|
|
- private static _MatricesIndicesExtraKind;
|
|
|
- private static _MatricesWeightsExtraKind;
|
|
|
- static PositionKind: string;
|
|
|
- static NormalKind: string;
|
|
|
- static UVKind: string;
|
|
|
- static UV2Kind: string;
|
|
|
- static UV3Kind: string;
|
|
|
- static UV4Kind: string;
|
|
|
- static UV5Kind: string;
|
|
|
- static UV6Kind: string;
|
|
|
- static ColorKind: string;
|
|
|
- static MatricesIndicesKind: string;
|
|
|
- static MatricesWeightsKind: string;
|
|
|
- static MatricesIndicesExtraKind: string;
|
|
|
- static MatricesWeightsExtraKind: string;
|
|
|
+ private static _PositionKind;
|
|
|
+ private static _NormalKind;
|
|
|
+ private static _UVKind;
|
|
|
+ private static _UV2Kind;
|
|
|
+ private static _UV3Kind;
|
|
|
+ private static _UV4Kind;
|
|
|
+ private static _UV5Kind;
|
|
|
+ private static _UV6Kind;
|
|
|
+ private static _ColorKind;
|
|
|
+ private static _MatricesIndicesKind;
|
|
|
+ private static _MatricesWeightsKind;
|
|
|
+ private static _MatricesIndicesExtraKind;
|
|
|
+ private static _MatricesWeightsExtraKind;
|
|
|
+ static PositionKind: string;
|
|
|
+ static NormalKind: string;
|
|
|
+ static UVKind: string;
|
|
|
+ static UV2Kind: string;
|
|
|
+ static UV3Kind: string;
|
|
|
+ static UV4Kind: string;
|
|
|
+ static UV5Kind: string;
|
|
|
+ static UV6Kind: string;
|
|
|
+ static ColorKind: string;
|
|
|
+ static MatricesIndicesKind: string;
|
|
|
+ static MatricesWeightsKind: string;
|
|
|
+ static MatricesIndicesExtraKind: string;
|
|
|
+ static MatricesWeightsExtraKind: string;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class Particle {
|
|
|
+ position: Vector3;
|
|
|
+ direction: Vector3;
|
|
|
+ color: Color4;
|
|
|
+ colorStep: Color4;
|
|
|
+ lifeTime: number;
|
|
|
+ age: number;
|
|
|
+ size: number;
|
|
|
+ angle: number;
|
|
|
+ angularSpeed: number;
|
|
|
+ copyTo(other: Particle): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class ParticleSystem implements IDisposable, IAnimatable {
|
|
|
+ name: string;
|
|
|
+ static BLENDMODE_ONEONE: number;
|
|
|
+ static BLENDMODE_STANDARD: number;
|
|
|
+ animations: Animation[];
|
|
|
+ id: string;
|
|
|
+ renderingGroupId: number;
|
|
|
+ emitter: any;
|
|
|
+ emitRate: number;
|
|
|
+ manualEmitCount: number;
|
|
|
+ updateSpeed: number;
|
|
|
+ targetStopDuration: number;
|
|
|
+ disposeOnStop: boolean;
|
|
|
+ minEmitPower: number;
|
|
|
+ maxEmitPower: number;
|
|
|
+ minLifeTime: number;
|
|
|
+ maxLifeTime: number;
|
|
|
+ minSize: number;
|
|
|
+ maxSize: number;
|
|
|
+ minAngularSpeed: number;
|
|
|
+ maxAngularSpeed: number;
|
|
|
+ particleTexture: Texture;
|
|
|
+ layerMask: number;
|
|
|
+ onDispose: () => void;
|
|
|
+ updateFunction: (particles: Particle[]) => void;
|
|
|
+ blendMode: number;
|
|
|
+ forceDepthWrite: boolean;
|
|
|
+ gravity: Vector3;
|
|
|
+ direction1: Vector3;
|
|
|
+ direction2: Vector3;
|
|
|
+ minEmitBox: Vector3;
|
|
|
+ maxEmitBox: Vector3;
|
|
|
+ color1: Color4;
|
|
|
+ color2: Color4;
|
|
|
+ colorDead: Color4;
|
|
|
+ textureMask: Color4;
|
|
|
+ startDirectionFunction: (emitPower: number, worldMatrix: Matrix, directionToUpdate: Vector3, particle: Particle) => void;
|
|
|
+ startPositionFunction: (worldMatrix: Matrix, positionToUpdate: Vector3, particle: Particle) => void;
|
|
|
+ private particles;
|
|
|
+ private _capacity;
|
|
|
+ private _scene;
|
|
|
+ private _vertexDeclaration;
|
|
|
+ private _vertexStrideSize;
|
|
|
+ private _stockParticles;
|
|
|
+ private _newPartsExcess;
|
|
|
+ private _vertexBuffer;
|
|
|
+ private _indexBuffer;
|
|
|
+ private _vertices;
|
|
|
+ private _effect;
|
|
|
+ private _customEffect;
|
|
|
+ private _cachedDefines;
|
|
|
+ private _scaledColorStep;
|
|
|
+ private _colorDiff;
|
|
|
+ private _scaledDirection;
|
|
|
+ private _scaledGravity;
|
|
|
+ private _currentRenderId;
|
|
|
+ private _alive;
|
|
|
+ private _started;
|
|
|
+ private _stopped;
|
|
|
+ private _actualFrame;
|
|
|
+ private _scaledUpdateSpeed;
|
|
|
+ constructor(name: string, capacity: number, scene: Scene, customEffect?: Effect);
|
|
|
+ recycleParticle(particle: Particle): void;
|
|
|
+ getCapacity(): number;
|
|
|
+ isAlive(): boolean;
|
|
|
+ isStarted(): boolean;
|
|
|
+ start(): void;
|
|
|
+ stop(): void;
|
|
|
+ _appendParticleVertex(index: number, particle: Particle, offsetX: number, offsetY: number): void;
|
|
|
+ private _update(newParticles);
|
|
|
+ private _getEffect();
|
|
|
+ animate(): void;
|
|
|
+ render(): number;
|
|
|
+ dispose(): void;
|
|
|
+ clone(name: string, newEmitter: any): ParticleSystem;
|
|
|
+ serialize(): any;
|
|
|
+ static Parse(parsedParticleSystem: any, scene: Scene, rootUrl: string): ParticleSystem;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class SolidParticle {
|
|
|
+ idx: number;
|
|
|
+ color: Color4;
|
|
|
+ position: Vector3;
|
|
|
+ rotation: Vector3;
|
|
|
+ quaternion: Vector4;
|
|
|
+ scale: Vector3;
|
|
|
+ uvs: Vector4;
|
|
|
+ velocity: Vector3;
|
|
|
+ alive: boolean;
|
|
|
+ _pos: number;
|
|
|
+ _model: ModelShape;
|
|
|
+ shapeId: number;
|
|
|
+ idxInShape: number;
|
|
|
+ constructor(particleIndex: number, positionIndex: number, model: ModelShape, shapeId: number, idxInShape: number);
|
|
|
+ }
|
|
|
+ class ModelShape {
|
|
|
+ shapeID: number;
|
|
|
+ _shape: Vector3[];
|
|
|
+ _shapeUV: number[];
|
|
|
+ _positionFunction: (particle: SolidParticle, i: number, s: number) => void;
|
|
|
+ _vertexFunction: (particle: SolidParticle, vertex: Vector3, i: number) => void;
|
|
|
+ constructor(id: number, shape: Vector3[], shapeUV: number[], posFunction: (particle: SolidParticle, i: number, s: number) => void, vtxFunction: (particle: SolidParticle, vertex: Vector3, i: number) => void);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ /**
|
|
|
+ * Full documentation here : http://doc.babylonjs.com/tutorials/Solid_Particle_System
|
|
|
+ */
|
|
|
+ class SolidParticleSystem implements IDisposable {
|
|
|
+ /**
|
|
|
+ * The SPS array of Solid Particle objects. Just access each particle as with any classic array.
|
|
|
+ * Example : var p = SPS.particles[i];
|
|
|
+ */
|
|
|
+ particles: SolidParticle[];
|
|
|
+ /**
|
|
|
+ * The SPS total number of particles. Read only. Use SPS.counter instead if you need to set your own value.
|
|
|
+ */
|
|
|
+ nbParticles: number;
|
|
|
+ /**
|
|
|
+ * If the particles must ever face the camera (default false). Useful for planar particles.
|
|
|
+ */
|
|
|
+ billboard: boolean;
|
|
|
+ /**
|
|
|
+ * This a counter ofr your own usage. It's not set by any SPS functions.
|
|
|
+ */
|
|
|
+ counter: number;
|
|
|
+ /**
|
|
|
+ * The SPS name. This name is also given to the underlying mesh.
|
|
|
+ */
|
|
|
+ name: string;
|
|
|
+ /**
|
|
|
+ * The SPS 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 SPS specific or temporary values in order to lower the Garbage Collector activity.
|
|
|
+ * Please read : http://doc.babylonjs.com/tutorials/Solid_Particle_System#garbage-collector-concerns
|
|
|
+ */
|
|
|
+ vars: any;
|
|
|
+ /**
|
|
|
+ * This array is populated when the SPS is set as 'pickable'.
|
|
|
+ * Each key of this array is a faceId value that you can get from a pickResult object.
|
|
|
+ * Each element of this array is an object {idx: int, faceId: int}.
|
|
|
+ * idx is the picked particle index in the SPS.particles array
|
|
|
+ * faceId is the picked face index counted within this particles
|
|
|
+ * Please read : http://doc.babylonjs.com/tutorials/Solid_Particle_System#pickable-particles
|
|
|
+ */
|
|
|
+ pickedParticles: {
|
|
|
+ idx: number;
|
|
|
+ faceId: number;
|
|
|
+ }[];
|
|
|
+ private _scene;
|
|
|
+ private _positions;
|
|
|
+ private _indices;
|
|
|
+ private _normals;
|
|
|
+ private _colors;
|
|
|
+ private _uvs;
|
|
|
+ private _positions32;
|
|
|
+ private _normals32;
|
|
|
+ private _fixedNormal32;
|
|
|
+ private _colors32;
|
|
|
+ private _uvs32;
|
|
|
+ private _index;
|
|
|
+ private _updatable;
|
|
|
+ private _pickable;
|
|
|
+ private _isVisibilityBoxLocked;
|
|
|
+ private _alwaysVisible;
|
|
|
+ private _shapeCounter;
|
|
|
+ private _copy;
|
|
|
+ private _shape;
|
|
|
+ private _shapeUV;
|
|
|
+ private _color;
|
|
|
+ private _computeParticleColor;
|
|
|
+ private _computeParticleTexture;
|
|
|
+ private _computeParticleRotation;
|
|
|
+ private _computeParticleVertex;
|
|
|
+ private _computeBoundingBox;
|
|
|
+ private _cam_axisZ;
|
|
|
+ private _cam_axisY;
|
|
|
+ private _cam_axisX;
|
|
|
+ private _axisX;
|
|
|
+ private _axisY;
|
|
|
+ private _axisZ;
|
|
|
+ private _camera;
|
|
|
+ private _particle;
|
|
|
+ private _fakeCamPos;
|
|
|
+ private _rotMatrix;
|
|
|
+ private _invertMatrix;
|
|
|
+ private _rotated;
|
|
|
+ private _quaternion;
|
|
|
+ private _vertex;
|
|
|
+ private _normal;
|
|
|
+ private _yaw;
|
|
|
+ private _pitch;
|
|
|
+ private _roll;
|
|
|
+ private _halfroll;
|
|
|
+ private _halfpitch;
|
|
|
+ private _halfyaw;
|
|
|
+ private _sinRoll;
|
|
|
+ private _cosRoll;
|
|
|
+ private _sinPitch;
|
|
|
+ private _cosPitch;
|
|
|
+ private _sinYaw;
|
|
|
+ private _cosYaw;
|
|
|
+ private _w;
|
|
|
+ private _minimum;
|
|
|
+ private _maximum;
|
|
|
+ /**
|
|
|
+ * Creates a SPS (Solid Particle System) object.
|
|
|
+ * @param name the SPS name, this will be the underlying mesh name
|
|
|
+ * @param scene the scene in which the SPS is added
|
|
|
+ * @param options "updatable" (default true) : if the SPS must be updatable or immutable, "isPickable" (default false) : if the solid particles must be pickable
|
|
|
+ */
|
|
|
+ constructor(name: string, scene: Scene, options?: {
|
|
|
+ updatable?: boolean;
|
|
|
+ isPickable?: boolean;
|
|
|
+ });
|
|
|
+ /**
|
|
|
+ * Builds the SPS underlying mesh. Returns a standard Mesh.
|
|
|
+ * If no model shape was added to the SPS, the return mesh is only a single triangular plane.
|
|
|
+ */
|
|
|
+ buildMesh(): Mesh;
|
|
|
+ /**
|
|
|
+ * Digests the mesh and generates as many solid particles in the system as wanted.
|
|
|
+ * These particles will have the same geometry than the mesh parts and will be positioned at the same localisation than the mesh original places.
|
|
|
+ * Thus the particles generated from digest() have their property "positiion" yet set.
|
|
|
+ * @param mesh the mesh to be digested
|
|
|
+ * @param facetNb the number of mesh facets per particle (optional, default 1), this parameter is overriden by the parameter "number" if any
|
|
|
+ * @param delta the random extra number of facets per partical (optional, default 0), each particle will have between facetNb and facetNb + delta facets
|
|
|
+ * @param number the wanted number of particles : each particle is built with mesh_total_facets / number facets (optional)
|
|
|
+ */
|
|
|
+ digest(mesh: Mesh, options?: {
|
|
|
+ facetNb?: number;
|
|
|
+ number?: number;
|
|
|
+ delta?: number;
|
|
|
+ }): void;
|
|
|
+ private _resetCopy();
|
|
|
+ private _meshBuilder(p, shape, positions, meshInd, indices, meshUV, uvs, meshCol, colors, idx, idxInShape, options);
|
|
|
+ private _posToShape(positions);
|
|
|
+ private _uvsToShapeUV(uvs);
|
|
|
+ private _addParticle(idx, idxpos, model, shapeId, idxInShape);
|
|
|
+ /**
|
|
|
+ * Adds some particles to the SPS from the model shape.
|
|
|
+ * Please read the doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#create-an-immutable-sps
|
|
|
+ * @param mesh any Mesh object that will be used as a model for the solid particles.
|
|
|
+ * @param nb 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 an optional javascript function to called for each vertex of each particle on SPS creation
|
|
|
+ */
|
|
|
+ addShape(mesh: Mesh, nb: number, options?: {
|
|
|
+ positionFunction?: any;
|
|
|
+ vertexFunction?: any;
|
|
|
+ }): number;
|
|
|
+ private _rebuildParticle(particle);
|
|
|
+ /**
|
|
|
+ * Rebuilds the whole mesh and updates the VBO : custom positions and vertices are recomputed if needed.
|
|
|
+ */
|
|
|
+ rebuildMesh(): void;
|
|
|
+ /**
|
|
|
+ * 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 particles of the SPS.
|
|
|
+ * For an animated SPS, it is usually called within the render loop.
|
|
|
+ * @param start (default 0) the particle index in the particle array where to start to compute the particle property values
|
|
|
+ * @param end (default nbParticle - 1) the particle index in the particle array where to stop to compute the particle property values
|
|
|
+ * @param update (default true) if the mesh must be finally updated on this call after all the particle computations.
|
|
|
+ */
|
|
|
+ setParticles(start?: number, end?: number, update?: boolean): void;
|
|
|
+ private _quaternionRotationYPR();
|
|
|
+ private _quaternionToRotationMatrix();
|
|
|
+ /**
|
|
|
+ * Disposes the SPS
|
|
|
+ */
|
|
|
+ dispose(): void;
|
|
|
+ /**
|
|
|
+ * Visibilty helper : Recomputes the visible size according to the mesh bounding box
|
|
|
+ * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#sps-visibility
|
|
|
+ */
|
|
|
+ refreshVisibleSize(): void;
|
|
|
+ /** 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 SPS mesh bounding box.
|
|
|
+ * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#sps-visibility
|
|
|
+ */
|
|
|
+ setVisibilityBox(size: number): void;
|
|
|
+ /**
|
|
|
+ * True if the SPS is set as always visible
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ * Sets the SPS as always visible or not
|
|
|
+ * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#sps-visibility
|
|
|
+ */
|
|
|
+ isAlwaysVisible: boolean;
|
|
|
+ /**
|
|
|
+ * True if the SPS visibility box is locked. The underlying mesh bounding box is then not updatable any more.
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ * Sets the SPS visibility box as locked or not. This enables/disables the underlying mesh bounding box updates.
|
|
|
+ * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#sps-visibility
|
|
|
+ */
|
|
|
+ isVisibilityBoxLocked: boolean;
|
|
|
+ /**
|
|
|
+ * Tells to setParticles() to compute the particle rotations or not.
|
|
|
+ * Default value : true. The SPS is faster when it's set to false.
|
|
|
+ * 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 SPS 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;
|
|
|
+ /**
|
|
|
+ * Tells to setParticles() to compute the particle textures or not.
|
|
|
+ * Default value : true. The SPS 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 call the vertex function for each vertex of each particle, or not.
|
|
|
+ * Default value : false. The SPS is faster when it's set to false.
|
|
|
+ * Note : the particle custom vertex positions aren't stored values.
|
|
|
+ */
|
|
|
+ computeParticleVertex: boolean;
|
|
|
+ /**
|
|
|
+ * Tells to setParticles() to compute 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 particles first values.
|
|
|
+ * The SPS doesn't call this function, you may have to call it by your own.
|
|
|
+ * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#particle-management
|
|
|
+ */
|
|
|
+ initParticles(): void;
|
|
|
+ /**
|
|
|
+ * This function does nothing. It may be overwritten to recycle a particle.
|
|
|
+ * The SPS doesn't call this function, you may have to call it by your own.
|
|
|
+ * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#particle-management
|
|
|
+ */
|
|
|
+ recycleParticle(particle: SolidParticle): SolidParticle;
|
|
|
+ /**
|
|
|
+ * 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 : http://doc.babylonjs.com/tutorials/Solid_Particle_System#particle-management
|
|
|
+ * ex : just set a particle position or velocity and recycle conditions
|
|
|
+ */
|
|
|
+ updateParticle(particle: SolidParticle): SolidParticle;
|
|
|
+ /**
|
|
|
+ * Updates a vertex of a particle : it can be overwritten by the user.
|
|
|
+ * This will be called on each vertex particle by setParticles() if computeParticleVertex is set to true only.
|
|
|
+ * @param particle the current particle
|
|
|
+ * @param vertex the current index of the current particle
|
|
|
+ * @param pt the index of the current vertex in the particle shape
|
|
|
+ * doc : http://doc.babylonjs.com/tutorials/Solid_Particle_System#update-each-particle-shape
|
|
|
+ * ex : just set a vertex particle position
|
|
|
+ */
|
|
|
+ updateParticleVertex(particle: SolidParticle, vertex: Vector3, pt: number): Vector3;
|
|
|
+ /**
|
|
|
+ * 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 stop 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 stop 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;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -5742,27 +5742,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
- class ReflectionProbe {
|
|
|
- name: string;
|
|
|
- private _scene;
|
|
|
- private _renderTargetTexture;
|
|
|
- private _projectionMatrix;
|
|
|
- private _viewMatrix;
|
|
|
- private _target;
|
|
|
- private _add;
|
|
|
- private _attachedMesh;
|
|
|
- position: Vector3;
|
|
|
- constructor(name: string, size: number, scene: Scene, generateMipMaps?: boolean);
|
|
|
- refreshRate: number;
|
|
|
- getScene(): Scene;
|
|
|
- cubeTexture: RenderTargetTexture;
|
|
|
- renderList: AbstractMesh[];
|
|
|
- attachToMesh(mesh: AbstractMesh): void;
|
|
|
- dispose(): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
class AnaglyphPostProcess extends PostProcess {
|
|
|
constructor(name: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean);
|
|
|
}
|
|
@@ -6332,6 +6311,27 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
+ class ReflectionProbe {
|
|
|
+ name: string;
|
|
|
+ private _scene;
|
|
|
+ private _renderTargetTexture;
|
|
|
+ private _projectionMatrix;
|
|
|
+ private _viewMatrix;
|
|
|
+ private _target;
|
|
|
+ private _add;
|
|
|
+ private _attachedMesh;
|
|
|
+ position: Vector3;
|
|
|
+ constructor(name: string, size: number, scene: Scene, generateMipMaps?: boolean);
|
|
|
+ refreshRate: number;
|
|
|
+ getScene(): Scene;
|
|
|
+ cubeTexture: RenderTargetTexture;
|
|
|
+ renderList: AbstractMesh[];
|
|
|
+ attachToMesh(mesh: AbstractMesh): void;
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
class BoundingBoxRenderer {
|
|
|
frontColor: Color3;
|
|
|
backColor: Color3;
|