index.d.ts 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. declare module 'babylonjs/particles' {
  2. class Particle {
  3. private particleSystem;
  4. position: Vector3;
  5. direction: Vector3;
  6. color: Color4;
  7. colorStep: Color4;
  8. lifeTime: number;
  9. age: number;
  10. size: number;
  11. angle: number;
  12. angularSpeed: number;
  13. private _currentFrameCounter;
  14. cellIndex: number;
  15. constructor(particleSystem: ParticleSystem);
  16. updateCellIndex: (scaledUpdateSpeed: number) => void;
  17. private updateCellIndexWithSpeedCalculated(scaledUpdateSpeed);
  18. private updateCellIndexWithCustomSpeed();
  19. copyTo(other: Particle): void;
  20. }
  21. }
  22. declare module 'babylonjs/particles' {
  23. interface IParticleSystem {
  24. id: string;
  25. name: string;
  26. emitter: Nullable<AbstractMesh | Vector3>;
  27. renderingGroupId: number;
  28. layerMask: number;
  29. isStarted(): boolean;
  30. animate(): void;
  31. render(): number;
  32. dispose(): void;
  33. clone(name: string, newEmitter: any): Nullable<IParticleSystem>;
  34. serialize(): any;
  35. rebuild(): void;
  36. }
  37. class ParticleSystem implements IDisposable, IAnimatable, IParticleSystem {
  38. name: string;
  39. private _isAnimationSheetEnabled;
  40. static BLENDMODE_ONEONE: number;
  41. static BLENDMODE_STANDARD: number;
  42. animations: Animation[];
  43. id: string;
  44. renderingGroupId: number;
  45. emitter: Nullable<AbstractMesh | Vector3>;
  46. emitRate: number;
  47. manualEmitCount: number;
  48. updateSpeed: number;
  49. targetStopDuration: number;
  50. disposeOnStop: boolean;
  51. minEmitPower: number;
  52. maxEmitPower: number;
  53. minLifeTime: number;
  54. maxLifeTime: number;
  55. minSize: number;
  56. maxSize: number;
  57. minAngularSpeed: number;
  58. maxAngularSpeed: number;
  59. particleTexture: Nullable<Texture>;
  60. layerMask: number;
  61. customShader: any;
  62. preventAutoStart: boolean;
  63. private _epsilon;
  64. /**
  65. * An event triggered when the system is disposed.
  66. * @type {BABYLON.Observable}
  67. */
  68. onDisposeObservable: Observable<ParticleSystem>;
  69. private _onDisposeObserver;
  70. onDispose: () => void;
  71. updateFunction: (particles: Particle[]) => void;
  72. onAnimationEnd: Nullable<() => void>;
  73. blendMode: number;
  74. forceDepthWrite: boolean;
  75. gravity: Vector3;
  76. direction1: Vector3;
  77. direction2: Vector3;
  78. minEmitBox: Vector3;
  79. maxEmitBox: Vector3;
  80. color1: Color4;
  81. color2: Color4;
  82. colorDead: Color4;
  83. textureMask: Color4;
  84. particleEmitterType: IParticleEmitterType;
  85. startDirectionFunction: (emitPower: number, worldMatrix: Matrix, directionToUpdate: Vector3, particle: Particle) => void;
  86. startPositionFunction: (worldMatrix: Matrix, positionToUpdate: Vector3, particle: Particle) => void;
  87. private particles;
  88. private _capacity;
  89. private _scene;
  90. private _stockParticles;
  91. private _newPartsExcess;
  92. private _vertexData;
  93. private _vertexBuffer;
  94. private _vertexBuffers;
  95. private _indexBuffer;
  96. private _effect;
  97. private _customEffect;
  98. private _cachedDefines;
  99. private _scaledColorStep;
  100. private _colorDiff;
  101. private _scaledDirection;
  102. private _scaledGravity;
  103. private _currentRenderId;
  104. private _alive;
  105. private _started;
  106. private _stopped;
  107. private _actualFrame;
  108. private _scaledUpdateSpeed;
  109. startSpriteCellID: number;
  110. endSpriteCellID: number;
  111. spriteCellLoop: boolean;
  112. spriteCellChangeSpeed: number;
  113. spriteCellWidth: number;
  114. spriteCellHeight: number;
  115. private _vertexBufferSize;
  116. readonly isAnimationSheetEnabled: Boolean;
  117. constructor(name: string, capacity: number, scene: Scene, customEffect?: Nullable<Effect>, _isAnimationSheetEnabled?: boolean, epsilon?: number);
  118. private _createIndexBuffer();
  119. recycleParticle(particle: Particle): void;
  120. getCapacity(): number;
  121. isAlive(): boolean;
  122. isStarted(): boolean;
  123. start(): void;
  124. stop(): void;
  125. _appendParticleVertex(index: number, particle: Particle, offsetX: number, offsetY: number): void;
  126. _appendParticleVertexWithAnimation(index: number, particle: Particle, offsetX: number, offsetY: number): void;
  127. private _update(newParticles);
  128. private _getEffect();
  129. animate(): void;
  130. appendParticleVertexes: Nullable<(offset: number, particle: Particle) => void>;
  131. private appenedParticleVertexesWithSheet(offset, particle);
  132. private appenedParticleVertexesNoSheet(offset, particle);
  133. rebuild(): void;
  134. render(): number;
  135. dispose(): void;
  136. createSphereEmitter(radius?: number): SphereParticleEmitter;
  137. createDirectedSphereEmitter(radius?: number, direction1?: Vector3, direction2?: Vector3): SphereDirectedParticleEmitter;
  138. createConeEmitter(radius?: number, angle?: number): ConeParticleEmitter;
  139. createBoxEmitter(direction1: Vector3, direction2: Vector3, minEmitBox: Vector3, maxEmitBox: Vector3): BoxParticleEmitter;
  140. static randomNumber(min: number, max: number): number;
  141. clone(name: string, newEmitter: any): ParticleSystem;
  142. serialize(): any;
  143. static Parse(parsedParticleSystem: any, scene: Scene, rootUrl: string): ParticleSystem;
  144. }
  145. }
  146. declare module 'babylonjs/particles' {
  147. class BoxParticleEmitter implements IParticleEmitterType {
  148. private _particleSystem;
  149. direction1: Vector3;
  150. direction2: Vector3;
  151. minEmitBox: Vector3;
  152. maxEmitBox: Vector3;
  153. constructor(_particleSystem: ParticleSystem);
  154. startDirectionFunction(emitPower: number, worldMatrix: Matrix, directionToUpdate: Vector3, particle: Particle): void;
  155. startPositionFunction(worldMatrix: Matrix, positionToUpdate: Vector3, particle: Particle): void;
  156. }
  157. }
  158. declare module 'babylonjs/particles' {
  159. class ConeParticleEmitter implements IParticleEmitterType {
  160. radius: number;
  161. angle: number;
  162. constructor(radius: number, angle: number);
  163. startDirectionFunction(emitPower: number, worldMatrix: Matrix, directionToUpdate: Vector3, particle: Particle): void;
  164. startPositionFunction(worldMatrix: Matrix, positionToUpdate: Vector3, particle: Particle): void;
  165. }
  166. }
  167. declare module 'babylonjs/particles' {
  168. class SphereParticleEmitter implements IParticleEmitterType {
  169. radius: number;
  170. constructor(radius: number);
  171. startDirectionFunction(emitPower: number, worldMatrix: Matrix, directionToUpdate: Vector3, particle: Particle): void;
  172. startPositionFunction(worldMatrix: Matrix, positionToUpdate: Vector3, particle: Particle): void;
  173. }
  174. class SphereDirectedParticleEmitter extends SphereParticleEmitter {
  175. direction1: Vector3;
  176. direction2: Vector3;
  177. constructor(radius: number, direction1: Vector3, direction2: Vector3);
  178. startDirectionFunction(emitPower: number, worldMatrix: Matrix, directionToUpdate: Vector3, particle: Particle): void;
  179. }
  180. }
  181. declare module 'babylonjs/particles' {
  182. interface IParticleEmitterType {
  183. startDirectionFunction(emitPower: number, worldMatrix: Matrix, directionToUpdate: Vector3, particle: Particle): void;
  184. startPositionFunction(worldMatrix: Matrix, positionToUpdate: Vector3, particle: Particle): void;
  185. }
  186. }
  187. import {EffectFallbacks,EffectCreationOptions,Effect,Nullable,float,double,int,FloatArray,IndicesArray,KeyboardEventTypes,KeyboardInfo,KeyboardInfoPre,PointerEventTypes,PointerInfoBase,PointerInfoPre,PointerInfo,ToGammaSpace,ToLinearSpace,Epsilon,Color3,Color4,Vector2,Vector3,Vector4,ISize,Size,Quaternion,Matrix,Plane,Viewport,Frustum,Space,Axis,BezierCurve,Orientation,Angle,Arc2,Path2,Path3D,Curve3,PositionNormalVertex,PositionNormalTextureVertex,Tmp,Scalar,expandToProperty,serialize,serializeAsTexture,serializeAsColor3,serializeAsFresnelParameters,serializeAsVector2,serializeAsVector3,serializeAsMeshReference,serializeAsColorCurves,serializeAsColor4,serializeAsImageProcessingConfiguration,serializeAsQuaternion,SerializationHelper,EventState,Observer,MultiObserver,Observable,SmartArray,SmartArrayNoDuplicate,IAnimatable,LoadFileError,RetryStrategy,IFileRequest,Tools,PerfCounter,className,AsyncLoop,_AlphaState,_DepthCullingState,_StencilState,InstancingAttributeInfo,RenderTargetCreationOptions,EngineCapabilities,EngineOptions,IDisplayChangedEventArgs,Engine,Node,BoundingSphere,BoundingBox,ICullable,BoundingInfo,TransformNode,AbstractMesh,Light,Camera,RenderingManager,RenderingGroup,IDisposable,IActiveMeshCandidateProvider,RenderingGroupInfo,Scene,Buffer,VertexBuffer,InternalTexture,BaseTexture,Texture,_InstancesBatch,Mesh,BaseSubMesh,SubMesh,MaterialDefines,Material,UniformBuffer,IGetSetVerticesData,VertexData,Geometry,_PrimitiveGeometry,RibbonGeometry,BoxGeometry,SphereGeometry,DiscGeometry,CylinderGeometry,TorusGeometry,GroundGeometry,TiledGroundGeometry,PlaneGeometry,TorusKnotGeometry,PostProcessManager,PerformanceMonitor,RollingAverage,IImageProcessingConfigurationDefines,ImageProcessingConfiguration,ColorGradingTexture,ColorCurves,Behavior,MaterialHelper,PushMaterial,StandardMaterialDefines,StandardMaterial} from 'babylonjs/core';
  188. import {EngineInstrumentation,SceneInstrumentation,_TimeToken} from 'babylonjs/instrumentation';
  189. import {GPUParticleSystem} from 'babylonjs/gpuParticles';
  190. import {FramingBehavior,BouncingBehavior,AutoRotationBehavior} from 'babylonjs/cameraBehaviors';
  191. import {NullEngineOptions,NullEngine} from 'babylonjs/nullEngine';
  192. import {TextureTools} from 'babylonjs/textureTools';
  193. import {SolidParticle,ModelShape,DepthSortedParticle,SolidParticleSystem} from 'babylonjs/solidParticles';
  194. import {Collider,CollisionWorker,ICollisionCoordinator,SerializedMesh,SerializedSubMesh,SerializedGeometry,BabylonMessage,SerializedColliderToWorker,WorkerTaskType,WorkerReply,CollisionReplyPayload,InitPayload,CollidePayload,UpdatePayload,WorkerReplyType,CollisionCoordinatorWorker,CollisionCoordinatorLegacy} from 'babylonjs/collisions';
  195. import {IntersectionInfo,PickingInfo,Ray} from 'babylonjs/picking';
  196. import {SpriteManager,Sprite} from 'babylonjs/sprites';
  197. import {AnimationRange,AnimationEvent,PathCursor,Animation,TargetedAnimation,AnimationGroup,RuntimeAnimation,Animatable,IEasingFunction,EasingFunction,CircleEase,BackEase,BounceEase,CubicEase,ElasticEase,ExponentialEase,PowerEase,QuadraticEase,QuarticEase,QuinticEase,SineEase,BezierCurveEase} from 'babylonjs/animations';
  198. import {Condition,ValueCondition,PredicateCondition,StateCondition,Action,ActionEvent,ActionManager,InterpolateValueAction,SwitchBooleanAction,SetStateAction,SetValueAction,IncrementValueAction,PlayAnimationAction,StopAnimationAction,DoNothingAction,CombineAction,ExecuteCodeAction,SetParentAction,PlaySoundAction,StopSoundAction} from 'babylonjs/actions';
  199. import {GroundMesh,InstancedMesh,LinesMesh} from 'babylonjs/additionalMeshes';
  200. import {ShaderMaterial} from 'babylonjs/shaderMaterial';
  201. import {MeshBuilder} from 'babylonjs/meshBuilder';
  202. import {PBRBaseMaterial,PBRBaseSimpleMaterial,PBRMaterial,PBRMetallicRoughnessMaterial,PBRSpecularGlossinessMaterial} from 'babylonjs/pbrMaterial';
  203. import {CameraInputTypes,ICameraInput,CameraInputsMap,CameraInputsManager,TargetCamera} from 'babylonjs/targetCamera';
  204. import {ArcRotateCameraKeyboardMoveInput,ArcRotateCameraMouseWheelInput,ArcRotateCameraPointersInput,ArcRotateCameraInputsManager,ArcRotateCamera} from 'babylonjs/arcRotateCamera';
  205. import {FreeCameraMouseInput,FreeCameraKeyboardMoveInput,FreeCameraInputsManager,FreeCamera} from 'babylonjs/freeCamera';
  206. import {HemisphericLight} from 'babylonjs/hemisphericLight';
  207. import {IShadowLight,ShadowLight,PointLight} from 'babylonjs/pointLight';
  208. import {DirectionalLight} from 'babylonjs/directionalLight';
  209. import {SpotLight} from 'babylonjs/spotLight';
  210. import {CubeTexture,RenderTargetTexture,IMultiRenderTargetOptions,MultiRenderTarget,MirrorTexture,RefractionTexture,DynamicTexture,VideoTexture,RawTexture} from 'babylonjs/additionalTextures';
  211. import {AudioEngine,Sound,SoundTrack,Analyser} from 'babylonjs/audio';
  212. import {ILoadingScreen,DefaultLoadingScreen,SceneLoaderProgressEvent,ISceneLoaderPluginExtensions,ISceneLoaderPluginFactory,ISceneLoaderPlugin,ISceneLoaderPluginAsync,SceneLoader,FilesInput} from 'babylonjs/loader';
  213. import {IShadowGenerator,ShadowGenerator} from 'babylonjs/shadows';
  214. import {StringDictionary} from 'babylonjs/stringDictionary';
  215. import {Tags,AndOrNotEvaluator} from 'babylonjs/userData';
  216. import {FresnelParameters} from 'babylonjs/fresnel';
  217. import {MultiMaterial} from 'babylonjs/multiMaterial';
  218. import {Database} from 'babylonjs/offline';
  219. import {FreeCameraTouchInput,TouchCamera} from 'babylonjs/touchCamera';
  220. import {ProceduralTexture,CustomProceduralTexture} from 'babylonjs/procedural';
  221. import {FreeCameraGamepadInput,ArcRotateCameraGamepadInput,GamepadManager,StickValues,GamepadButtonChanges,Gamepad,GenericPad,Xbox360Button,Xbox360Dpad,Xbox360Pad,PoseEnabledControllerType,MutableGamepadButton,ExtendedGamepadButton,PoseEnabledControllerHelper,PoseEnabledController,WebVRController,OculusTouchController,ViveController,GenericController,WindowsMotionController} from 'babylonjs/gamepad';
  222. import {FollowCamera,ArcFollowCamera,UniversalCamera,GamepadCamera} from 'babylonjs/additionalCameras';
  223. import {DepthRenderer} from 'babylonjs/depthRenderer';
  224. import {GeometryBufferRenderer} from 'babylonjs/geometryBufferRenderer';
  225. import {PostProcessOptions,PostProcess,PassPostProcess} from 'babylonjs/postProcesses';
  226. import {BlurPostProcess} from 'babylonjs/additionalPostProcess_blur';
  227. import {FxaaPostProcess} from 'babylonjs/additionalPostProcess_fxaa';
  228. import {HighlightsPostProcess} from 'babylonjs/additionalPostProcess_highlights';
  229. import {RefractionPostProcess,BlackAndWhitePostProcess,ConvolutionPostProcess,FilterPostProcess,VolumetricLightScatteringPostProcess,ColorCorrectionPostProcess,TonemappingOperator,TonemapPostProcess,DisplayPassPostProcess,ImageProcessingPostProcess} from 'babylonjs/additionalPostProcesses';
  230. import {PostProcessRenderPipelineManager,PostProcessRenderPass,PostProcessRenderEffect,PostProcessRenderPipeline} from 'babylonjs/renderingPipeline';
  231. import {SSAORenderingPipeline,SSAO2RenderingPipeline,LensRenderingPipeline,StandardRenderingPipeline} from 'babylonjs/additionalRenderingPipeline';
  232. import {DefaultRenderingPipeline} from 'babylonjs/defaultRenderingPipeline';
  233. import {Bone,BoneIKController,BoneLookController,Skeleton} from 'babylonjs/bones';
  234. import {SphericalPolynomial,SphericalHarmonics,CubeMapToSphericalPolynomialTools,CubeMapInfo,PanoramaToCubeMapTools,HDRInfo,HDRTools,HDRCubeTexture} from 'babylonjs/hdr';
  235. import {CSG} from 'babylonjs/csg';
  236. import {Polygon,PolygonMeshBuilder} from 'babylonjs/polygonMesh';
  237. import {LensFlare,LensFlareSystem} from 'babylonjs/lensFlares';
  238. import {PhysicsJointData,PhysicsJoint,DistanceJoint,MotorEnabledJoint,HingeJoint,Hinge2Joint,IMotorEnabledJoint,DistanceJointData,SpringJointData,PhysicsImpostorParameters,IPhysicsEnabledObject,PhysicsImpostor,PhysicsImpostorJoint,PhysicsEngine,IPhysicsEnginePlugin,PhysicsHelper,PhysicsRadialExplosionEvent,PhysicsGravitationalFieldEvent,PhysicsUpdraftEvent,PhysicsVortexEvent,PhysicsRadialImpulseFalloff,PhysicsUpdraftMode,PhysicsForceAndContactPoint,PhysicsRadialExplosionEventData,PhysicsGravitationalFieldEventData,PhysicsUpdraftEventData,PhysicsVortexEventData,CannonJSPlugin,OimoJSPlugin} from 'babylonjs/physics';
  239. import {TGATools,DDSInfo,DDSTools,KhronosTextureContainer} from 'babylonjs/textureFormats';
  240. import {Debug,RayHelper,DebugLayer,BoundingBoxRenderer} from 'babylonjs/debug';
  241. import {MorphTarget,MorphTargetManager} from 'babylonjs/morphTargets';
  242. import {IOctreeContainer,Octree,OctreeBlock} from 'babylonjs/octrees';
  243. import {SIMDHelper} from 'babylonjs/simd';
  244. import {VRDistortionCorrectionPostProcess,AnaglyphPostProcess,StereoscopicInterlacePostProcess,FreeCameraDeviceOrientationInput,ArcRotateCameraVRDeviceOrientationInput,VRCameraMetrics,DevicePose,PoseControlled,WebVROptions,WebVRFreeCamera,DeviceOrientationCamera,VRDeviceOrientationFreeCamera,VRDeviceOrientationGamepadCamera,VRDeviceOrientationArcRotateCamera,AnaglyphFreeCamera,AnaglyphArcRotateCamera,AnaglyphGamepadCamera,AnaglyphUniversalCamera,StereoscopicFreeCamera,StereoscopicArcRotateCamera,StereoscopicGamepadCamera,StereoscopicUniversalCamera,VRTeleportationOptions,VRExperienceHelperOptions,VRExperienceHelper} from 'babylonjs/vr';
  245. import {JoystickAxis,VirtualJoystick,VirtualJoysticksCamera,FreeCameraVirtualJoystickInput} from 'babylonjs/virtualJoystick';
  246. import {ISimplifier,ISimplificationSettings,SimplificationSettings,ISimplificationTask,SimplificationQueue,SimplificationType,DecimationTriangle,DecimationVertex,QuadraticMatrix,Reference,QuadraticErrorSimplification,MeshLODLevel,SceneOptimization,TextureOptimization,HardwareScalingOptimization,ShadowsOptimization,PostProcessesOptimization,LensFlaresOptimization,ParticlesOptimization,RenderTargetsOptimization,MergeMeshesOptimization,SceneOptimizerOptions,SceneOptimizer} from 'babylonjs/optimizations';
  247. import {OutlineRenderer,EdgesRenderer,IHighlightLayerOptions,HighlightLayer} from 'babylonjs/highlights';
  248. import {SceneSerializer} from 'babylonjs/serialization';
  249. import {AssetTaskState,AbstractAssetTask,IAssetsProgressEvent,AssetsProgressEvent,MeshAssetTask,TextFileAssetTask,BinaryFileAssetTask,ImageAssetTask,ITextureAssetTask,TextureAssetTask,CubeTextureAssetTask,HDRCubeTextureAssetTask,AssetsManager} from 'babylonjs/assetsManager';
  250. import {ReflectionProbe} from 'babylonjs/probes';
  251. import {BackgroundMaterial} from 'babylonjs/backgroundMaterial';
  252. import {Layer} from 'babylonjs/layer';
  253. import {IEnvironmentHelperOptions,EnvironmentHelper} from 'babylonjs/environmentHelper';