index.d.ts 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. declare module 'babylonjs/additionalMeshes' {
  2. class GroundMesh extends Mesh {
  3. generateOctree: boolean;
  4. private _heightQuads;
  5. _subdivisionsX: number;
  6. _subdivisionsY: number;
  7. _width: number;
  8. _height: number;
  9. _minX: number;
  10. _maxX: number;
  11. _minZ: number;
  12. _maxZ: number;
  13. constructor(name: string, scene: Scene);
  14. getClassName(): string;
  15. readonly subdivisions: number;
  16. readonly subdivisionsX: number;
  17. readonly subdivisionsY: number;
  18. optimize(chunksCount: number, octreeBlocksSize?: number): void;
  19. /**
  20. * Returns a height (y) value in the Worl system :
  21. * the ground altitude at the coordinates (x, z) expressed in the World system.
  22. * Returns the ground y position if (x, z) are outside the ground surface.
  23. */
  24. getHeightAtCoordinates(x: number, z: number): number;
  25. /**
  26. * Returns a normalized vector (Vector3) orthogonal to the ground
  27. * at the ground coordinates (x, z) expressed in the World system.
  28. * Returns Vector3(0.0, 1.0, 0.0) if (x, z) are outside the ground surface.
  29. */
  30. getNormalAtCoordinates(x: number, z: number): Vector3;
  31. /**
  32. * Updates the Vector3 passed a reference with a normalized vector orthogonal to the ground
  33. * at the ground coordinates (x, z) expressed in the World system.
  34. * Doesn't uptade the reference Vector3 if (x, z) are outside the ground surface.
  35. * Returns the GroundMesh.
  36. */
  37. getNormalAtCoordinatesToRef(x: number, z: number, ref: Vector3): GroundMesh;
  38. /**
  39. * Force the heights to be recomputed for getHeightAtCoordinates() or getNormalAtCoordinates()
  40. * if the ground has been updated.
  41. * This can be used in the render loop.
  42. * Returns the GroundMesh.
  43. */
  44. updateCoordinateHeights(): GroundMesh;
  45. private _getFacetAt(x, z);
  46. private _initHeightQuads();
  47. private _computeHeightQuads();
  48. serialize(serializationObject: any): void;
  49. static Parse(parsedMesh: any, scene: Scene): GroundMesh;
  50. }
  51. }
  52. declare module 'babylonjs/additionalMeshes' {
  53. /**
  54. * Creates an instance based on a source mesh.
  55. */
  56. class InstancedMesh extends AbstractMesh {
  57. private _sourceMesh;
  58. private _currentLOD;
  59. constructor(name: string, source: Mesh);
  60. /**
  61. * Returns the string "InstancedMesh".
  62. */
  63. getClassName(): string;
  64. readonly receiveShadows: boolean;
  65. readonly material: Nullable<Material>;
  66. readonly visibility: number;
  67. readonly skeleton: Nullable<Skeleton>;
  68. readonly renderingGroupId: number;
  69. /**
  70. * Returns the total number of vertices (integer).
  71. */
  72. getTotalVertices(): number;
  73. readonly sourceMesh: Mesh;
  74. /**
  75. * Returns a float array or a Float32Array of the requested kind of data : positons, normals, uvs, etc.
  76. */
  77. getVerticesData(kind: string, copyWhenShared?: boolean): Nullable<FloatArray>;
  78. /**
  79. * Sets the vertex data of the mesh geometry for the requested `kind`.
  80. * If the mesh has no geometry, a new Geometry object is set to the mesh and then passed this vertex data.
  81. * The `data` are either a numeric array either a Float32Array.
  82. * The parameter `updatable` is passed as is to the underlying Geometry object constructor (if initianilly none) or updater.
  83. * The parameter `stride` is an optional positive integer, it is usually automatically deducted from the `kind` (3 for positions or normals, 2 for UV, etc).
  84. * Note that a new underlying VertexBuffer object is created each call.
  85. * If the `kind` is the `PositionKind`, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed.
  86. *
  87. * Possible `kind` values :
  88. * - BABYLON.VertexBuffer.PositionKind
  89. * - BABYLON.VertexBuffer.UVKind
  90. * - BABYLON.VertexBuffer.UV2Kind
  91. * - BABYLON.VertexBuffer.UV3Kind
  92. * - BABYLON.VertexBuffer.UV4Kind
  93. * - BABYLON.VertexBuffer.UV5Kind
  94. * - BABYLON.VertexBuffer.UV6Kind
  95. * - BABYLON.VertexBuffer.ColorKind
  96. * - BABYLON.VertexBuffer.MatricesIndicesKind
  97. * - BABYLON.VertexBuffer.MatricesIndicesExtraKind
  98. * - BABYLON.VertexBuffer.MatricesWeightsKind
  99. * - BABYLON.VertexBuffer.MatricesWeightsExtraKind
  100. *
  101. * Returns the Mesh.
  102. */
  103. setVerticesData(kind: string, data: FloatArray, updatable?: boolean, stride?: number): Mesh;
  104. /**
  105. * Updates the existing vertex data of the mesh geometry for the requested `kind`.
  106. * If the mesh has no geometry, it is simply returned as it is.
  107. * The `data` are either a numeric array either a Float32Array.
  108. * No new underlying VertexBuffer object is created.
  109. * If the `kind` is the `PositionKind` and if `updateExtends` is true, the mesh BoundingInfo is renewed, so the bounding box and sphere, and the mesh World Matrix is recomputed.
  110. * If the parameter `makeItUnique` is true, a new global geometry is created from this positions and is set to the mesh.
  111. *
  112. * Possible `kind` values :
  113. * - BABYLON.VertexBuffer.PositionKind
  114. * - BABYLON.VertexBuffer.UVKind
  115. * - BABYLON.VertexBuffer.UV2Kind
  116. * - BABYLON.VertexBuffer.UV3Kind
  117. * - BABYLON.VertexBuffer.UV4Kind
  118. * - BABYLON.VertexBuffer.UV5Kind
  119. * - BABYLON.VertexBuffer.UV6Kind
  120. * - BABYLON.VertexBuffer.ColorKind
  121. * - BABYLON.VertexBuffer.MatricesIndicesKind
  122. * - BABYLON.VertexBuffer.MatricesIndicesExtraKind
  123. * - BABYLON.VertexBuffer.MatricesWeightsKind
  124. * - BABYLON.VertexBuffer.MatricesWeightsExtraKind
  125. *
  126. * Returns the Mesh.
  127. */
  128. updateVerticesData(kind: string, data: FloatArray, updateExtends?: boolean, makeItUnique?: boolean): Mesh;
  129. /**
  130. * Sets the mesh indices.
  131. * Expects an array populated with integers or a typed array (Int32Array, Uint32Array, Uint16Array).
  132. * If the mesh has no geometry, a new Geometry object is created and set to the mesh.
  133. * This method creates a new index buffer each call.
  134. * Returns the Mesh.
  135. */
  136. setIndices(indices: IndicesArray, totalVertices?: Nullable<number>): Mesh;
  137. /**
  138. * Boolean : True if the mesh owns the requested kind of data.
  139. */
  140. isVerticesDataPresent(kind: string): boolean;
  141. /**
  142. * Returns an array of indices (IndicesArray).
  143. */
  144. getIndices(): Nullable<IndicesArray>;
  145. readonly _positions: Nullable<Vector3[]>;
  146. /**
  147. * Sets a new updated BoundingInfo to the mesh.
  148. * Returns the mesh.
  149. */
  150. refreshBoundingInfo(): InstancedMesh;
  151. _preActivate(): InstancedMesh;
  152. _activate(renderId: number): InstancedMesh;
  153. /**
  154. * Returns the current associated LOD AbstractMesh.
  155. */
  156. getLOD(camera: Camera): AbstractMesh;
  157. _syncSubMeshes(): InstancedMesh;
  158. _generatePointsArray(): boolean;
  159. /**
  160. * Creates a new InstancedMesh from the current mesh.
  161. * - name (string) : the cloned mesh name
  162. * - newParent (optional Node) : the optional Node to parent the clone to.
  163. * - doNotCloneChildren (optional boolean, default `false`) : if `true` the model children aren't cloned.
  164. *
  165. * Returns the clone.
  166. */
  167. clone(name: string, newParent: Node, doNotCloneChildren?: boolean): InstancedMesh;
  168. /**
  169. * Disposes the InstancedMesh.
  170. * Returns nothing.
  171. */
  172. dispose(doNotRecurse?: boolean): void;
  173. }
  174. }
  175. declare module 'babylonjs/additionalMeshes' {
  176. class LinesMesh extends Mesh {
  177. useVertexColor: boolean | undefined;
  178. useVertexAlpha: boolean | undefined;
  179. color: Color3;
  180. alpha: number;
  181. /**
  182. * The intersection Threshold is the margin applied when intersection a segment of the LinesMesh with a Ray.
  183. * This margin is expressed in world space coordinates, so its value may vary.
  184. * Default value is 0.1
  185. * @returns the intersection Threshold value.
  186. */
  187. /**
  188. * The intersection Threshold is the margin applied when intersection a segment of the LinesMesh with a Ray.
  189. * This margin is expressed in world space coordinates, so its value may vary.
  190. * @param value the new threshold to apply
  191. */
  192. intersectionThreshold: number;
  193. private _intersectionThreshold;
  194. private _colorShader;
  195. constructor(name: string, scene?: Nullable<Scene>, parent?: Nullable<Node>, source?: LinesMesh, doNotCloneChildren?: boolean, useVertexColor?: boolean | undefined, useVertexAlpha?: boolean | undefined);
  196. /**
  197. * Returns the string "LineMesh"
  198. */
  199. getClassName(): string;
  200. material: Material;
  201. readonly checkCollisions: boolean;
  202. createInstance(name: string): InstancedMesh;
  203. _bind(subMesh: SubMesh, effect: Effect, fillMode: number): LinesMesh;
  204. _draw(subMesh: SubMesh, fillMode: number, instancesCount?: number): LinesMesh;
  205. dispose(doNotRecurse?: boolean): void;
  206. /**
  207. * Returns a new LineMesh object cloned from the current one.
  208. */
  209. clone(name: string, newParent?: Node, doNotCloneChildren?: boolean): LinesMesh;
  210. }
  211. }
  212. 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';
  213. import {EngineInstrumentation,SceneInstrumentation,_TimeToken} from 'babylonjs/instrumentation';
  214. import {Particle,IParticleSystem,ParticleSystem,BoxParticleEmitter,ConeParticleEmitter,SphereParticleEmitter,SphereDirectedParticleEmitter,IParticleEmitterType} from 'babylonjs/particles';
  215. import {GPUParticleSystem} from 'babylonjs/gpuParticles';
  216. import {FramingBehavior,BouncingBehavior,AutoRotationBehavior} from 'babylonjs/cameraBehaviors';
  217. import {NullEngineOptions,NullEngine} from 'babylonjs/nullEngine';
  218. import {TextureTools} from 'babylonjs/textureTools';
  219. import {SolidParticle,ModelShape,DepthSortedParticle,SolidParticleSystem} from 'babylonjs/solidParticles';
  220. import {Collider,CollisionWorker,ICollisionCoordinator,SerializedMesh,SerializedSubMesh,SerializedGeometry,BabylonMessage,SerializedColliderToWorker,WorkerTaskType,WorkerReply,CollisionReplyPayload,InitPayload,CollidePayload,UpdatePayload,WorkerReplyType,CollisionCoordinatorWorker,CollisionCoordinatorLegacy} from 'babylonjs/collisions';
  221. import {IntersectionInfo,PickingInfo,Ray} from 'babylonjs/picking';
  222. import {SpriteManager,Sprite} from 'babylonjs/sprites';
  223. 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';
  224. import {Condition,ValueCondition,PredicateCondition,StateCondition,Action,ActionEvent,ActionManager,InterpolateValueAction,SwitchBooleanAction,SetStateAction,SetValueAction,IncrementValueAction,PlayAnimationAction,StopAnimationAction,DoNothingAction,CombineAction,ExecuteCodeAction,SetParentAction,PlaySoundAction,StopSoundAction} from 'babylonjs/actions';
  225. import {ShaderMaterial} from 'babylonjs/shaderMaterial';
  226. import {MeshBuilder} from 'babylonjs/meshBuilder';
  227. import {PBRBaseMaterial,PBRBaseSimpleMaterial,PBRMaterial,PBRMetallicRoughnessMaterial,PBRSpecularGlossinessMaterial} from 'babylonjs/pbrMaterial';
  228. import {CameraInputTypes,ICameraInput,CameraInputsMap,CameraInputsManager,TargetCamera} from 'babylonjs/targetCamera';
  229. import {ArcRotateCameraKeyboardMoveInput,ArcRotateCameraMouseWheelInput,ArcRotateCameraPointersInput,ArcRotateCameraInputsManager,ArcRotateCamera} from 'babylonjs/arcRotateCamera';
  230. import {FreeCameraMouseInput,FreeCameraKeyboardMoveInput,FreeCameraInputsManager,FreeCamera} from 'babylonjs/freeCamera';
  231. import {HemisphericLight} from 'babylonjs/hemisphericLight';
  232. import {IShadowLight,ShadowLight,PointLight} from 'babylonjs/pointLight';
  233. import {DirectionalLight} from 'babylonjs/directionalLight';
  234. import {SpotLight} from 'babylonjs/spotLight';
  235. import {CubeTexture,RenderTargetTexture,IMultiRenderTargetOptions,MultiRenderTarget,MirrorTexture,RefractionTexture,DynamicTexture,VideoTexture,RawTexture} from 'babylonjs/additionalTextures';
  236. import {AudioEngine,Sound,SoundTrack,Analyser} from 'babylonjs/audio';
  237. import {ILoadingScreen,DefaultLoadingScreen,SceneLoaderProgressEvent,ISceneLoaderPluginExtensions,ISceneLoaderPluginFactory,ISceneLoaderPlugin,ISceneLoaderPluginAsync,SceneLoader,FilesInput} from 'babylonjs/loader';
  238. import {IShadowGenerator,ShadowGenerator} from 'babylonjs/shadows';
  239. import {StringDictionary} from 'babylonjs/stringDictionary';
  240. import {Tags,AndOrNotEvaluator} from 'babylonjs/userData';
  241. import {FresnelParameters} from 'babylonjs/fresnel';
  242. import {MultiMaterial} from 'babylonjs/multiMaterial';
  243. import {Database} from 'babylonjs/offline';
  244. import {FreeCameraTouchInput,TouchCamera} from 'babylonjs/touchCamera';
  245. import {ProceduralTexture,CustomProceduralTexture} from 'babylonjs/procedural';
  246. import {FreeCameraGamepadInput,ArcRotateCameraGamepadInput,GamepadManager,StickValues,GamepadButtonChanges,Gamepad,GenericPad,Xbox360Button,Xbox360Dpad,Xbox360Pad,PoseEnabledControllerType,MutableGamepadButton,ExtendedGamepadButton,PoseEnabledControllerHelper,PoseEnabledController,WebVRController,OculusTouchController,ViveController,GenericController,WindowsMotionController} from 'babylonjs/gamepad';
  247. import {FollowCamera,ArcFollowCamera,UniversalCamera,GamepadCamera} from 'babylonjs/additionalCameras';
  248. import {DepthRenderer} from 'babylonjs/depthRenderer';
  249. import {GeometryBufferRenderer} from 'babylonjs/geometryBufferRenderer';
  250. import {PostProcessOptions,PostProcess,PassPostProcess} from 'babylonjs/postProcesses';
  251. import {BlurPostProcess} from 'babylonjs/additionalPostProcess_blur';
  252. import {FxaaPostProcess} from 'babylonjs/additionalPostProcess_fxaa';
  253. import {HighlightsPostProcess} from 'babylonjs/additionalPostProcess_highlights';
  254. import {RefractionPostProcess,BlackAndWhitePostProcess,ConvolutionPostProcess,FilterPostProcess,VolumetricLightScatteringPostProcess,ColorCorrectionPostProcess,TonemappingOperator,TonemapPostProcess,DisplayPassPostProcess,ImageProcessingPostProcess} from 'babylonjs/additionalPostProcesses';
  255. import {PostProcessRenderPipelineManager,PostProcessRenderPass,PostProcessRenderEffect,PostProcessRenderPipeline} from 'babylonjs/renderingPipeline';
  256. import {SSAORenderingPipeline,SSAO2RenderingPipeline,LensRenderingPipeline,StandardRenderingPipeline} from 'babylonjs/additionalRenderingPipeline';
  257. import {DefaultRenderingPipeline} from 'babylonjs/defaultRenderingPipeline';
  258. import {Bone,BoneIKController,BoneLookController,Skeleton} from 'babylonjs/bones';
  259. import {SphericalPolynomial,SphericalHarmonics,CubeMapToSphericalPolynomialTools,CubeMapInfo,PanoramaToCubeMapTools,HDRInfo,HDRTools,HDRCubeTexture} from 'babylonjs/hdr';
  260. import {CSG} from 'babylonjs/csg';
  261. import {Polygon,PolygonMeshBuilder} from 'babylonjs/polygonMesh';
  262. import {LensFlare,LensFlareSystem} from 'babylonjs/lensFlares';
  263. 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';
  264. import {TGATools,DDSInfo,DDSTools,KhronosTextureContainer} from 'babylonjs/textureFormats';
  265. import {Debug,RayHelper,DebugLayer,BoundingBoxRenderer} from 'babylonjs/debug';
  266. import {MorphTarget,MorphTargetManager} from 'babylonjs/morphTargets';
  267. import {IOctreeContainer,Octree,OctreeBlock} from 'babylonjs/octrees';
  268. import {SIMDHelper} from 'babylonjs/simd';
  269. 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';
  270. import {JoystickAxis,VirtualJoystick,VirtualJoysticksCamera,FreeCameraVirtualJoystickInput} from 'babylonjs/virtualJoystick';
  271. 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';
  272. import {OutlineRenderer,EdgesRenderer,IHighlightLayerOptions,HighlightLayer} from 'babylonjs/highlights';
  273. import {SceneSerializer} from 'babylonjs/serialization';
  274. import {AssetTaskState,AbstractAssetTask,IAssetsProgressEvent,AssetsProgressEvent,MeshAssetTask,TextFileAssetTask,BinaryFileAssetTask,ImageAssetTask,ITextureAssetTask,TextureAssetTask,CubeTextureAssetTask,HDRCubeTextureAssetTask,AssetsManager} from 'babylonjs/assetsManager';
  275. import {ReflectionProbe} from 'babylonjs/probes';
  276. import {BackgroundMaterial} from 'babylonjs/backgroundMaterial';
  277. import {Layer} from 'babylonjs/layer';
  278. import {IEnvironmentHelperOptions,EnvironmentHelper} from 'babylonjs/environmentHelper';