babylon.glTF2FileLoader.d.ts 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165
  1. declare module BABYLON {
  2. /**
  3. * Mode that determines the coordinate system to use.
  4. */
  5. enum GLTFLoaderCoordinateSystemMode {
  6. /**
  7. * Automatically convert the glTF right-handed data to the appropriate system based on the current coordinate system mode of the scene.
  8. */
  9. AUTO = 0,
  10. /**
  11. * Sets the useRightHandedSystem flag on the scene.
  12. */
  13. FORCE_RIGHT_HANDED = 1
  14. }
  15. /**
  16. * Mode that determines what animations will start.
  17. */
  18. enum GLTFLoaderAnimationStartMode {
  19. /**
  20. * No animation will start.
  21. */
  22. NONE = 0,
  23. /**
  24. * The first animation will start.
  25. */
  26. FIRST = 1,
  27. /**
  28. * All animations will start.
  29. */
  30. ALL = 2
  31. }
  32. /**
  33. * Interface that contains the data for the glTF asset.
  34. */
  35. interface IGLTFLoaderData {
  36. /**
  37. * Object that represents the glTF JSON.
  38. */
  39. json: Object;
  40. /**
  41. * The BIN chunk of a binary glTF.
  42. */
  43. bin: Nullable<ArrayBufferView>;
  44. }
  45. /**
  46. * Interface for extending the loader.
  47. */
  48. interface IGLTFLoaderExtension {
  49. /**
  50. * The name of this extension.
  51. */
  52. readonly name: string;
  53. /**
  54. * Defines whether this extension is enabled.
  55. */
  56. enabled: boolean;
  57. }
  58. /**
  59. * Loader state.
  60. */
  61. enum GLTFLoaderState {
  62. /**
  63. * The asset is loading.
  64. */
  65. LOADING = 0,
  66. /**
  67. * The asset is ready for rendering.
  68. */
  69. READY = 1,
  70. /**
  71. * The asset is completely loaded.
  72. */
  73. COMPLETE = 2
  74. }
  75. /** @hidden */
  76. interface IGLTFLoader extends IDisposable {
  77. readonly state: Nullable<GLTFLoaderState>;
  78. importMeshAsync: (meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void, fileName?: string) => Promise<{
  79. meshes: AbstractMesh[];
  80. particleSystems: IParticleSystem[];
  81. skeletons: Skeleton[];
  82. animationGroups: AnimationGroup[];
  83. }>;
  84. loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void, fileName?: string) => Promise<void>;
  85. }
  86. /**
  87. * File loader for loading glTF files into a scene.
  88. */
  89. class GLTFFileLoader implements IDisposable, ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {
  90. /** @hidden */
  91. static _CreateGLTFLoaderV1: (parent: GLTFFileLoader) => IGLTFLoader;
  92. /** @hidden */
  93. static _CreateGLTFLoaderV2: (parent: GLTFFileLoader) => IGLTFLoader;
  94. /**
  95. * Raised when the asset has been parsed
  96. */
  97. onParsedObservable: Observable<IGLTFLoaderData>;
  98. private _onParsedObserver;
  99. /**
  100. * Raised when the asset has been parsed
  101. */
  102. onParsed: (loaderData: IGLTFLoaderData) => void;
  103. /**
  104. * Set this property to false to disable incremental loading which delays the loader from calling the success callback until after loading the meshes and shaders.
  105. * Textures always loads asynchronously. For example, the success callback can compute the bounding information of the loaded meshes when incremental loading is disabled.
  106. * Defaults to true.
  107. * @hidden
  108. */
  109. static IncrementalLoading: boolean;
  110. /**
  111. * Set this property to true in order to work with homogeneous coordinates, available with some converters and exporters.
  112. * Defaults to false. See https://en.wikipedia.org/wiki/Homogeneous_coordinates.
  113. * @hidden
  114. */
  115. static HomogeneousCoordinates: boolean;
  116. /**
  117. * The coordinate system mode. Defaults to AUTO.
  118. */
  119. coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
  120. /**
  121. * The animation start mode. Defaults to FIRST.
  122. */
  123. animationStartMode: GLTFLoaderAnimationStartMode;
  124. /**
  125. * Defines if the loader should compile materials before raising the success callback. Defaults to false.
  126. */
  127. compileMaterials: boolean;
  128. /**
  129. * Defines if the loader should also compile materials with clip planes. Defaults to false.
  130. */
  131. useClipPlane: boolean;
  132. /**
  133. * Defines if the loader should compile shadow generators before raising the success callback. Defaults to false.
  134. */
  135. compileShadowGenerators: boolean;
  136. /**
  137. * Defines if the Alpha blended materials are only applied as coverage.
  138. * If false, (default) The luminance of each pixel will reduce its opacity to simulate the behaviour of most physical materials.
  139. * If true, no extra effects are applied to transparent pixels.
  140. */
  141. transparencyAsCoverage: boolean;
  142. /**
  143. * Function called before loading a url referenced by the asset.
  144. */
  145. preprocessUrlAsync: (url: string) => Promise<string>;
  146. /**
  147. * Observable raised when the loader creates a mesh after parsing the glTF properties of the mesh.
  148. */
  149. readonly onMeshLoadedObservable: Observable<AbstractMesh>;
  150. private _onMeshLoadedObserver;
  151. /**
  152. * Callback raised when the loader creates a mesh after parsing the glTF properties of the mesh.
  153. */
  154. onMeshLoaded: (mesh: AbstractMesh) => void;
  155. /**
  156. * Observable raised when the loader creates a texture after parsing the glTF properties of the texture.
  157. */
  158. readonly onTextureLoadedObservable: Observable<BaseTexture>;
  159. private _onTextureLoadedObserver;
  160. /**
  161. * Callback raised when the loader creates a texture after parsing the glTF properties of the texture.
  162. */
  163. onTextureLoaded: (texture: BaseTexture) => void;
  164. /**
  165. * Observable raised when the loader creates a material after parsing the glTF properties of the material.
  166. */
  167. readonly onMaterialLoadedObservable: Observable<Material>;
  168. private _onMaterialLoadedObserver;
  169. /**
  170. * Callback raised when the loader creates a material after parsing the glTF properties of the material.
  171. */
  172. onMaterialLoaded: (material: Material) => void;
  173. /**
  174. * Observable raised when the loader creates a camera after parsing the glTF properties of the camera.
  175. */
  176. readonly onCameraLoadedObservable: Observable<Camera>;
  177. private _onCameraLoadedObserver;
  178. /**
  179. * Callback raised when the loader creates a camera after parsing the glTF properties of the camera.
  180. */
  181. onCameraLoaded: (camera: Camera) => void;
  182. /**
  183. * Observable raised when the asset is completely loaded, immediately before the loader is disposed.
  184. * For assets with LODs, raised when all of the LODs are complete.
  185. * For assets without LODs, raised when the model is complete, immediately after the loader resolves the returned promise.
  186. */
  187. readonly onCompleteObservable: Observable<void>;
  188. private _onCompleteObserver;
  189. /**
  190. * Callback raised when the asset is completely loaded, immediately before the loader is disposed.
  191. * For assets with LODs, raised when all of the LODs are complete.
  192. * For assets without LODs, raised when the model is complete, immediately after the loader resolves the returned promise.
  193. */
  194. onComplete: () => void;
  195. /**
  196. * Observable raised when an error occurs.
  197. */
  198. readonly onErrorObservable: Observable<any>;
  199. private _onErrorObserver;
  200. /**
  201. * Callback raised when an error occurs.
  202. */
  203. onError: (reason: any) => void;
  204. /**
  205. * Observable raised after the loader is disposed.
  206. */
  207. readonly onDisposeObservable: Observable<void>;
  208. private _onDisposeObserver;
  209. /**
  210. * Callback raised after the loader is disposed.
  211. */
  212. onDispose: () => void;
  213. /**
  214. * Observable raised after a loader extension is created.
  215. * Set additional options for a loader extension in this event.
  216. */
  217. readonly onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
  218. private _onExtensionLoadedObserver;
  219. /**
  220. * Callback raised after a loader extension is created.
  221. */
  222. onExtensionLoaded: (extension: IGLTFLoaderExtension) => void;
  223. /**
  224. * Defines if the loader logging is enabled.
  225. */
  226. loggingEnabled: boolean;
  227. /**
  228. * Defines if the loader should capture performance counters.
  229. */
  230. capturePerformanceCounters: boolean;
  231. /**
  232. * Defines if the loader should validate the asset.
  233. */
  234. validate: boolean;
  235. /**
  236. * Observable raised after validation when validate is set to true. The event data is the result of the validation.
  237. */
  238. readonly onValidatedObservable: Observable<IGLTFValidationResults>;
  239. private _onValidatedObserver;
  240. /**
  241. * Callback raised after a loader extension is created.
  242. */
  243. onValidated: (results: IGLTFValidationResults) => void;
  244. private _loader;
  245. /**
  246. * Name of the loader ("gltf")
  247. */
  248. name: string;
  249. /**
  250. * Supported file extensions of the loader (.gltf, .glb)
  251. */
  252. extensions: ISceneLoaderPluginExtensions;
  253. /**
  254. * Disposes the loader, releases resources during load, and cancels any outstanding requests.
  255. */
  256. dispose(): void;
  257. /** @hidden */
  258. _clear(): void;
  259. /**
  260. * Imports one or more meshes from the loaded glTF data and adds them to the scene
  261. * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
  262. * @param scene the scene the meshes should be added to
  263. * @param data the glTF data to load
  264. * @param rootUrl root url to load from
  265. * @param onProgress event that fires when loading progress has occured
  266. * @param fileName Defines the name of the file to load
  267. * @returns a promise containg the loaded meshes, particles, skeletons and animations
  268. */
  269. importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void, fileName?: string): Promise<{
  270. meshes: AbstractMesh[];
  271. particleSystems: IParticleSystem[];
  272. skeletons: Skeleton[];
  273. animationGroups: AnimationGroup[];
  274. }>;
  275. /**
  276. * Imports all objects from the loaded glTF data and adds them to the scene
  277. * @param scene the scene the objects should be added to
  278. * @param data the glTF data to load
  279. * @param rootUrl root url to load from
  280. * @param onProgress event that fires when loading progress has occured
  281. * @param fileName Defines the name of the file to load
  282. * @returns a promise which completes when objects have been loaded to the scene
  283. */
  284. loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void, fileName?: string): Promise<void>;
  285. /**
  286. * Load into an asset container.
  287. * @param scene The scene to load into
  288. * @param data The data to import
  289. * @param rootUrl The root url for scene and resources
  290. * @param onProgress The callback when the load progresses
  291. * @param fileName Defines the name of the file to load
  292. * @returns The loaded asset container
  293. */
  294. loadAssetContainerAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void, fileName?: string): Promise<AssetContainer>;
  295. /**
  296. * If the data string can be loaded directly.
  297. * @param data string contianing the file data
  298. * @returns if the data can be loaded directly
  299. */
  300. canDirectLoad(data: string): boolean;
  301. /**
  302. * Rewrites a url by combining a root url and response url.
  303. */
  304. rewriteRootURL: (rootUrl: string, responseURL?: string) => string;
  305. /**
  306. * Instantiates a glTF file loader plugin.
  307. * @returns the created plugin
  308. */
  309. createPlugin(): ISceneLoaderPlugin | ISceneLoaderPluginAsync;
  310. /**
  311. * The loader state or null if the loader is not active.
  312. */
  313. readonly loaderState: Nullable<GLTFLoaderState>;
  314. /**
  315. * Returns a promise that resolves when the asset is completely loaded.
  316. * @returns a promise that resolves when the asset is completely loaded.
  317. */
  318. whenCompleteAsync(): Promise<void>;
  319. private _parseAsync;
  320. private _validateAsync;
  321. private _getLoader;
  322. private _unpackBinary;
  323. private _unpackBinaryV1;
  324. private _unpackBinaryV2;
  325. private static _parseVersion;
  326. private static _compareVersion;
  327. private static _decodeBufferToText;
  328. private static readonly _logSpaces;
  329. private _logIndentLevel;
  330. private _loggingEnabled;
  331. /** @hidden */
  332. _log: (message: string) => void;
  333. /** @hidden */
  334. _logOpen(message: string): void;
  335. /** @hidden */
  336. _logClose(): void;
  337. private _logEnabled;
  338. private _logDisabled;
  339. private _capturePerformanceCounters;
  340. /** @hidden */
  341. _startPerformanceCounter: (counterName: string) => void;
  342. /** @hidden */
  343. _endPerformanceCounter: (counterName: string) => void;
  344. private _startPerformanceCounterEnabled;
  345. private _startPerformanceCounterDisabled;
  346. private _endPerformanceCounterEnabled;
  347. private _endPerformanceCounterDisabled;
  348. }
  349. }
  350. declare module BABYLON.GLTF2.Loader {
  351. /**
  352. * Loader interface with an index field.
  353. */
  354. interface IArrayItem {
  355. /**
  356. * The index of this item in the array.
  357. */
  358. index: number;
  359. }
  360. /**
  361. * Loader interface with additional members.
  362. */
  363. interface IAccessor extends GLTF2.IAccessor, IArrayItem {
  364. /** @hidden */
  365. _data?: Promise<ArrayBufferView>;
  366. /** @hidden */
  367. _babylonVertexBuffer?: Promise<VertexBuffer>;
  368. }
  369. /**
  370. * Loader interface with additional members.
  371. */
  372. interface IAnimationChannel extends GLTF2.IAnimationChannel, IArrayItem {
  373. }
  374. /** @hidden */
  375. interface _IAnimationSamplerData {
  376. input: Float32Array;
  377. interpolation: AnimationSamplerInterpolation;
  378. output: Float32Array;
  379. }
  380. /**
  381. * Loader interface with additional members.
  382. */
  383. interface IAnimationSampler extends GLTF2.IAnimationSampler, IArrayItem {
  384. /** @hidden */
  385. _data?: Promise<_IAnimationSamplerData>;
  386. }
  387. /**
  388. * Loader interface with additional members.
  389. */
  390. interface IAnimation extends GLTF2.IAnimation, IArrayItem {
  391. channels: IAnimationChannel[];
  392. samplers: IAnimationSampler[];
  393. /** @hidden */
  394. _babylonAnimationGroup?: AnimationGroup;
  395. }
  396. /**
  397. * Loader interface with additional members.
  398. */
  399. interface IBuffer extends GLTF2.IBuffer, IArrayItem {
  400. /** @hidden */
  401. _data?: Promise<ArrayBufferView>;
  402. }
  403. /**
  404. * Loader interface with additional members.
  405. */
  406. interface IBufferView extends GLTF2.IBufferView, IArrayItem {
  407. /** @hidden */
  408. _data?: Promise<ArrayBufferView>;
  409. /** @hidden */
  410. _babylonBuffer?: Promise<Buffer>;
  411. }
  412. /**
  413. * Loader interface with additional members.
  414. */
  415. interface ICamera extends GLTF2.ICamera, IArrayItem {
  416. }
  417. /**
  418. * Loader interface with additional members.
  419. */
  420. interface IImage extends GLTF2.IImage, IArrayItem {
  421. /** @hidden */
  422. _data?: Promise<ArrayBufferView>;
  423. }
  424. /**
  425. * Loader interface with additional members.
  426. */
  427. interface IMaterialNormalTextureInfo extends GLTF2.IMaterialNormalTextureInfo, ITextureInfo {
  428. }
  429. /**
  430. * Loader interface with additional members.
  431. */
  432. interface IMaterialOcclusionTextureInfo extends GLTF2.IMaterialOcclusionTextureInfo, ITextureInfo {
  433. }
  434. /**
  435. * Loader interface with additional members.
  436. */
  437. interface IMaterialPbrMetallicRoughness extends GLTF2.IMaterialPbrMetallicRoughness {
  438. baseColorTexture?: ITextureInfo;
  439. metallicRoughnessTexture?: ITextureInfo;
  440. }
  441. /**
  442. * Loader interface with additional members.
  443. */
  444. interface IMaterial extends GLTF2.IMaterial, IArrayItem {
  445. pbrMetallicRoughness?: IMaterialPbrMetallicRoughness;
  446. normalTexture?: IMaterialNormalTextureInfo;
  447. occlusionTexture?: IMaterialOcclusionTextureInfo;
  448. emissiveTexture?: ITextureInfo;
  449. /** @hidden */
  450. _data?: {
  451. [babylonDrawMode: number]: {
  452. babylonMaterial: Material;
  453. babylonMeshes: AbstractMesh[];
  454. promise: Promise<void>;
  455. };
  456. };
  457. }
  458. /**
  459. * Loader interface with additional members.
  460. */
  461. interface IMesh extends GLTF2.IMesh, IArrayItem {
  462. primitives: IMeshPrimitive[];
  463. }
  464. /**
  465. * Loader interface with additional members.
  466. */
  467. interface IMeshPrimitive extends GLTF2.IMeshPrimitive, IArrayItem {
  468. /** @hidden */
  469. _instanceData?: {
  470. babylonSourceMesh: Mesh;
  471. promise: Promise<any>;
  472. };
  473. }
  474. /**
  475. * Loader interface with additional members.
  476. */
  477. interface INode extends GLTF2.INode, IArrayItem {
  478. /**
  479. * The parent glTF node.
  480. */
  481. parent?: INode;
  482. /** @hidden */
  483. _babylonTransformNode?: TransformNode;
  484. /** @hidden */
  485. _primitiveBabylonMeshes?: AbstractMesh[];
  486. /** @hidden */
  487. _babylonBones?: Bone[];
  488. /** @hidden */
  489. _numMorphTargets?: number;
  490. }
  491. /** @hidden */
  492. interface _ISamplerData {
  493. noMipMaps: boolean;
  494. samplingMode: number;
  495. wrapU: number;
  496. wrapV: number;
  497. }
  498. /**
  499. * Loader interface with additional members.
  500. */
  501. interface ISampler extends GLTF2.ISampler, IArrayItem {
  502. /** @hidden */
  503. _data?: _ISamplerData;
  504. }
  505. /**
  506. * Loader interface with additional members.
  507. */
  508. interface IScene extends GLTF2.IScene, IArrayItem {
  509. }
  510. /**
  511. * Loader interface with additional members.
  512. */
  513. interface ISkin extends GLTF2.ISkin, IArrayItem {
  514. /** @hidden */
  515. _data?: {
  516. babylonSkeleton: Skeleton;
  517. promise: Promise<void>;
  518. };
  519. }
  520. /**
  521. * Loader interface with additional members.
  522. */
  523. interface ITexture extends GLTF2.ITexture, IArrayItem {
  524. }
  525. /**
  526. * Loader interface with additional members.
  527. */
  528. interface ITextureInfo extends GLTF2.ITextureInfo {
  529. }
  530. /**
  531. * Loader interface with additional members.
  532. */
  533. interface IGLTF extends GLTF2.IGLTF {
  534. accessors?: IAccessor[];
  535. animations?: IAnimation[];
  536. buffers?: IBuffer[];
  537. bufferViews?: IBufferView[];
  538. cameras?: ICamera[];
  539. images?: IImage[];
  540. materials?: IMaterial[];
  541. meshes?: IMesh[];
  542. nodes?: INode[];
  543. samplers?: ISampler[];
  544. scenes?: IScene[];
  545. skins?: ISkin[];
  546. textures?: ITexture[];
  547. }
  548. }
  549. /**
  550. * Defines the module for importing and exporting glTF 2.0 assets
  551. */
  552. declare module BABYLON.GLTF2 {
  553. /**
  554. * Helper class for working with arrays when loading the glTF asset
  555. */
  556. class ArrayItem {
  557. /**
  558. * Gets an item from the given array.
  559. * @param context The context when loading the asset
  560. * @param array The array to get the item from
  561. * @param index The index to the array
  562. * @returns The array item
  563. */
  564. static Get<T>(context: string, array: ArrayLike<T> | undefined, index: number | undefined): T;
  565. /**
  566. * Assign an `index` field to each item of the given array.
  567. * @param array The array of items
  568. */
  569. static Assign(array?: Loader.IArrayItem[]): void;
  570. }
  571. /**
  572. * The glTF 2.0 loader
  573. */
  574. class GLTFLoader implements IGLTFLoader {
  575. /** The glTF object parsed from the JSON. */
  576. gltf: Loader.IGLTF;
  577. /** The Babylon scene when loading the asset. */
  578. babylonScene: Scene;
  579. /** @hidden */
  580. _completePromises: Promise<any>[];
  581. private _disposed;
  582. private _parent;
  583. private _state;
  584. private _extensions;
  585. private _rootUrl;
  586. private _fileName;
  587. private _uniqueRootUrl;
  588. private _rootBabylonMesh;
  589. private _defaultBabylonMaterialData;
  590. private _progressCallback?;
  591. private _requests;
  592. private static readonly _DefaultSampler;
  593. private static _ExtensionNames;
  594. private static _ExtensionFactories;
  595. /**
  596. * Registers a loader extension.
  597. * @param name The name of the loader extension.
  598. * @param factory The factory function that creates the loader extension.
  599. */
  600. static RegisterExtension(name: string, factory: (loader: GLTFLoader) => IGLTFLoaderExtension): void;
  601. /**
  602. * Unregisters a loader extension.
  603. * @param name The name of the loader extenion.
  604. * @returns A boolean indicating whether the extension has been unregistered
  605. */
  606. static UnregisterExtension(name: string): boolean;
  607. /**
  608. * Gets the loader state.
  609. */
  610. readonly state: Nullable<GLTFLoaderState>;
  611. /** @hidden */
  612. constructor(parent: GLTFFileLoader);
  613. /** @hidden */
  614. dispose(): void;
  615. /** @hidden */
  616. importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void, fileName?: string): Promise<{
  617. meshes: AbstractMesh[];
  618. particleSystems: IParticleSystem[];
  619. skeletons: Skeleton[];
  620. animationGroups: AnimationGroup[];
  621. }>;
  622. /** @hidden */
  623. loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void, fileName?: string): Promise<void>;
  624. private _loadAsync;
  625. private _loadData;
  626. private _setupData;
  627. private _loadExtensions;
  628. private _checkExtensions;
  629. private _setState;
  630. private _createRootNode;
  631. /**
  632. * Loads a glTF scene.
  633. * @param context The context when loading the asset
  634. * @param scene The glTF scene property
  635. * @returns A promise that resolves when the load is complete
  636. */
  637. loadSceneAsync(context: string, scene: Loader.IScene): Promise<void>;
  638. private _forEachPrimitive;
  639. private _getMeshes;
  640. private _getSkeletons;
  641. private _getAnimationGroups;
  642. private _startAnimations;
  643. /**
  644. * Loads a glTF node.
  645. * @param context The context when loading the asset
  646. * @param node The glTF node property
  647. * @param assign A function called synchronously after parsing the glTF properties
  648. * @returns A promise that resolves with the loaded Babylon mesh when the load is complete
  649. */
  650. loadNodeAsync(context: string, node: Loader.INode, assign?: (babylonTransformNode: TransformNode) => void): Promise<TransformNode>;
  651. private _loadMeshAsync;
  652. private _loadMeshPrimitiveAsync;
  653. private _loadVertexDataAsync;
  654. private _createMorphTargets;
  655. private _loadMorphTargetsAsync;
  656. private _loadMorphTargetVertexDataAsync;
  657. private static _LoadTransform;
  658. private _loadSkinAsync;
  659. private _loadBones;
  660. private _loadBone;
  661. private _loadSkinInverseBindMatricesDataAsync;
  662. private _updateBoneMatrices;
  663. private _getNodeMatrix;
  664. /**
  665. * Loads a glTF camera.
  666. * @param context The context when loading the asset
  667. * @param camera The glTF camera property
  668. * @param assign A function called synchronously after parsing the glTF properties
  669. * @returns A promise that resolves with the loaded Babylon camera when the load is complete
  670. */
  671. loadCameraAsync(context: string, camera: Loader.ICamera, assign?: (babylonCamera: Camera) => void): Promise<Camera>;
  672. private _loadAnimationsAsync;
  673. /**
  674. * Loads a glTF animation.
  675. * @param context The context when loading the asset
  676. * @param animation The glTF animation property
  677. * @returns A promise that resolves with the loaded Babylon animation group when the load is complete
  678. */
  679. loadAnimationAsync(context: string, animation: Loader.IAnimation): Promise<AnimationGroup>;
  680. private _loadAnimationChannelAsync;
  681. private _loadAnimationSamplerAsync;
  682. private _loadBufferAsync;
  683. /**
  684. * Loads a glTF buffer view.
  685. * @param context The context when loading the asset
  686. * @param bufferView The glTF buffer view property
  687. * @returns A promise that resolves with the loaded data when the load is complete
  688. */
  689. loadBufferViewAsync(context: string, bufferView: Loader.IBufferView): Promise<ArrayBufferView>;
  690. private _loadIndicesAccessorAsync;
  691. private _loadFloatAccessorAsync;
  692. private _loadVertexBufferViewAsync;
  693. private _loadVertexAccessorAsync;
  694. private _loadMaterialMetallicRoughnessPropertiesAsync;
  695. /** @hidden */
  696. _loadMaterialAsync(context: string, material: Loader.IMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign?: (babylonMaterial: Material) => void): Promise<Material>;
  697. private _createDefaultMaterial;
  698. /**
  699. * Creates a Babylon material from a glTF material.
  700. * @param context The context when loading the asset
  701. * @param material The glTF material property
  702. * @param babylonDrawMode The draw mode for the Babylon material
  703. * @returns The Babylon material
  704. */
  705. createMaterial(context: string, material: Loader.IMaterial, babylonDrawMode: number): Material;
  706. /**
  707. * Loads properties from a glTF material into a Babylon material.
  708. * @param context The context when loading the asset
  709. * @param material The glTF material property
  710. * @param babylonMaterial The Babylon material
  711. * @returns A promise that resolves when the load is complete
  712. */
  713. loadMaterialPropertiesAsync(context: string, material: Loader.IMaterial, babylonMaterial: Material): Promise<void>;
  714. /**
  715. * Loads the normal, occlusion, and emissive properties from a glTF material into a Babylon material.
  716. * @param context The context when loading the asset
  717. * @param material The glTF material property
  718. * @param babylonMaterial The Babylon material
  719. * @returns A promise that resolves when the load is complete
  720. */
  721. loadMaterialBasePropertiesAsync(context: string, material: Loader.IMaterial, babylonMaterial: Material): Promise<void>;
  722. /**
  723. * Loads the alpha properties from a glTF material into a Babylon material.
  724. * Must be called after the setting the albedo texture of the Babylon material when the material has an albedo texture.
  725. * @param context The context when loading the asset
  726. * @param material The glTF material property
  727. * @param babylonMaterial The Babylon material
  728. */
  729. loadMaterialAlphaProperties(context: string, material: Loader.IMaterial, babylonMaterial: Material): void;
  730. /**
  731. * Loads a glTF texture info.
  732. * @param context The context when loading the asset
  733. * @param textureInfo The glTF texture info property
  734. * @param assign A function called synchronously after parsing the glTF properties
  735. * @returns A promise that resolves with the loaded Babylon texture when the load is complete
  736. */
  737. loadTextureInfoAsync(context: string, textureInfo: Loader.ITextureInfo, assign?: (babylonTexture: BaseTexture) => void): Promise<BaseTexture>;
  738. private _loadTextureAsync;
  739. private _loadSampler;
  740. /**
  741. * Loads a glTF image.
  742. * @param context The context when loading the asset
  743. * @param image The glTF image property
  744. * @returns A promise that resolves with the loaded data when the load is complete
  745. */
  746. loadImageAsync(context: string, image: Loader.IImage): Promise<ArrayBufferView>;
  747. /**
  748. * Loads a glTF uri.
  749. * @param context The context when loading the asset
  750. * @param uri The base64 or relative uri
  751. * @returns A promise that resolves with the loaded data when the load is complete
  752. */
  753. loadUriAsync(context: string, uri: string): Promise<ArrayBufferView>;
  754. private _onProgress;
  755. private static _GetTextureWrapMode;
  756. private static _GetTextureSamplingMode;
  757. private static _GetTypedArray;
  758. private static _GetNumComponents;
  759. private static _ValidateUri;
  760. private static _GetDrawMode;
  761. private _compileMaterialsAsync;
  762. private _compileShadowGeneratorsAsync;
  763. private _forEachExtensions;
  764. private _applyExtensions;
  765. private _extensionsOnLoading;
  766. private _extensionsOnReady;
  767. private _extensionsLoadSceneAsync;
  768. private _extensionsLoadNodeAsync;
  769. private _extensionsLoadCameraAsync;
  770. private _extensionsLoadVertexDataAsync;
  771. private _extensionsLoadMaterialAsync;
  772. private _extensionsCreateMaterial;
  773. private _extensionsLoadMaterialPropertiesAsync;
  774. private _extensionsLoadTextureInfoAsync;
  775. private _extensionsLoadAnimationAsync;
  776. private _extensionsLoadUriAsync;
  777. /**
  778. * Helper method called by a loader extension to load an glTF extension.
  779. * @param context The context when loading the asset
  780. * @param property The glTF property to load the extension from
  781. * @param extensionName The name of the extension to load
  782. * @param actionAsync The action to run
  783. * @returns The promise returned by actionAsync or null if the extension does not exist
  784. */
  785. static LoadExtensionAsync<TExtension = any, TResult = void>(context: string, property: IProperty, extensionName: string, actionAsync: (extensionContext: string, extension: TExtension) => Nullable<Promise<TResult>>): Nullable<Promise<TResult>>;
  786. /**
  787. * Helper method called by a loader extension to load a glTF extra.
  788. * @param context The context when loading the asset
  789. * @param property The glTF property to load the extra from
  790. * @param extensionName The name of the extension to load
  791. * @param actionAsync The action to run
  792. * @returns The promise returned by actionAsync or null if the extra does not exist
  793. */
  794. static LoadExtraAsync<TExtra = any, TResult = void>(context: string, property: IProperty, extensionName: string, actionAsync: (extraContext: string, extra: TExtra) => Nullable<Promise<TResult>>): Nullable<Promise<TResult>>;
  795. /**
  796. * Increments the indentation level and logs a message.
  797. * @param message The message to log
  798. */
  799. logOpen(message: string): void;
  800. /**
  801. * Decrements the indentation level.
  802. */
  803. logClose(): void;
  804. /**
  805. * Logs a message
  806. * @param message The message to log
  807. */
  808. log(message: string): void;
  809. /**
  810. * Starts a performance counter.
  811. * @param counterName The name of the performance counter
  812. */
  813. startPerformanceCounter(counterName: string): void;
  814. /**
  815. * Ends a performance counter.
  816. * @param counterName The name of the performance counter
  817. */
  818. endPerformanceCounter(counterName: string): void;
  819. }
  820. }
  821. declare module BABYLON.GLTF2 {
  822. /**
  823. * Interface for a glTF loader extension.
  824. */
  825. interface IGLTFLoaderExtension extends BABYLON.IGLTFLoaderExtension, IDisposable {
  826. /**
  827. * Called after the loader state changes to LOADING.
  828. */
  829. onLoading?(): void;
  830. /**
  831. * Called after the loader state changes to READY.
  832. */
  833. onReady?(): void;
  834. /**
  835. * Define this method to modify the default behavior when loading scenes.
  836. * @param context The context when loading the asset
  837. * @param scene The glTF scene property
  838. * @returns A promise that resolves when the load is complete or null if not handled
  839. */
  840. loadSceneAsync?(context: string, scene: Loader.IScene): Nullable<Promise<void>>;
  841. /**
  842. * Define this method to modify the default behavior when loading nodes.
  843. * @param context The context when loading the asset
  844. * @param node The glTF node property
  845. * @param assign A function called synchronously after parsing the glTF properties
  846. * @returns A promise that resolves with the loaded Babylon transform node when the load is complete or null if not handled
  847. */
  848. loadNodeAsync?(context: string, node: Loader.INode, assign: (babylonMesh: TransformNode) => void): Nullable<Promise<TransformNode>>;
  849. /**
  850. * Define this method to modify the default behavior when loading cameras.
  851. * @param context The context when loading the asset
  852. * @param camera The glTF camera property
  853. * @param assign A function called synchronously after parsing the glTF properties
  854. * @returns A promise that resolves with the loaded Babylon camera when the load is complete or null if not handled
  855. */
  856. loadCameraAsync?(context: string, camera: Loader.ICamera, assign: (babylonCamera: Camera) => void): Nullable<Promise<Camera>>;
  857. /**
  858. * @hidden Define this method to modify the default behavior when loading vertex data for mesh primitives.
  859. * @param context The context when loading the asset
  860. * @param primitive The glTF mesh primitive property
  861. * @returns A promise that resolves with the loaded geometry when the load is complete or null if not handled
  862. */
  863. _loadVertexDataAsync?(context: string, primitive: Loader.IMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;
  864. /**
  865. * @hidden Define this method to modify the default behavior when loading materials. Load material creates the material and then loads material properties.
  866. * @param context The context when loading the asset
  867. * @param material The glTF material property
  868. * @param assign A function called synchronously after parsing the glTF properties
  869. * @returns A promise that resolves with the loaded Babylon material when the load is complete or null if not handled
  870. */
  871. _loadMaterialAsync?(context: string, material: Loader.IMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
  872. /**
  873. * Define this method to modify the default behavior when creating materials.
  874. * @param context The context when loading the asset
  875. * @param material The glTF material property
  876. * @param babylonDrawMode The draw mode for the Babylon material
  877. * @returns The Babylon material or null if not handled
  878. */
  879. createMaterial?(context: string, material: Loader.IMaterial, babylonDrawMode: number): Nullable<Material>;
  880. /**
  881. * Define this method to modify the default behavior when loading material properties.
  882. * @param context The context when loading the asset
  883. * @param material The glTF material property
  884. * @param babylonMaterial The Babylon material
  885. * @returns A promise that resolves when the load is complete or null if not handled
  886. */
  887. loadMaterialPropertiesAsync?(context: string, material: Loader.IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
  888. /**
  889. * Define this method to modify the default behavior when loading texture infos.
  890. * @param context The context when loading the asset
  891. * @param textureInfo The glTF texture info property
  892. * @param assign A function called synchronously after parsing the glTF properties
  893. * @returns A promise that resolves with the loaded Babylon texture when the load is complete or null if not handled
  894. */
  895. loadTextureInfoAsync?(context: string, textureInfo: Loader.ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
  896. /**
  897. * Define this method to modify the default behavior when loading animations.
  898. * @param context The context when loading the asset
  899. * @param animation The glTF animation property
  900. * @returns A promise that resolves with the loaded Babylon animation group when the load is complete or null if not handled
  901. */
  902. loadAnimationAsync?(context: string, animation: Loader.IAnimation): Nullable<Promise<AnimationGroup>>;
  903. /**
  904. * Define this method to modify the default behavior when loading uris.
  905. * @param context The context when loading the asset
  906. * @param uri The uri to load
  907. * @returns A promise that resolves with the loaded data when the load is complete or null if not handled
  908. */
  909. _loadUriAsync?(context: string, uri: string): Nullable<Promise<ArrayBufferView>>;
  910. }
  911. }
  912. /**
  913. * Defines the module for the built-in glTF 2.0 loader extensions.
  914. */
  915. declare module BABYLON.GLTF2.Loader.Extensions {
  916. }
  917. declare module BABYLON.GLTF2.Loader.Extensions {
  918. /**
  919. * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/MSFT_lod)
  920. */
  921. class MSFT_lod implements IGLTFLoaderExtension {
  922. /** The name of this extension. */
  923. readonly name: string;
  924. /** Defines whether this extension is enabled. */
  925. enabled: boolean;
  926. /**
  927. * Maximum number of LODs to load, starting from the lowest LOD.
  928. */
  929. maxLODsToLoad: number;
  930. /**
  931. * Observable raised when all node LODs of one level are loaded.
  932. * The event data is the index of the loaded LOD starting from zero.
  933. * Dispose the loader to cancel the loading of the next level of LODs.
  934. */
  935. onNodeLODsLoadedObservable: Observable<number>;
  936. /**
  937. * Observable raised when all material LODs of one level are loaded.
  938. * The event data is the index of the loaded LOD starting from zero.
  939. * Dispose the loader to cancel the loading of the next level of LODs.
  940. */
  941. onMaterialLODsLoadedObservable: Observable<number>;
  942. private _loader;
  943. private _nodeIndexLOD;
  944. private _nodeSignalLODs;
  945. private _nodePromiseLODs;
  946. private _materialIndexLOD;
  947. private _materialSignalLODs;
  948. private _materialPromiseLODs;
  949. /** @hidden */
  950. constructor(loader: GLTFLoader);
  951. /** @hidden */
  952. dispose(): void;
  953. /** @hidden */
  954. onReady(): void;
  955. /** @hidden */
  956. loadNodeAsync(context: string, node: INode, assign: (babylonTransformNode: TransformNode) => void): Nullable<Promise<TransformNode>>;
  957. /** @hidden */
  958. _loadMaterialAsync(context: string, material: IMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<Material>>;
  959. /** @hidden */
  960. _loadUriAsync(context: string, uri: string): Nullable<Promise<ArrayBufferView>>;
  961. /**
  962. * Gets an array of LOD properties from lowest to highest.
  963. */
  964. private _getLODs;
  965. private _disposeUnusedMaterials;
  966. }
  967. }
  968. declare module BABYLON.GLTF2.Loader.Extensions {
  969. /** @hidden */
  970. class MSFT_minecraftMesh implements IGLTFLoaderExtension {
  971. readonly name: string;
  972. enabled: boolean;
  973. private _loader;
  974. constructor(loader: GLTFLoader);
  975. dispose(): void;
  976. loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
  977. }
  978. }
  979. declare module BABYLON.GLTF2.Loader.Extensions {
  980. /** @hidden */
  981. class MSFT_sRGBFactors implements IGLTFLoaderExtension {
  982. readonly name: string;
  983. enabled: boolean;
  984. private _loader;
  985. constructor(loader: GLTFLoader);
  986. dispose(): void;
  987. loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
  988. }
  989. }
  990. declare module BABYLON.GLTF2.Loader.Extensions {
  991. /**
  992. * [Specification](https://github.com/najadojo/glTF/tree/MSFT_audio_emitter/extensions/2.0/Vendor/MSFT_audio_emitter)
  993. */
  994. class MSFT_audio_emitter implements IGLTFLoaderExtension {
  995. /** The name of this extension. */
  996. readonly name: string;
  997. /** Defines whether this extension is enabled. */
  998. enabled: boolean;
  999. private _loader;
  1000. private _clips;
  1001. private _emitters;
  1002. /** @hidden */
  1003. constructor(loader: GLTFLoader);
  1004. /** @hidden */
  1005. dispose(): void;
  1006. /** @hidden */
  1007. onLoading(): void;
  1008. /** @hidden */
  1009. loadSceneAsync(context: string, scene: IScene): Nullable<Promise<void>>;
  1010. /** @hidden */
  1011. loadNodeAsync(context: string, node: INode, assign: (babylonTransformNode: TransformNode) => void): Nullable<Promise<TransformNode>>;
  1012. /** @hidden */
  1013. loadAnimationAsync(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>>;
  1014. private _loadClipAsync;
  1015. private _loadEmitterAsync;
  1016. private _getEventAction;
  1017. private _loadAnimationEventAsync;
  1018. }
  1019. }
  1020. declare module BABYLON.GLTF2.Loader.Extensions {
  1021. /**
  1022. * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression)
  1023. */
  1024. class KHR_draco_mesh_compression implements IGLTFLoaderExtension {
  1025. /** The name of this extension. */
  1026. readonly name: string;
  1027. /** Defines whether this extension is enabled. */
  1028. enabled: boolean;
  1029. private _loader;
  1030. private _dracoCompression?;
  1031. /** @hidden */
  1032. constructor(loader: GLTFLoader);
  1033. /** @hidden */
  1034. dispose(): void;
  1035. /** @hidden */
  1036. _loadVertexDataAsync(context: string, primitive: IMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;
  1037. }
  1038. }
  1039. declare module BABYLON.GLTF2.Loader.Extensions {
  1040. /**
  1041. * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness)
  1042. */
  1043. class KHR_materials_pbrSpecularGlossiness implements IGLTFLoaderExtension {
  1044. /** The name of this extension. */
  1045. readonly name: string;
  1046. /** Defines whether this extension is enabled. */
  1047. enabled: boolean;
  1048. private _loader;
  1049. /** @hidden */
  1050. constructor(loader: GLTFLoader);
  1051. /** @hidden */
  1052. dispose(): void;
  1053. /** @hidden */
  1054. loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
  1055. private _loadSpecularGlossinessPropertiesAsync;
  1056. }
  1057. }
  1058. declare module BABYLON.GLTF2.Loader.Extensions {
  1059. /**
  1060. * [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit)
  1061. */
  1062. class KHR_materials_unlit implements IGLTFLoaderExtension {
  1063. /** The name of this extension. */
  1064. readonly name: string;
  1065. /** Defines whether this extension is enabled. */
  1066. enabled: boolean;
  1067. private _loader;
  1068. /** @hidden */
  1069. constructor(loader: GLTFLoader);
  1070. /** @hidden */
  1071. dispose(): void;
  1072. /** @hidden */
  1073. loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
  1074. private _loadUnlitPropertiesAsync;
  1075. }
  1076. }
  1077. declare module BABYLON.GLTF2.Loader.Extensions {
  1078. /**
  1079. * [Specification](https://github.com/KhronosGroup/glTF/blob/1048d162a44dbcb05aefc1874bfd423cf60135a6/extensions/2.0/Khronos/KHR_lights_punctual/README.md) (Experimental)
  1080. */
  1081. class KHR_lights implements IGLTFLoaderExtension {
  1082. /** The name of this extension. */
  1083. readonly name: string;
  1084. /** Defines whether this extension is enabled. */
  1085. enabled: boolean;
  1086. private _loader;
  1087. private _lights?;
  1088. /** @hidden */
  1089. constructor(loader: GLTFLoader);
  1090. /** @hidden */
  1091. dispose(): void;
  1092. /** @hidden */
  1093. onLoading(): void;
  1094. /** @hidden */
  1095. loadNodeAsync(context: string, node: INode, assign: (babylonTransformNode: TransformNode) => void): Nullable<Promise<TransformNode>>;
  1096. }
  1097. }
  1098. declare module BABYLON.GLTF2.Loader.Extensions {
  1099. /**
  1100. * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md)
  1101. */
  1102. class KHR_texture_transform implements IGLTFLoaderExtension {
  1103. /** The name of this extension. */
  1104. readonly name: string;
  1105. /** Defines whether this extension is enabled. */
  1106. enabled: boolean;
  1107. private _loader;
  1108. /** @hidden */
  1109. constructor(loader: GLTFLoader);
  1110. /** @hidden */
  1111. dispose(): void;
  1112. /** @hidden */
  1113. loadTextureInfoAsync(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
  1114. }
  1115. }
  1116. declare module BABYLON.GLTF2.Loader.Extensions {
  1117. /**
  1118. * [Specification](https://github.com/KhronosGroup/glTF/blob/eb3e32332042e04691a5f35103f8c261e50d8f1e/extensions/2.0/Khronos/EXT_lights_image_based/README.md) (Experimental)
  1119. */
  1120. class EXT_lights_image_based implements IGLTFLoaderExtension {
  1121. /** The name of this extension. */
  1122. readonly name: string;
  1123. /** Defines whether this extension is enabled. */
  1124. enabled: boolean;
  1125. private _loader;
  1126. private _lights?;
  1127. /** @hidden */
  1128. constructor(loader: GLTFLoader);
  1129. /** @hidden */
  1130. dispose(): void;
  1131. /** @hidden */
  1132. onLoading(): void;
  1133. /** @hidden */
  1134. loadSceneAsync(context: string, scene: IScene): Nullable<Promise<void>>;
  1135. private _loadLightAsync;
  1136. }
  1137. }