@babylonjs/core 6.45.0 → 6.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Animations/animation.js +1 -1
- package/Animations/animation.js.map +1 -1
- package/BakedVertexAnimation/bakedVertexAnimationManager.js +2 -1
- package/BakedVertexAnimation/bakedVertexAnimationManager.js.map +1 -1
- package/Bones/skeleton.js +2 -2
- package/Bones/skeleton.js.map +1 -1
- package/Cameras/camera.d.ts +3 -3
- package/Cameras/camera.js +2 -1
- package/Cameras/camera.js.map +1 -1
- package/Cameras/cameraInputsManager.js +1 -1
- package/Cameras/cameraInputsManager.js.map +1 -1
- package/Cameras/targetCamera.js +4 -0
- package/Cameras/targetCamera.js.map +1 -1
- package/Compute/computeShader.d.ts +4 -2
- package/Compute/computeShader.js +7 -3
- package/Compute/computeShader.js.map +1 -1
- package/Debug/directionalLightFrustumViewer.js +6 -6
- package/Debug/directionalLightFrustumViewer.js.map +1 -1
- package/Engines/Extensions/engine.computeShader.d.ts +2 -1
- package/Engines/Extensions/engine.computeShader.js +1 -0
- package/Engines/Extensions/engine.computeShader.js.map +1 -1
- package/Engines/Extensions/engine.rawTexture.js +3 -3
- package/Engines/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/Native/nativePipelineContext.js +1 -1
- package/Engines/Native/nativePipelineContext.js.map +1 -1
- package/Engines/WebGL/webGLPipelineContext.js +1 -1
- package/Engines/WebGL/webGLPipelineContext.js.map +1 -1
- package/Engines/WebGPU/webgpuComputeContext.js +7 -3
- package/Engines/WebGPU/webgpuComputeContext.js.map +1 -1
- package/Engines/engine.d.ts +1 -1
- package/Engines/thinEngine.js +2 -2
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +2 -15
- package/Engines/webgpuEngine.js.map +1 -1
- package/Layers/glowLayer.js +2 -1
- package/Layers/glowLayer.js.map +1 -1
- package/Layers/highlightLayer.js +2 -1
- package/Layers/highlightLayer.js.map +1 -1
- package/Lights/light.js +2 -1
- package/Lights/light.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +9 -0
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Loading/sceneLoader.d.ts +6 -1
- package/Loading/sceneLoader.js +6 -5
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/Background/backgroundMaterial.js +2 -1
- package/Materials/Background/backgroundMaterial.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +2 -1
- package/Materials/Node/nodeMaterial.js +5 -1
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.d.ts +1 -1
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/PBR/pbrMaterial.js +2 -1
- package/Materials/PBR/pbrMaterial.js.map +1 -1
- package/Materials/PBR/pbrMetallicRoughnessMaterial.js +2 -1
- package/Materials/PBR/pbrMetallicRoughnessMaterial.js.map +1 -1
- package/Materials/PBR/pbrSpecularGlossinessMaterial.js +2 -1
- package/Materials/PBR/pbrSpecularGlossinessMaterial.js.map +1 -1
- package/Materials/Textures/baseTexture.js +2 -1
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/Textures/cubeTexture.js +2 -1
- package/Materials/Textures/cubeTexture.js.map +1 -1
- package/Materials/Textures/rawCubeTexture.js +1 -1
- package/Materials/Textures/rawCubeTexture.js.map +1 -1
- package/Materials/Textures/texture.js +2 -1
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/colorCurves.d.ts +1 -1
- package/Materials/colorCurves.functions.d.ts +5 -0
- package/Materials/colorCurves.functions.js +8 -0
- package/Materials/colorCurves.functions.js.map +1 -0
- package/Materials/colorCurves.js +8 -8
- package/Materials/colorCurves.js.map +1 -1
- package/Materials/fresnelParameters.js +1 -1
- package/Materials/fresnelParameters.js.map +1 -1
- package/Materials/imageProcessingConfiguration.d.ts +3 -48
- package/Materials/imageProcessingConfiguration.defines.d.ts +46 -0
- package/Materials/imageProcessingConfiguration.defines.js +27 -0
- package/Materials/imageProcessingConfiguration.defines.js.map +1 -0
- package/Materials/imageProcessingConfiguration.functions.d.ts +13 -0
- package/Materials/imageProcessingConfiguration.functions.js +41 -0
- package/Materials/imageProcessingConfiguration.functions.js.map +1 -0
- package/Materials/imageProcessingConfiguration.js +18 -69
- package/Materials/imageProcessingConfiguration.js.map +1 -1
- package/Materials/material.js +2 -1
- package/Materials/material.js.map +1 -1
- package/Materials/materialHelper.d.ts +33 -33
- package/Materials/materialHelper.js +244 -286
- package/Materials/materialHelper.js.map +1 -1
- package/Materials/materialPluginBase.js +2 -1
- package/Materials/materialPluginBase.js.map +1 -1
- package/Materials/materialStencilState.js +2 -1
- package/Materials/materialStencilState.js.map +1 -1
- package/Materials/shaderMaterial.js +1 -1
- package/Materials/shaderMaterial.js.map +1 -1
- package/Materials/standardMaterial.d.ts +1 -1
- package/Materials/standardMaterial.js +2 -1
- package/Materials/standardMaterial.js.map +1 -1
- package/Materials/uniformBuffer.js +2 -2
- package/Materials/uniformBuffer.js.map +1 -1
- package/Maths/math.color.d.ts +392 -66
- package/Maths/math.color.js +541 -65
- package/Maths/math.color.js.map +1 -1
- package/Maths/math.like.d.ts +17 -28
- package/Maths/math.like.js.map +1 -1
- package/Maths/math.plane.d.ts +2 -1
- package/Maths/math.plane.js.map +1 -1
- package/Maths/math.polar.d.ts +1 -1
- package/Maths/math.polar.js.map +1 -1
- package/Maths/math.scalar.d.ts +6 -6
- package/Maths/math.scalar.functions.d.ts +51 -0
- package/Maths/math.scalar.functions.js +80 -0
- package/Maths/math.scalar.functions.js.map +1 -0
- package/Maths/math.scalar.js +48 -73
- package/Maths/math.scalar.js.map +1 -1
- package/Maths/math.vector.d.ts +571 -72
- package/Maths/math.vector.js +917 -119
- package/Maths/math.vector.js.map +1 -1
- package/Maths/math.viewport.d.ts +2 -1
- package/Maths/math.viewport.js.map +1 -1
- package/Maths/tensor.d.ts +411 -0
- package/Maths/tensor.js +3 -0
- package/Maths/tensor.js.map +1 -0
- package/Meshes/Node/Blocks/Set/setColorsBlock.js +20 -4
- package/Meshes/Node/Blocks/Set/setColorsBlock.js.map +1 -1
- package/Meshes/Node/nodeGeometry.js +2 -1
- package/Meshes/Node/nodeGeometry.js.map +1 -1
- package/Meshes/mesh.js +2 -2
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/mesh.vertexData.d.ts +4 -0
- package/Meshes/mesh.vertexData.js +10 -0
- package/Meshes/mesh.vertexData.js.map +1 -1
- package/Meshes/transformNode.js +2 -1
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/arrayTools.d.ts +2 -19
- package/Misc/arrayTools.js.map +1 -1
- package/Misc/decorators.d.ts +0 -80
- package/Misc/decorators.functions.d.ts +7 -0
- package/Misc/decorators.functions.js +52 -0
- package/Misc/decorators.functions.js.map +1 -0
- package/Misc/decorators.js +2 -318
- package/Misc/decorators.js.map +1 -1
- package/Misc/decorators.serialization.d.ts +81 -0
- package/Misc/decorators.serialization.js +269 -0
- package/Misc/decorators.serialization.js.map +1 -0
- package/Misc/index.d.ts +1 -0
- package/Misc/index.js +1 -0
- package/Misc/index.js.map +1 -1
- package/Misc/sceneRecorder.js +1 -1
- package/Misc/sceneRecorder.js.map +1 -1
- package/Misc/sceneSerializer.js +8 -1
- package/Misc/sceneSerializer.js.map +1 -1
- package/Misc/tools.functions.d.ts +14 -0
- package/Misc/tools.functions.js +23 -0
- package/Misc/tools.functions.js.map +1 -0
- package/Misc/tools.js +5 -6
- package/Misc/tools.js.map +1 -1
- package/Morph/morphTarget.js +2 -1
- package/Morph/morphTarget.js.map +1 -1
- package/Particles/EmitterTypes/boxParticleEmitter.js +8 -8
- package/Particles/EmitterTypes/boxParticleEmitter.js.map +1 -1
- package/Particles/baseParticleSystem.d.ts +8 -11
- package/Particles/baseParticleSystem.js +9 -40
- package/Particles/baseParticleSystem.js.map +1 -1
- package/Particles/gpuParticleSystem.d.ts +71 -1
- package/Particles/gpuParticleSystem.js +102 -1
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/particle.d.ts +3 -3
- package/Particles/particle.js +3 -3
- package/Particles/particle.js.map +1 -1
- package/Particles/particleSystem.d.ts +81 -455
- package/Particles/particleSystem.functions.d.ts +61 -0
- package/Particles/particleSystem.functions.js +79 -0
- package/Particles/particleSystem.functions.js.map +1 -0
- package/Particles/particleSystem.js +390 -1984
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/thinParticleSystem.d.ts +485 -0
- package/Particles/thinParticleSystem.js +1768 -0
- package/Particles/thinParticleSystem.js.map +1 -0
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +2 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +2 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js +2 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js +2 -1
- package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.js +2 -1
- package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.js.map +1 -1
- package/PostProcesses/blackAndWhitePostProcess.js +2 -1
- package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
- package/PostProcesses/blurPostProcess.js +2 -1
- package/PostProcesses/blurPostProcess.js.map +1 -1
- package/PostProcesses/chromaticAberrationPostProcess.js +2 -1
- package/PostProcesses/chromaticAberrationPostProcess.js.map +1 -1
- package/PostProcesses/colorCorrectionPostProcess.js +2 -1
- package/PostProcesses/colorCorrectionPostProcess.js.map +1 -1
- package/PostProcesses/convolutionPostProcess.js +2 -1
- package/PostProcesses/convolutionPostProcess.js.map +1 -1
- package/PostProcesses/displayPassPostProcess.js +1 -1
- package/PostProcesses/displayPassPostProcess.js.map +1 -1
- package/PostProcesses/filterPostProcess.js +2 -1
- package/PostProcesses/filterPostProcess.js.map +1 -1
- package/PostProcesses/fxaaPostProcess.js +1 -1
- package/PostProcesses/fxaaPostProcess.js.map +1 -1
- package/PostProcesses/grainPostProcess.js +2 -1
- package/PostProcesses/grainPostProcess.js.map +1 -1
- package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
- package/PostProcesses/motionBlurPostProcess.js +2 -1
- package/PostProcesses/motionBlurPostProcess.js.map +1 -1
- package/PostProcesses/passPostProcess.js +1 -1
- package/PostProcesses/passPostProcess.js.map +1 -1
- package/PostProcesses/postProcess.js +2 -1
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/refractionPostProcess.js +2 -1
- package/PostProcesses/refractionPostProcess.js.map +1 -1
- package/PostProcesses/screenSpaceCurvaturePostProcess.js +2 -1
- package/PostProcesses/screenSpaceCurvaturePostProcess.js.map +1 -1
- package/PostProcesses/screenSpaceReflectionPostProcess.js +2 -1
- package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
- package/PostProcesses/sharpenPostProcess.js +2 -1
- package/PostProcesses/sharpenPostProcess.js.map +1 -1
- package/Probes/reflectionProbe.js +2 -1
- package/Probes/reflectionProbe.js.map +1 -1
- package/Sprites/spriteManager.d.ts +4 -0
- package/Sprites/spriteManager.js.map +1 -1
- package/XR/features/WebXRControllerTeleportation.d.ts +9 -0
- package/XR/features/WebXRControllerTeleportation.js +75 -31
- package/XR/features/WebXRControllerTeleportation.js.map +1 -1
- package/node.js +2 -1
- package/node.js.map +1 -1
- package/package.json +1 -1
- package/types.d.ts +105 -0
- package/types.js.map +1 -1
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
import type { Immutable, Nullable } from "../types";
|
|
2
|
+
import { FactorGradient, Color3Gradient } from "../Misc/gradients";
|
|
3
|
+
import { Observable } from "../Misc/observable";
|
|
4
|
+
import { Vector3, Matrix } from "../Maths/math.vector";
|
|
5
|
+
import { VertexBuffer } from "../Buffers/buffer";
|
|
6
|
+
import type { Effect } from "../Materials/effect";
|
|
7
|
+
import type { IDisposable, Scene } from "../scene";
|
|
8
|
+
import type { IParticleSystem } from "./IParticleSystem";
|
|
9
|
+
import { BaseParticleSystem } from "./baseParticleSystem";
|
|
10
|
+
import { Particle } from "./particle";
|
|
11
|
+
import type { IAnimatable } from "../Animations/animatable.interface";
|
|
12
|
+
import { DrawWrapper } from "../Materials/drawWrapper";
|
|
13
|
+
import "../Shaders/particles.fragment";
|
|
14
|
+
import "../Shaders/particles.vertex";
|
|
15
|
+
import type { DataBuffer } from "../Buffers/dataBuffer";
|
|
16
|
+
import { Color4, Color3 } from "../Maths/math.color";
|
|
17
|
+
import type { ThinEngine } from "../Engines/thinEngine";
|
|
18
|
+
import "../Engines/Extensions/engine.alpha";
|
|
19
|
+
/**
|
|
20
|
+
* This represents a thin particle system in Babylon.
|
|
21
|
+
* Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust.
|
|
22
|
+
* Particles can take different shapes while emitted like box, sphere, cone or you can write your custom function.
|
|
23
|
+
* This thin version contains a limited subset of the total features in order to provide users with a way to get particles but with a smaller footprint
|
|
24
|
+
* @example https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/particle_system_intro
|
|
25
|
+
*/
|
|
26
|
+
export declare class ThinParticleSystem extends BaseParticleSystem implements IDisposable, IAnimatable, IParticleSystem {
|
|
27
|
+
/**
|
|
28
|
+
* This function can be defined to provide custom update for active particles.
|
|
29
|
+
* This function will be called instead of regular update (age, position, color, etc.).
|
|
30
|
+
* Do not forget that this function will be called on every frame so try to keep it simple and fast :)
|
|
31
|
+
*/
|
|
32
|
+
updateFunction: (particles: Particle[]) => void;
|
|
33
|
+
private _emitterWorldMatrix;
|
|
34
|
+
private _emitterInverseWorldMatrix;
|
|
35
|
+
/**
|
|
36
|
+
* This function can be defined to specify initial direction for every new particle.
|
|
37
|
+
* It by default use the emitterType defined function
|
|
38
|
+
*/
|
|
39
|
+
startDirectionFunction: (worldMatrix: Matrix, directionToUpdate: Vector3, particle: Particle, isLocal: boolean) => void;
|
|
40
|
+
/**
|
|
41
|
+
* This function can be defined to specify initial position for every new particle.
|
|
42
|
+
* It by default use the emitterType defined function
|
|
43
|
+
*/
|
|
44
|
+
startPositionFunction: (worldMatrix: Matrix, positionToUpdate: Vector3, particle: Particle, isLocal: boolean) => void;
|
|
45
|
+
/**
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
_inheritedVelocityOffset: Vector3;
|
|
49
|
+
/**
|
|
50
|
+
* An event triggered when the system is disposed
|
|
51
|
+
*/
|
|
52
|
+
onDisposeObservable: Observable<IParticleSystem>;
|
|
53
|
+
/**
|
|
54
|
+
* An event triggered when the system is stopped
|
|
55
|
+
*/
|
|
56
|
+
onStoppedObservable: Observable<IParticleSystem>;
|
|
57
|
+
private _onDisposeObserver;
|
|
58
|
+
/**
|
|
59
|
+
* Sets a callback that will be triggered when the system is disposed
|
|
60
|
+
*/
|
|
61
|
+
set onDispose(callback: () => void);
|
|
62
|
+
private _particles;
|
|
63
|
+
private _epsilon;
|
|
64
|
+
private _capacity;
|
|
65
|
+
private _stockParticles;
|
|
66
|
+
private _newPartsExcess;
|
|
67
|
+
private _vertexData;
|
|
68
|
+
private _vertexBuffer;
|
|
69
|
+
private _vertexBuffers;
|
|
70
|
+
private _spriteBuffer;
|
|
71
|
+
private _indexBuffer;
|
|
72
|
+
private _linesIndexBuffer;
|
|
73
|
+
private _linesIndexBufferUseInstancing;
|
|
74
|
+
private _drawWrappers;
|
|
75
|
+
/** @internal */
|
|
76
|
+
_customWrappers: {
|
|
77
|
+
[blendMode: number]: Nullable<DrawWrapper>;
|
|
78
|
+
};
|
|
79
|
+
private _scaledColorStep;
|
|
80
|
+
private _colorDiff;
|
|
81
|
+
private _scaledDirection;
|
|
82
|
+
private _scaledGravity;
|
|
83
|
+
private _currentRenderId;
|
|
84
|
+
private _alive;
|
|
85
|
+
private _useInstancing;
|
|
86
|
+
private _vertexArrayObject;
|
|
87
|
+
private _started;
|
|
88
|
+
private _stopped;
|
|
89
|
+
private _actualFrame;
|
|
90
|
+
private _scaledUpdateSpeed;
|
|
91
|
+
private _vertexBufferSize;
|
|
92
|
+
/** @internal */
|
|
93
|
+
_currentEmitRateGradient: Nullable<FactorGradient>;
|
|
94
|
+
/** @internal */
|
|
95
|
+
_currentEmitRate1: number;
|
|
96
|
+
/** @internal */
|
|
97
|
+
_currentEmitRate2: number;
|
|
98
|
+
/** @internal */
|
|
99
|
+
_currentStartSizeGradient: Nullable<FactorGradient>;
|
|
100
|
+
/** @internal */
|
|
101
|
+
_currentStartSize1: number;
|
|
102
|
+
/** @internal */
|
|
103
|
+
_currentStartSize2: number;
|
|
104
|
+
/** Indicates that the update of particles is done in the animate function */
|
|
105
|
+
readonly updateInAnimate = true;
|
|
106
|
+
private readonly _rawTextureWidth;
|
|
107
|
+
private _rampGradientsTexture;
|
|
108
|
+
private _useRampGradients;
|
|
109
|
+
/** Gets or sets a matrix to use to compute projection */
|
|
110
|
+
defaultProjectionMatrix: Matrix;
|
|
111
|
+
/** Gets or sets a matrix to use to compute view */
|
|
112
|
+
defaultViewMatrix: Matrix;
|
|
113
|
+
/** Gets or sets a boolean indicating that ramp gradients must be used
|
|
114
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/particle_system_intro#ramp-gradients
|
|
115
|
+
*/
|
|
116
|
+
get useRampGradients(): boolean;
|
|
117
|
+
set useRampGradients(value: boolean);
|
|
118
|
+
/**
|
|
119
|
+
* Specifies if the particles are updated in emitter local space or world space
|
|
120
|
+
*/
|
|
121
|
+
isLocal: boolean;
|
|
122
|
+
/** Indicates that the particle system is CPU based */
|
|
123
|
+
readonly isGPU = false;
|
|
124
|
+
/**
|
|
125
|
+
* Gets the current list of active particles
|
|
126
|
+
*/
|
|
127
|
+
get particles(): Particle[];
|
|
128
|
+
/**
|
|
129
|
+
* Gets the number of particles active at the same time.
|
|
130
|
+
* @returns The number of active particles.
|
|
131
|
+
*/
|
|
132
|
+
getActiveCount(): number;
|
|
133
|
+
/**
|
|
134
|
+
* Returns the string "ParticleSystem"
|
|
135
|
+
* @returns a string containing the class name
|
|
136
|
+
*/
|
|
137
|
+
getClassName(): string;
|
|
138
|
+
/**
|
|
139
|
+
* Gets a boolean indicating that the system is stopping
|
|
140
|
+
* @returns true if the system is currently stopping
|
|
141
|
+
*/
|
|
142
|
+
isStopping(): boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Gets the custom effect used to render the particles
|
|
145
|
+
* @param blendMode Blend mode for which the effect should be retrieved
|
|
146
|
+
* @returns The effect
|
|
147
|
+
*/
|
|
148
|
+
getCustomEffect(blendMode?: number): Nullable<Effect>;
|
|
149
|
+
private _getCustomDrawWrapper;
|
|
150
|
+
/**
|
|
151
|
+
* Sets the custom effect used to render the particles
|
|
152
|
+
* @param effect The effect to set
|
|
153
|
+
* @param blendMode Blend mode for which the effect should be set
|
|
154
|
+
*/
|
|
155
|
+
setCustomEffect(effect: Nullable<Effect>, blendMode?: number): void;
|
|
156
|
+
/** @internal */
|
|
157
|
+
private _onBeforeDrawParticlesObservable;
|
|
158
|
+
/**
|
|
159
|
+
* Observable that will be called just before the particles are drawn
|
|
160
|
+
*/
|
|
161
|
+
get onBeforeDrawParticlesObservable(): Observable<Nullable<Effect>>;
|
|
162
|
+
/**
|
|
163
|
+
* Gets the name of the particle vertex shader
|
|
164
|
+
*/
|
|
165
|
+
get vertexShaderName(): string;
|
|
166
|
+
/**
|
|
167
|
+
* Gets the vertex buffers used by the particle system
|
|
168
|
+
*/
|
|
169
|
+
get vertexBuffers(): Immutable<{
|
|
170
|
+
[key: string]: VertexBuffer;
|
|
171
|
+
}>;
|
|
172
|
+
/**
|
|
173
|
+
* Gets the index buffer used by the particle system (or null if no index buffer is used (if _useInstancing=true))
|
|
174
|
+
*/
|
|
175
|
+
get indexBuffer(): Nullable<DataBuffer>;
|
|
176
|
+
/**
|
|
177
|
+
* Instantiates a particle system.
|
|
178
|
+
* Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust.
|
|
179
|
+
* @param name The name of the particle system
|
|
180
|
+
* @param capacity The max number of particles alive at the same time
|
|
181
|
+
* @param sceneOrEngine The scene the particle system belongs to or the engine to use if no scene
|
|
182
|
+
* @param customEffect a custom effect used to change the way particles are rendered by default
|
|
183
|
+
* @param isAnimationSheetEnabled Must be true if using a spritesheet to animate the particles texture
|
|
184
|
+
* @param epsilon Offset used to render the particles
|
|
185
|
+
*/
|
|
186
|
+
constructor(name: string, capacity: number, sceneOrEngine: Scene | ThinEngine, customEffect?: Nullable<Effect>, isAnimationSheetEnabled?: boolean, epsilon?: number);
|
|
187
|
+
/** @internal */
|
|
188
|
+
_emitFromParticle: (particle: Particle) => void;
|
|
189
|
+
serialize(serializeTexture: boolean): void;
|
|
190
|
+
/**
|
|
191
|
+
* Clones the particle system.
|
|
192
|
+
* @param name The name of the cloned object
|
|
193
|
+
* @param newEmitter The new emitter to use
|
|
194
|
+
* @param cloneTexture Also clone the textures if true
|
|
195
|
+
*/
|
|
196
|
+
clone(name: string, newEmitter: any, cloneTexture?: boolean): ThinParticleSystem;
|
|
197
|
+
private _addFactorGradient;
|
|
198
|
+
private _removeFactorGradient;
|
|
199
|
+
/**
|
|
200
|
+
* Adds a new life time gradient
|
|
201
|
+
* @param gradient defines the gradient to use (between 0 and 1)
|
|
202
|
+
* @param factor defines the life time factor to affect to the specified gradient
|
|
203
|
+
* @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
|
|
204
|
+
* @returns the current particle system
|
|
205
|
+
*/
|
|
206
|
+
addLifeTimeGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;
|
|
207
|
+
/**
|
|
208
|
+
* Remove a specific life time gradient
|
|
209
|
+
* @param gradient defines the gradient to remove
|
|
210
|
+
* @returns the current particle system
|
|
211
|
+
*/
|
|
212
|
+
removeLifeTimeGradient(gradient: number): IParticleSystem;
|
|
213
|
+
/**
|
|
214
|
+
* Adds a new size gradient
|
|
215
|
+
* @param gradient defines the gradient to use (between 0 and 1)
|
|
216
|
+
* @param factor defines the size factor to affect to the specified gradient
|
|
217
|
+
* @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
|
|
218
|
+
* @returns the current particle system
|
|
219
|
+
*/
|
|
220
|
+
addSizeGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;
|
|
221
|
+
/**
|
|
222
|
+
* Remove a specific size gradient
|
|
223
|
+
* @param gradient defines the gradient to remove
|
|
224
|
+
* @returns the current particle system
|
|
225
|
+
*/
|
|
226
|
+
removeSizeGradient(gradient: number): IParticleSystem;
|
|
227
|
+
/**
|
|
228
|
+
* Adds a new color remap gradient
|
|
229
|
+
* @param gradient defines the gradient to use (between 0 and 1)
|
|
230
|
+
* @param min defines the color remap minimal range
|
|
231
|
+
* @param max defines the color remap maximal range
|
|
232
|
+
* @returns the current particle system
|
|
233
|
+
*/
|
|
234
|
+
addColorRemapGradient(gradient: number, min: number, max: number): IParticleSystem;
|
|
235
|
+
/**
|
|
236
|
+
* Remove a specific color remap gradient
|
|
237
|
+
* @param gradient defines the gradient to remove
|
|
238
|
+
* @returns the current particle system
|
|
239
|
+
*/
|
|
240
|
+
removeColorRemapGradient(gradient: number): IParticleSystem;
|
|
241
|
+
/**
|
|
242
|
+
* Adds a new alpha remap gradient
|
|
243
|
+
* @param gradient defines the gradient to use (between 0 and 1)
|
|
244
|
+
* @param min defines the alpha remap minimal range
|
|
245
|
+
* @param max defines the alpha remap maximal range
|
|
246
|
+
* @returns the current particle system
|
|
247
|
+
*/
|
|
248
|
+
addAlphaRemapGradient(gradient: number, min: number, max: number): IParticleSystem;
|
|
249
|
+
/**
|
|
250
|
+
* Remove a specific alpha remap gradient
|
|
251
|
+
* @param gradient defines the gradient to remove
|
|
252
|
+
* @returns the current particle system
|
|
253
|
+
*/
|
|
254
|
+
removeAlphaRemapGradient(gradient: number): IParticleSystem;
|
|
255
|
+
/**
|
|
256
|
+
* Adds a new angular speed gradient
|
|
257
|
+
* @param gradient defines the gradient to use (between 0 and 1)
|
|
258
|
+
* @param factor defines the angular speed to affect to the specified gradient
|
|
259
|
+
* @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
|
|
260
|
+
* @returns the current particle system
|
|
261
|
+
*/
|
|
262
|
+
addAngularSpeedGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;
|
|
263
|
+
/**
|
|
264
|
+
* Remove a specific angular speed gradient
|
|
265
|
+
* @param gradient defines the gradient to remove
|
|
266
|
+
* @returns the current particle system
|
|
267
|
+
*/
|
|
268
|
+
removeAngularSpeedGradient(gradient: number): IParticleSystem;
|
|
269
|
+
/**
|
|
270
|
+
* Adds a new velocity gradient
|
|
271
|
+
* @param gradient defines the gradient to use (between 0 and 1)
|
|
272
|
+
* @param factor defines the velocity to affect to the specified gradient
|
|
273
|
+
* @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
|
|
274
|
+
* @returns the current particle system
|
|
275
|
+
*/
|
|
276
|
+
addVelocityGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;
|
|
277
|
+
/**
|
|
278
|
+
* Remove a specific velocity gradient
|
|
279
|
+
* @param gradient defines the gradient to remove
|
|
280
|
+
* @returns the current particle system
|
|
281
|
+
*/
|
|
282
|
+
removeVelocityGradient(gradient: number): IParticleSystem;
|
|
283
|
+
/**
|
|
284
|
+
* Adds a new limit velocity gradient
|
|
285
|
+
* @param gradient defines the gradient to use (between 0 and 1)
|
|
286
|
+
* @param factor defines the limit velocity value to affect to the specified gradient
|
|
287
|
+
* @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
|
|
288
|
+
* @returns the current particle system
|
|
289
|
+
*/
|
|
290
|
+
addLimitVelocityGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;
|
|
291
|
+
/**
|
|
292
|
+
* Remove a specific limit velocity gradient
|
|
293
|
+
* @param gradient defines the gradient to remove
|
|
294
|
+
* @returns the current particle system
|
|
295
|
+
*/
|
|
296
|
+
removeLimitVelocityGradient(gradient: number): IParticleSystem;
|
|
297
|
+
/**
|
|
298
|
+
* Adds a new drag gradient
|
|
299
|
+
* @param gradient defines the gradient to use (between 0 and 1)
|
|
300
|
+
* @param factor defines the drag value to affect to the specified gradient
|
|
301
|
+
* @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
|
|
302
|
+
* @returns the current particle system
|
|
303
|
+
*/
|
|
304
|
+
addDragGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;
|
|
305
|
+
/**
|
|
306
|
+
* Remove a specific drag gradient
|
|
307
|
+
* @param gradient defines the gradient to remove
|
|
308
|
+
* @returns the current particle system
|
|
309
|
+
*/
|
|
310
|
+
removeDragGradient(gradient: number): IParticleSystem;
|
|
311
|
+
/**
|
|
312
|
+
* Adds a new emit rate gradient (please note that this will only work if you set the targetStopDuration property)
|
|
313
|
+
* @param gradient defines the gradient to use (between 0 and 1)
|
|
314
|
+
* @param factor defines the emit rate value to affect to the specified gradient
|
|
315
|
+
* @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
|
|
316
|
+
* @returns the current particle system
|
|
317
|
+
*/
|
|
318
|
+
addEmitRateGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;
|
|
319
|
+
/**
|
|
320
|
+
* Remove a specific emit rate gradient
|
|
321
|
+
* @param gradient defines the gradient to remove
|
|
322
|
+
* @returns the current particle system
|
|
323
|
+
*/
|
|
324
|
+
removeEmitRateGradient(gradient: number): IParticleSystem;
|
|
325
|
+
/**
|
|
326
|
+
* Adds a new start size gradient (please note that this will only work if you set the targetStopDuration property)
|
|
327
|
+
* @param gradient defines the gradient to use (between 0 and 1)
|
|
328
|
+
* @param factor defines the start size value to affect to the specified gradient
|
|
329
|
+
* @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
|
|
330
|
+
* @returns the current particle system
|
|
331
|
+
*/
|
|
332
|
+
addStartSizeGradient(gradient: number, factor: number, factor2?: number): IParticleSystem;
|
|
333
|
+
/**
|
|
334
|
+
* Remove a specific start size gradient
|
|
335
|
+
* @param gradient defines the gradient to remove
|
|
336
|
+
* @returns the current particle system
|
|
337
|
+
*/
|
|
338
|
+
removeStartSizeGradient(gradient: number): IParticleSystem;
|
|
339
|
+
private _createRampGradientTexture;
|
|
340
|
+
/**
|
|
341
|
+
* Gets the current list of ramp gradients.
|
|
342
|
+
* You must use addRampGradient and removeRampGradient to update this list
|
|
343
|
+
* @returns the list of ramp gradients
|
|
344
|
+
*/
|
|
345
|
+
getRampGradients(): Nullable<Array<Color3Gradient>>;
|
|
346
|
+
/** Force the system to rebuild all gradients that need to be resync */
|
|
347
|
+
forceRefreshGradients(): void;
|
|
348
|
+
private _syncRampGradientTexture;
|
|
349
|
+
/**
|
|
350
|
+
* Adds a new ramp gradient used to remap particle colors
|
|
351
|
+
* @param gradient defines the gradient to use (between 0 and 1)
|
|
352
|
+
* @param color defines the color to affect to the specified gradient
|
|
353
|
+
* @returns the current particle system
|
|
354
|
+
*/
|
|
355
|
+
addRampGradient(gradient: number, color: Color3): ThinParticleSystem;
|
|
356
|
+
/**
|
|
357
|
+
* Remove a specific ramp gradient
|
|
358
|
+
* @param gradient defines the gradient to remove
|
|
359
|
+
* @returns the current particle system
|
|
360
|
+
*/
|
|
361
|
+
removeRampGradient(gradient: number): ThinParticleSystem;
|
|
362
|
+
/**
|
|
363
|
+
* Adds a new color gradient
|
|
364
|
+
* @param gradient defines the gradient to use (between 0 and 1)
|
|
365
|
+
* @param color1 defines the color to affect to the specified gradient
|
|
366
|
+
* @param color2 defines an additional color used to define a range ([color, color2]) with main color to pick the final color from
|
|
367
|
+
* @returns this particle system
|
|
368
|
+
*/
|
|
369
|
+
addColorGradient(gradient: number, color1: Color4, color2?: Color4): IParticleSystem;
|
|
370
|
+
/**
|
|
371
|
+
* Remove a specific color gradient
|
|
372
|
+
* @param gradient defines the gradient to remove
|
|
373
|
+
* @returns this particle system
|
|
374
|
+
*/
|
|
375
|
+
removeColorGradient(gradient: number): IParticleSystem;
|
|
376
|
+
/**
|
|
377
|
+
* Resets the draw wrappers cache
|
|
378
|
+
*/
|
|
379
|
+
resetDrawCache(): void;
|
|
380
|
+
private _fetchR;
|
|
381
|
+
protected _reset(): void;
|
|
382
|
+
private _resetEffect;
|
|
383
|
+
private _createVertexBuffers;
|
|
384
|
+
private _createIndexBuffer;
|
|
385
|
+
/**
|
|
386
|
+
* Gets the maximum number of particles active at the same time.
|
|
387
|
+
* @returns The max number of active particles.
|
|
388
|
+
*/
|
|
389
|
+
getCapacity(): number;
|
|
390
|
+
/**
|
|
391
|
+
* Gets whether there are still active particles in the system.
|
|
392
|
+
* @returns True if it is alive, otherwise false.
|
|
393
|
+
*/
|
|
394
|
+
isAlive(): boolean;
|
|
395
|
+
/**
|
|
396
|
+
* Gets if the system has been started. (Note: this will still be true after stop is called)
|
|
397
|
+
* @returns True if it has been started, otherwise false.
|
|
398
|
+
*/
|
|
399
|
+
isStarted(): boolean;
|
|
400
|
+
/** @internal */
|
|
401
|
+
_preStart(): void;
|
|
402
|
+
/**
|
|
403
|
+
* Starts the particle system and begins to emit
|
|
404
|
+
* @param delay defines the delay in milliseconds before starting the system (this.startDelay by default)
|
|
405
|
+
*/
|
|
406
|
+
start(delay?: number): void;
|
|
407
|
+
/**
|
|
408
|
+
* Stops the particle system.
|
|
409
|
+
* @param stopSubEmitters if true it will stop the current system and all created sub-Systems if false it will stop the current root system only, this param is used by the root particle system only. the default value is true.
|
|
410
|
+
*/
|
|
411
|
+
stop(stopSubEmitters?: boolean): void;
|
|
412
|
+
/** @internal */
|
|
413
|
+
_postStop(stopSubEmitters: boolean): void;
|
|
414
|
+
/**
|
|
415
|
+
* Remove all active particles
|
|
416
|
+
*/
|
|
417
|
+
reset(): void;
|
|
418
|
+
/**
|
|
419
|
+
* @internal (for internal use only)
|
|
420
|
+
*/
|
|
421
|
+
_appendParticleVertex(index: number, particle: Particle, offsetX: number, offsetY: number): void;
|
|
422
|
+
/**
|
|
423
|
+
* "Recycles" one of the particle by copying it back to the "stock" of particles and removing it from the active list.
|
|
424
|
+
* Its lifetime will start back at 0.
|
|
425
|
+
* @param particle
|
|
426
|
+
*/
|
|
427
|
+
recycleParticle: (particle: Particle) => void;
|
|
428
|
+
private _createParticle;
|
|
429
|
+
/** @internal */
|
|
430
|
+
_prepareParticle(particle: Particle): void;
|
|
431
|
+
private _update;
|
|
432
|
+
/**
|
|
433
|
+
* @internal
|
|
434
|
+
*/
|
|
435
|
+
static _GetAttributeNamesOrOptions(isAnimationSheetEnabled?: boolean, isBillboardBased?: boolean, useRampGradients?: boolean): string[];
|
|
436
|
+
/**
|
|
437
|
+
* @internal
|
|
438
|
+
*/
|
|
439
|
+
static _GetEffectCreationOptions(isAnimationSheetEnabled?: boolean, useLogarithmicDepth?: boolean, applyFog?: boolean): string[];
|
|
440
|
+
/**
|
|
441
|
+
* Fill the defines array according to the current settings of the particle system
|
|
442
|
+
* @param defines Array to be updated
|
|
443
|
+
* @param blendMode blend mode to take into account when updating the array
|
|
444
|
+
*/
|
|
445
|
+
fillDefines(defines: Array<string>, blendMode: number): void;
|
|
446
|
+
/**
|
|
447
|
+
* Fill the uniforms, attributes and samplers arrays according to the current settings of the particle system
|
|
448
|
+
* @param uniforms Uniforms array to fill
|
|
449
|
+
* @param attributes Attributes array to fill
|
|
450
|
+
* @param samplers Samplers array to fill
|
|
451
|
+
*/
|
|
452
|
+
fillUniformsAttributesAndSamplerNames(uniforms: Array<string>, attributes: Array<string>, samplers: Array<string>): void;
|
|
453
|
+
/**
|
|
454
|
+
* @internal
|
|
455
|
+
*/
|
|
456
|
+
private _getWrapper;
|
|
457
|
+
/**
|
|
458
|
+
* Animates the particle system for the current frame by emitting new particles and or animating the living ones.
|
|
459
|
+
* @param preWarmOnly will prevent the system from updating the vertex buffer (default is false)
|
|
460
|
+
*/
|
|
461
|
+
animate(preWarmOnly?: boolean): void;
|
|
462
|
+
private _appendParticleVertices;
|
|
463
|
+
/**
|
|
464
|
+
* Rebuilds the particle system.
|
|
465
|
+
*/
|
|
466
|
+
rebuild(): void;
|
|
467
|
+
/**
|
|
468
|
+
* Is this system ready to be used/rendered
|
|
469
|
+
* @returns true if the system is ready
|
|
470
|
+
*/
|
|
471
|
+
isReady(): boolean;
|
|
472
|
+
private _render;
|
|
473
|
+
/**
|
|
474
|
+
* Renders the particle system in its current state.
|
|
475
|
+
* @returns the current number of particles
|
|
476
|
+
*/
|
|
477
|
+
render(): number;
|
|
478
|
+
/** @internal */
|
|
479
|
+
_onDispose(): void;
|
|
480
|
+
/**
|
|
481
|
+
* Disposes the particle system and free the associated resources
|
|
482
|
+
* @param disposeTexture defines if the particle texture must be disposed as well (true by default)
|
|
483
|
+
*/
|
|
484
|
+
dispose(disposeTexture?: boolean): void;
|
|
485
|
+
}
|