babylon.glTF2FileLoader.d.ts 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  1. declare module BABYLON {
  2. enum GLTFLoaderCoordinateSystemMode {
  3. /**
  4. * Automatically convert the glTF right-handed data to the appropriate system based on the current coordinate system mode of the scene.
  5. */
  6. AUTO = 0,
  7. /**
  8. * Sets the useRightHandedSystem flag on the scene.
  9. */
  10. FORCE_RIGHT_HANDED = 1,
  11. }
  12. enum GLTFLoaderAnimationStartMode {
  13. /**
  14. * No animation will start.
  15. */
  16. NONE = 0,
  17. /**
  18. * The first animation will start.
  19. */
  20. FIRST = 1,
  21. /**
  22. * All animations will start.
  23. */
  24. ALL = 2,
  25. }
  26. interface IGLTFLoaderData {
  27. json: Object;
  28. bin: Nullable<ArrayBufferView>;
  29. }
  30. interface IGLTFLoader extends IDisposable {
  31. coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
  32. animationStartMode: GLTFLoaderAnimationStartMode;
  33. compileMaterials: boolean;
  34. useClipPlane: boolean;
  35. compileShadowGenerators: boolean;
  36. onDisposeObservable: Observable<IGLTFLoader>;
  37. onMeshLoadedObservable: Observable<AbstractMesh>;
  38. onTextureLoadedObservable: Observable<BaseTexture>;
  39. onMaterialLoadedObservable: Observable<Material>;
  40. onCompleteObservable: Observable<IGLTFLoader>;
  41. importMeshAsync: (meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onProgress?: (event: SceneLoaderProgressEvent) => void, onError?: (message: string, exception?: any) => void) => void;
  42. loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess?: () => void, onProgress?: (event: SceneLoaderProgressEvent) => void, onError?: (message: string, exception?: any) => void) => void;
  43. }
  44. class GLTFFileLoader implements IDisposable, ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {
  45. static CreateGLTFLoaderV1: () => IGLTFLoader;
  46. static CreateGLTFLoaderV2: () => IGLTFLoader;
  47. /**
  48. * Raised when the asset has been parsed.
  49. * The data.json property stores the glTF JSON.
  50. * The data.bin property stores the BIN chunk from a glTF binary or null if the input is not a glTF binary.
  51. */
  52. onParsedObservable: Observable<IGLTFLoaderData>;
  53. private _onParsedObserver;
  54. onParsed: (loaderData: IGLTFLoaderData) => void;
  55. static IncrementalLoading: boolean;
  56. static HomogeneousCoordinates: boolean;
  57. /**
  58. * The coordinate system mode (AUTO, FORCE_RIGHT_HANDED).
  59. */
  60. coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
  61. /**
  62. * The animation start mode (NONE, FIRST, ALL).
  63. */
  64. animationStartMode: GLTFLoaderAnimationStartMode;
  65. /**
  66. * Set to true to compile materials before raising the success callback.
  67. */
  68. compileMaterials: boolean;
  69. /**
  70. * Set to true to also compile materials with clip planes.
  71. */
  72. useClipPlane: boolean;
  73. /**
  74. * Set to true to compile shadow generators before raising the success callback.
  75. */
  76. compileShadowGenerators: boolean;
  77. /**
  78. * Raised when the loader creates a mesh after parsing the glTF properties of the mesh.
  79. */
  80. onMeshLoadedObservable: Observable<AbstractMesh>;
  81. private _onMeshLoadedObserver;
  82. onMeshLoaded: (mesh: AbstractMesh) => void;
  83. /**
  84. * Raised when the loader creates a texture after parsing the glTF properties of the texture.
  85. */
  86. onTextureLoadedObservable: Observable<BaseTexture>;
  87. private _onTextureLoadedObserver;
  88. onTextureLoaded: (Texture: BaseTexture) => void;
  89. /**
  90. * Raised when the loader creates a material after parsing the glTF properties of the material.
  91. */
  92. onMaterialLoadedObservable: Observable<Material>;
  93. private _onMaterialLoadedObserver;
  94. onMaterialLoaded: (Material: Material) => void;
  95. /**
  96. * Raised when the asset is completely loaded, immediately before the loader is disposed.
  97. * For assets with LODs, raised when all of the LODs are complete.
  98. * For assets without LODs, raised when the model is complete, immediately after onSuccess.
  99. */
  100. onCompleteObservable: Observable<GLTFFileLoader>;
  101. private _onCompleteObserver;
  102. onComplete: () => void;
  103. /**
  104. * Raised when the loader is disposed.
  105. */
  106. onDisposeObservable: Observable<GLTFFileLoader>;
  107. private _onDisposeObserver;
  108. onDispose: () => void;
  109. private _loader;
  110. name: string;
  111. extensions: ISceneLoaderPluginExtensions;
  112. /**
  113. * Disposes the loader, releases resources during load, and cancels any outstanding requests.
  114. */
  115. dispose(): void;
  116. importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onSuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onProgress?: (event: SceneLoaderProgressEvent) => void, onError?: (message: string, exception?: any) => void): void;
  117. loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess?: () => void, onProgress?: (event: SceneLoaderProgressEvent) => void, onError?: (message: string, exception?: any) => void): void;
  118. canDirectLoad(data: string): boolean;
  119. rewriteRootURL: (rootUrl: string, responseURL?: string) => string;
  120. createPlugin(): ISceneLoaderPlugin | ISceneLoaderPluginAsync;
  121. private _parse(data);
  122. private _getLoader(loaderData);
  123. private static _parseBinary(data);
  124. private static _parseV1(binaryReader);
  125. private static _parseV2(binaryReader);
  126. private static _parseVersion(version);
  127. private static _compareVersion(a, b);
  128. private static _decodeBufferToText(buffer);
  129. }
  130. }
  131. declare module BABYLON.GLTF2 {
  132. /**
  133. * Enums
  134. */
  135. enum EComponentType {
  136. BYTE = 5120,
  137. UNSIGNED_BYTE = 5121,
  138. SHORT = 5122,
  139. UNSIGNED_SHORT = 5123,
  140. UNSIGNED_INT = 5125,
  141. FLOAT = 5126,
  142. }
  143. enum EMeshPrimitiveMode {
  144. POINTS = 0,
  145. LINES = 1,
  146. LINE_LOOP = 2,
  147. LINE_STRIP = 3,
  148. TRIANGLES = 4,
  149. TRIANGLE_STRIP = 5,
  150. TRIANGLE_FAN = 6,
  151. }
  152. enum ETextureMagFilter {
  153. NEAREST = 9728,
  154. LINEAR = 9729,
  155. }
  156. enum ETextureMinFilter {
  157. NEAREST = 9728,
  158. LINEAR = 9729,
  159. NEAREST_MIPMAP_NEAREST = 9984,
  160. LINEAR_MIPMAP_NEAREST = 9985,
  161. NEAREST_MIPMAP_LINEAR = 9986,
  162. LINEAR_MIPMAP_LINEAR = 9987,
  163. }
  164. enum ETextureWrapMode {
  165. CLAMP_TO_EDGE = 33071,
  166. MIRRORED_REPEAT = 33648,
  167. REPEAT = 10497,
  168. }
  169. /**
  170. * Interfaces
  171. */
  172. interface IGLTFProperty {
  173. extensions?: {
  174. [key: string]: any;
  175. };
  176. extras?: any;
  177. }
  178. interface IGLTFChildRootProperty extends IGLTFProperty {
  179. name?: string;
  180. }
  181. interface IGLTFAccessorSparseIndices extends IGLTFProperty {
  182. bufferView: number;
  183. byteOffset?: number;
  184. componentType: EComponentType;
  185. }
  186. interface IGLTFAccessorSparseValues extends IGLTFProperty {
  187. bufferView: number;
  188. byteOffset?: number;
  189. }
  190. interface IGLTFAccessorSparse extends IGLTFProperty {
  191. count: number;
  192. indices: IGLTFAccessorSparseIndices;
  193. values: IGLTFAccessorSparseValues;
  194. }
  195. interface IGLTFAccessor extends IGLTFChildRootProperty {
  196. bufferView?: number;
  197. byteOffset?: number;
  198. componentType: EComponentType;
  199. normalized?: boolean;
  200. count: number;
  201. type: string;
  202. max: number[];
  203. min: number[];
  204. sparse?: IGLTFAccessorSparse;
  205. index: number;
  206. }
  207. interface IGLTFAnimationChannel extends IGLTFProperty {
  208. sampler: number;
  209. target: IGLTFAnimationChannelTarget;
  210. }
  211. interface IGLTFAnimationChannelTarget extends IGLTFProperty {
  212. node: number;
  213. path: string;
  214. }
  215. interface IGLTFAnimationSampler extends IGLTFProperty {
  216. input: number;
  217. interpolation?: string;
  218. output: number;
  219. }
  220. interface IGLTFAnimation extends IGLTFChildRootProperty {
  221. channels: IGLTFAnimationChannel[];
  222. samplers: IGLTFAnimationSampler[];
  223. index: number;
  224. targets: any[];
  225. }
  226. interface IGLTFAsset extends IGLTFChildRootProperty {
  227. copyright?: string;
  228. generator?: string;
  229. version: string;
  230. minVersion?: string;
  231. }
  232. interface IGLTFBuffer extends IGLTFChildRootProperty {
  233. uri?: string;
  234. byteLength: number;
  235. index: number;
  236. loadedData?: ArrayBufferView;
  237. loadedObservable?: Observable<IGLTFBuffer>;
  238. }
  239. interface IGLTFBufferView extends IGLTFChildRootProperty {
  240. buffer: number;
  241. byteOffset?: number;
  242. byteLength: number;
  243. byteStride?: number;
  244. index: number;
  245. }
  246. interface IGLTFCameraOrthographic extends IGLTFProperty {
  247. xmag: number;
  248. ymag: number;
  249. zfar: number;
  250. znear: number;
  251. }
  252. interface IGLTFCameraPerspective extends IGLTFProperty {
  253. aspectRatio: number;
  254. yfov: number;
  255. zfar: number;
  256. znear: number;
  257. }
  258. interface IGLTFCamera extends IGLTFChildRootProperty {
  259. orthographic?: IGLTFCameraOrthographic;
  260. perspective?: IGLTFCameraPerspective;
  261. type: string;
  262. }
  263. interface IGLTFImage extends IGLTFChildRootProperty {
  264. uri?: string;
  265. mimeType?: string;
  266. bufferView?: number;
  267. index: number;
  268. }
  269. interface IGLTFMaterialNormalTextureInfo extends IGLTFTextureInfo {
  270. scale: number;
  271. }
  272. interface IGLTFMaterialOcclusionTextureInfo extends IGLTFTextureInfo {
  273. strength: number;
  274. }
  275. interface IGLTFMaterialPbrMetallicRoughness {
  276. baseColorFactor: number[];
  277. baseColorTexture: IGLTFTextureInfo;
  278. metallicFactor: number;
  279. roughnessFactor: number;
  280. metallicRoughnessTexture: IGLTFTextureInfo;
  281. }
  282. interface IGLTFMaterial extends IGLTFChildRootProperty {
  283. pbrMetallicRoughness?: IGLTFMaterialPbrMetallicRoughness;
  284. normalTexture?: IGLTFMaterialNormalTextureInfo;
  285. occlusionTexture?: IGLTFMaterialOcclusionTextureInfo;
  286. emissiveTexture?: IGLTFTextureInfo;
  287. emissiveFactor?: number[];
  288. alphaMode?: string;
  289. alphaCutoff: number;
  290. doubleSided?: boolean;
  291. index: number;
  292. babylonMaterial: Material;
  293. }
  294. interface IGLTFMeshPrimitive extends IGLTFProperty {
  295. attributes: {
  296. [name: string]: number;
  297. };
  298. indices?: number;
  299. material?: number;
  300. mode?: EMeshPrimitiveMode;
  301. targets?: {
  302. [name: string]: number;
  303. }[];
  304. vertexData: VertexData;
  305. targetsVertexData: VertexData[];
  306. }
  307. interface IGLTFMesh extends IGLTFChildRootProperty {
  308. primitives: IGLTFMeshPrimitive[];
  309. weights?: number[];
  310. index: number;
  311. hasVertexAlpha: boolean;
  312. }
  313. interface IGLTFNode extends IGLTFChildRootProperty {
  314. camera?: number;
  315. children?: number[];
  316. skin?: number;
  317. matrix?: number[];
  318. mesh?: number;
  319. rotation?: number[];
  320. scale?: number[];
  321. translation?: number[];
  322. weights?: number[];
  323. index: number;
  324. parent: IGLTFNode;
  325. babylonMesh: Mesh;
  326. babylonAnimationTargets?: Node[];
  327. }
  328. interface IGLTFSampler extends IGLTFChildRootProperty {
  329. magFilter?: ETextureMagFilter;
  330. minFilter?: ETextureMinFilter;
  331. wrapS?: ETextureWrapMode;
  332. wrapT?: ETextureWrapMode;
  333. index: number;
  334. noMipMaps: boolean;
  335. samplingMode: number;
  336. wrapU: number;
  337. wrapV: number;
  338. }
  339. interface IGLTFScene extends IGLTFChildRootProperty {
  340. nodes: number[];
  341. index: number;
  342. }
  343. interface IGLTFSkin extends IGLTFChildRootProperty {
  344. inverseBindMatrices?: number;
  345. skeleton?: number;
  346. joints: number[];
  347. index: number;
  348. babylonSkeleton: Skeleton;
  349. }
  350. interface IGLTFTexture extends IGLTFChildRootProperty {
  351. sampler?: number;
  352. source: number;
  353. index: number;
  354. url?: string;
  355. dataReadyObservable?: Observable<IGLTFTexture>;
  356. }
  357. interface IGLTFTextureInfo {
  358. index: number;
  359. texCoord?: number;
  360. }
  361. interface IGLTF extends IGLTFProperty {
  362. accessors?: IGLTFAccessor[];
  363. animations?: IGLTFAnimation[];
  364. asset: IGLTFAsset;
  365. buffers?: IGLTFBuffer[];
  366. bufferViews?: IGLTFBufferView[];
  367. cameras?: IGLTFCamera[];
  368. extensionsUsed?: string[];
  369. extensionsRequired?: string[];
  370. images?: IGLTFImage[];
  371. materials?: IGLTFMaterial[];
  372. meshes?: IGLTFMesh[];
  373. nodes?: IGLTFNode[];
  374. samplers?: IGLTFSampler[];
  375. scene?: number;
  376. scenes?: IGLTFScene[];
  377. skins?: IGLTFSkin[];
  378. textures?: IGLTFTexture[];
  379. }
  380. }
  381. declare module BABYLON.GLTF2 {
  382. class GLTFLoader implements IGLTFLoader {
  383. _gltf: IGLTF;
  384. _babylonScene: Scene;
  385. private _disposed;
  386. private _rootUrl;
  387. private _defaultMaterial;
  388. private _defaultSampler;
  389. private _rootNode;
  390. private _successCallback?;
  391. private _progressCallback?;
  392. private _errorCallback?;
  393. private _renderReady;
  394. private _requests;
  395. private _renderReadyObservable;
  396. private _renderPendingCount;
  397. private _loaderPendingCount;
  398. private _loaderTrackers;
  399. static Extensions: {
  400. [name: string]: GLTFLoaderExtension;
  401. };
  402. static RegisterExtension(extension: GLTFLoaderExtension): void;
  403. coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
  404. animationStartMode: GLTFLoaderAnimationStartMode;
  405. compileMaterials: boolean;
  406. useClipPlane: boolean;
  407. compileShadowGenerators: boolean;
  408. onDisposeObservable: Observable<IGLTFLoader>;
  409. onMeshLoadedObservable: Observable<AbstractMesh>;
  410. onTextureLoadedObservable: Observable<BaseTexture>;
  411. onMaterialLoadedObservable: Observable<Material>;
  412. onCompleteObservable: Observable<IGLTFLoader>;
  413. dispose(): void;
  414. importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onProgress?: (event: SceneLoaderProgressEvent) => void, onError?: (message: string, exception?: any) => void): void;
  415. loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess?: () => void, onProgress?: (event: SceneLoaderProgressEvent) => void, onError?: (message: string, exception?: any) => void): void;
  416. private _loadAsync(nodeNames, scene, data, rootUrl, onSuccess?, onProgress?, onError?);
  417. private _onProgress();
  418. _executeWhenRenderReady(func: () => void): void;
  419. private _onRenderReady();
  420. private _onComplete();
  421. private _loadData(data);
  422. private _getMeshes();
  423. private _getSkeletons();
  424. private _startAnimations();
  425. private _loadDefaultScene(nodeNames);
  426. private _loadScene(context, scene, nodeNames);
  427. _loadNode(context: string, node: IGLTFNode): void;
  428. private _loadMesh(context, node, mesh);
  429. private _loadAllVertexDataAsync(context, mesh, onSuccess);
  430. /**
  431. * Converts a data bufferview into a Float4 Texture Coordinate Array, based on the accessor component type
  432. * @param {ArrayBufferView} data
  433. * @param {IGLTFAccessor} accessor
  434. */
  435. private _convertToFloat4TextureCoordArray(context, data, accessor);
  436. /**
  437. * Converts a data bufferview into a Float4 Color Array, based on the accessor component type
  438. * @param {ArrayBufferView} data
  439. * @param {IGLTFAccessor} accessor
  440. */
  441. private _convertToFloat4ColorArray(context, data, accessor);
  442. private _loadVertexDataAsync(context, mesh, primitive, onSuccess);
  443. private _createMorphTargets(context, node, mesh);
  444. private _loadMorphTargets(context, node, mesh);
  445. private _loadAllMorphTargetVertexDataAsync(context, node, mesh, onSuccess);
  446. private _loadMorphTargetVertexDataAsync(context, vertexData, attributes, onSuccess);
  447. private _loadTransform(node);
  448. private _loadSkinAsync(context, skin, onSuccess);
  449. private _createBone(node, skin, parent, localMatrix, baseMatrix, index);
  450. private _loadBones(context, skin, inverseBindMatrixData);
  451. private _loadBone(node, skin, inverseBindMatrixData, babylonBones);
  452. private _getNodeMatrix(node);
  453. private _traverseNodes(context, indices, action, parentNode);
  454. _traverseNode(context: string, node: IGLTFNode, action: (node: IGLTFNode, parentNode: IGLTFNode) => boolean, parentNode: IGLTFNode): void;
  455. private _loadAnimations();
  456. private _loadAnimation(context, animation);
  457. private _loadAnimationChannel(animation, channelContext, channel, samplerContext, sampler);
  458. private _loadBufferAsync(context, buffer, onSuccess);
  459. private _loadBufferViewAsync(context, bufferView, onSuccess);
  460. private _loadAccessorAsync(context, accessor, onSuccess);
  461. private _buildArrayBuffer<T>(typedArray, data, byteOffset, count, numComponents, byteStride?);
  462. _addPendingData(data: any): void;
  463. _removePendingData(data: any): void;
  464. _addLoaderPendingData(data: any): void;
  465. _removeLoaderPendingData(data: any): void;
  466. _whenAction(action: () => void, onComplete: () => void): void;
  467. private _getDefaultMaterial();
  468. private _loadMaterialMetallicRoughnessProperties(context, material);
  469. _loadMaterial(context: string, material: IGLTFMaterial, assign: (babylonMaterial: Material, isNew: boolean) => void): void;
  470. _createPbrMaterial(material: IGLTFMaterial): void;
  471. _loadMaterialBaseProperties(context: string, material: IGLTFMaterial): void;
  472. _loadMaterialAlphaProperties(context: string, material: IGLTFMaterial, colorFactor: number[]): void;
  473. _loadTexture(context: string, texture: IGLTFTexture, coordinatesIndex?: number): Texture;
  474. private _loadSampler(context, sampler);
  475. private _loadImageAsync(context, image, onSuccess);
  476. _loadUriAsync(context: string, uri: string, onSuccess: (data: ArrayBufferView) => void): void;
  477. _tryCatchOnError(handler: () => void): void;
  478. private static _AssignIndices(array?);
  479. static _GetProperty<T extends IGLTFProperty>(array?: ArrayLike<T>, index?: number): Nullable<T>;
  480. private static _GetTextureWrapMode(context, mode?);
  481. private static _GetTextureSamplingMode(context, magFilter?, minFilter?);
  482. private static _GetNumComponents(context, type);
  483. private _compileMaterialAsync(babylonMaterial, babylonMesh, onSuccess);
  484. private _compileMaterialsAsync(onSuccess);
  485. private _compileShadowGeneratorsAsync(onSuccess);
  486. private _abortRequests();
  487. private _releaseResources();
  488. }
  489. }
  490. declare module BABYLON.GLTF2 {
  491. /**
  492. * Utils functions for GLTF
  493. */
  494. class GLTFUtils {
  495. /**
  496. * If the uri is a base64 string
  497. * @param uri: the uri to test
  498. */
  499. static IsBase64(uri: string): boolean;
  500. /**
  501. * Decode the base64 uri
  502. * @param uri: the uri to decode
  503. */
  504. static DecodeBase64(uri: string): ArrayBuffer;
  505. static ValidateUri(uri: string): boolean;
  506. }
  507. }
  508. declare module BABYLON.GLTF2 {
  509. abstract class GLTFLoaderExtension {
  510. enabled: boolean;
  511. readonly abstract name: string;
  512. protected _traverseNode(loader: GLTFLoader, context: string, node: IGLTFNode, action: (node: IGLTFNode, parentNode: IGLTFNode) => boolean, parentNode: IGLTFNode): boolean;
  513. protected _loadNode(loader: GLTFLoader, context: string, node: IGLTFNode): boolean;
  514. protected _loadMaterial(loader: GLTFLoader, context: string, material: IGLTFMaterial, assign: (babylonMaterial: Material, isNew: boolean) => void): boolean;
  515. protected _loadExtension<T>(context: string, property: IGLTFProperty, action: (context: string, extension: T, onComplete: () => void) => void): boolean;
  516. static _Extensions: GLTFLoaderExtension[];
  517. static TraverseNode(loader: GLTFLoader, context: string, node: IGLTFNode, action: (node: IGLTFNode, parentNode: IGLTFNode) => boolean, parentNode: IGLTFNode): boolean;
  518. static LoadNode(loader: GLTFLoader, context: string, node: IGLTFNode): boolean;
  519. static LoadMaterial(loader: GLTFLoader, context: string, material: IGLTFMaterial, assign: (babylonMaterial: Material, isNew: boolean) => void): boolean;
  520. private static _ApplyExtensions(action);
  521. }
  522. }
  523. declare module BABYLON.GLTF2.Extensions {
  524. class MSFTLOD extends GLTFLoaderExtension {
  525. /**
  526. * Specify the minimal delay between LODs in ms (default = 250)
  527. */
  528. Delay: number;
  529. readonly name: string;
  530. protected _traverseNode(loader: GLTFLoader, context: string, node: IGLTFNode, action: (node: IGLTFNode, parentNode: IGLTFNode) => boolean, parentNode: IGLTFNode): boolean;
  531. protected _loadNode(loader: GLTFLoader, context: string, node: IGLTFNode): boolean;
  532. private _loadNodeLOD(loader, context, nodes, index, onComplete);
  533. protected _loadMaterial(loader: GLTFLoader, context: string, material: IGLTFMaterial, assign: (babylonMaterial: Material, isNew: boolean) => void): boolean;
  534. private _loadMaterialLOD(loader, context, materials, index, assign, onComplete);
  535. }
  536. }
  537. declare module BABYLON.GLTF2.Extensions {
  538. class KHRMaterialsPbrSpecularGlossiness extends GLTFLoaderExtension {
  539. readonly name: string;
  540. protected _loadMaterial(loader: GLTFLoader, context: string, material: IGLTFMaterial, assign: (babylonMaterial: Material, isNew: boolean) => void): boolean;
  541. private _loadSpecularGlossinessProperties(loader, context, material, properties);
  542. }
  543. }