babylonjs.serializers.d.ts 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  1. /*BabylonJS serializers*/
  2. // Dependencies for this module:
  3. // ../../../../Tools/Gulp/babylonjs
  4. // ../../../../Tools/Gulp/babylonjs-gltf2interface
  5. declare module BABYLON {
  6. /**
  7. * Class for generating OBJ data from a Babylon scene.
  8. */
  9. export class OBJExport {
  10. /**
  11. * Exports the geometry of a BABYLON.Mesh array in .OBJ file format (text)
  12. * @param mesh defines the list of meshes to serialize
  13. * @param materials defines if materials should be exported
  14. * @param matlibname defines the name of the associated mtl file
  15. * @param globalposition defines if the exported positions are globals or local to the exported mesh
  16. * @returns the OBJ content
  17. */
  18. static OBJ(mesh: BABYLON.Mesh[], materials?: boolean, matlibname?: string, globalposition?: boolean): string;
  19. /**
  20. * Exports the material(s) of a mesh in .MTL file format (text)
  21. * @param mesh defines the mesh to extract the material from
  22. * @returns the mtl content
  23. */
  24. static MTL(mesh: BABYLON.Mesh): string;
  25. }
  26. }
  27. declare module BABYLON {
  28. /** @hidden */
  29. export var __IGLTFExporterExtension: number;
  30. /**
  31. * Interface for extending the exporter
  32. * @hidden
  33. */
  34. export interface IGLTFExporterExtension {
  35. /**
  36. * The name of this extension
  37. */
  38. readonly name: string;
  39. /**
  40. * Defines whether this extension is enabled
  41. */
  42. enabled: boolean;
  43. /**
  44. * Defines whether this extension is required
  45. */
  46. required: boolean;
  47. }
  48. }
  49. declare module BABYLON.GLTF2.Exporter {
  50. /**
  51. * @hidden
  52. * Interface to store animation data.
  53. */
  54. export interface _IAnimationData {
  55. /**
  56. * Keyframe data.
  57. */
  58. inputs: number[];
  59. /**
  60. * Value data.
  61. */
  62. outputs: number[][];
  63. /**
  64. * BABYLON.Animation interpolation data.
  65. */
  66. samplerInterpolation: BABYLON.GLTF2.AnimationSamplerInterpolation;
  67. /**
  68. * Minimum keyframe value.
  69. */
  70. inputsMin: number;
  71. /**
  72. * Maximum keyframe value.
  73. */
  74. inputsMax: number;
  75. }
  76. /**
  77. * @hidden
  78. */
  79. export interface _IAnimationInfo {
  80. /**
  81. * The target channel for the animation
  82. */
  83. animationChannelTargetPath: BABYLON.GLTF2.AnimationChannelTargetPath;
  84. /**
  85. * The glTF accessor type for the data.
  86. */
  87. dataAccessorType: BABYLON.GLTF2.AccessorType.VEC3 | BABYLON.GLTF2.AccessorType.VEC4;
  88. /**
  89. * Specifies if quaternions should be used.
  90. */
  91. useQuaternion: boolean;
  92. }
  93. /**
  94. * @hidden
  95. * Utility class for generating glTF animation data from BabylonJS.
  96. */
  97. export class _GLTFAnimation {
  98. /**
  99. * @ignore
  100. *
  101. * Creates glTF channel animation from BabylonJS animation.
  102. * @param babylonTransformNode - BabylonJS mesh.
  103. * @param animation - animation.
  104. * @param animationChannelTargetPath - The target animation channel.
  105. * @param convertToRightHandedSystem - Specifies if the values should be converted to right-handed.
  106. * @param useQuaternion - Specifies if quaternions are used.
  107. * @returns nullable IAnimationData
  108. */
  109. static _CreateNodeAnimation(babylonTransformNode: BABYLON.TransformNode, animation: BABYLON.Animation, animationChannelTargetPath: BABYLON.GLTF2.AnimationChannelTargetPath, convertToRightHandedSystem: boolean, useQuaternion: boolean, animationSampleRate: number): BABYLON.Nullable<_IAnimationData>;
  110. /**
  111. * @ignore
  112. * Create node animations from the transform node animations
  113. * @param babylonTransformNode
  114. * @param runtimeGLTFAnimation
  115. * @param idleGLTFAnimations
  116. * @param nodeMap
  117. * @param nodes
  118. * @param binaryWriter
  119. * @param bufferViews
  120. * @param accessors
  121. * @param convertToRightHandedSystem
  122. */
  123. static _CreateNodeAnimationFromTransformNodeAnimations(babylonTransformNode: BABYLON.TransformNode, runtimeGLTFAnimation: BABYLON.GLTF2.IAnimation, idleGLTFAnimations: BABYLON.GLTF2.IAnimation[], nodeMap: {
  124. [key: number]: number;
  125. }, nodes: BABYLON.GLTF2.INode[], binaryWriter: _BinaryWriter, bufferViews: BABYLON.GLTF2.IBufferView[], accessors: BABYLON.GLTF2.IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
  126. /**
  127. * @ignore
  128. * Create node animations from the animation groups
  129. * @param babylonScene
  130. * @param glTFAnimations
  131. * @param nodeMap
  132. * @param nodes
  133. * @param binaryWriter
  134. * @param bufferViews
  135. * @param accessors
  136. * @param convertToRightHandedSystem
  137. */
  138. static _CreateNodeAnimationFromAnimationGroups(babylonScene: BABYLON.Scene, glTFAnimations: BABYLON.GLTF2.IAnimation[], nodeMap: {
  139. [key: number]: number;
  140. }, nodes: BABYLON.GLTF2.INode[], binaryWriter: _BinaryWriter, bufferViews: BABYLON.GLTF2.IBufferView[], accessors: BABYLON.GLTF2.IAccessor[], convertToRightHandedSystem: boolean, animationSampleRate: number): void;
  141. }
  142. }
  143. declare module BABYLON.GLTF2.Exporter {
  144. /**
  145. * Class for holding and downloading glTF file data
  146. */
  147. export class GLTFData {
  148. /**
  149. * Object which contains the file name as the key and its data as the value
  150. */
  151. glTFFiles: {
  152. [fileName: string]: string | Blob;
  153. };
  154. /**
  155. * Initializes the glTF file object
  156. */
  157. constructor();
  158. /**
  159. * Downloads the glTF data as files based on their names and data
  160. */
  161. downloadFiles(): void;
  162. }
  163. }
  164. declare module BABYLON.GLTF2.Exporter {
  165. /**
  166. * Converts Babylon BABYLON.Scene into glTF 2.0.
  167. * @hidden
  168. */
  169. export class _Exporter {
  170. /**
  171. * Stores all generated buffer views, which represents views into the main glTF buffer data
  172. */
  173. _bufferViews: BABYLON.GLTF2.IBufferView[];
  174. /**
  175. * Stores all the generated accessors, which is used for accessing the data within the buffer views in glTF
  176. */
  177. _accessors: BABYLON.GLTF2.IAccessor[];
  178. /**
  179. * Stores all the generated material information, which represents the appearance of each primitive
  180. */
  181. _materials: BABYLON.GLTF2.IMaterial[];
  182. _materialMap: {
  183. [materialID: number]: number;
  184. };
  185. /**
  186. * Stores all the generated texture information, which is referenced by glTF materials
  187. */
  188. _textures: BABYLON.GLTF2.ITexture[];
  189. /**
  190. * Stores all the generated image information, which is referenced by glTF textures
  191. */
  192. _images: BABYLON.GLTF2.IImage[];
  193. /**
  194. * Stores all the texture samplers
  195. */
  196. _samplers: BABYLON.GLTF2.ISampler[];
  197. /**
  198. * Stores a map of the image data, where the key is the file name and the value
  199. * is the image data
  200. */
  201. _imageData: {
  202. [fileName: string]: {
  203. data: Uint8Array;
  204. mimeType: BABYLON.GLTF2.ImageMimeType;
  205. };
  206. };
  207. _glTFMaterialExporter: _GLTFMaterialExporter;
  208. _extensionsPreExportTextureAsync(context: string, babylonTexture: BABYLON.Texture, mimeType: BABYLON.GLTF2.ImageMimeType): BABYLON.Nullable<Promise<BABYLON.BaseTexture>>;
  209. _extensionsPostExportMeshPrimitiveAsync(context: string, meshPrimitive: BABYLON.GLTF2.IMeshPrimitive, babylonSubMesh: BABYLON.SubMesh, binaryWriter: _BinaryWriter): BABYLON.Nullable<Promise<BABYLON.GLTF2.IMeshPrimitive>>;
  210. /**
  211. * Creates a glTF Exporter instance, which can accept optional exporter options
  212. * @param babylonScene Babylon scene object
  213. * @param options Options to modify the behavior of the exporter
  214. */
  215. constructor(babylonScene: BABYLON.Scene, options?: IExportOptions);
  216. /**
  217. * Registers a glTF exporter extension
  218. * @param name Name of the extension to export
  219. * @param factory The factory function that creates the exporter extension
  220. */
  221. static RegisterExtension(name: string, factory: (exporter: _Exporter) => IGLTFExporterExtensionV2): void;
  222. /**
  223. * Un-registers an exporter extension
  224. * @param name The name fo the exporter extension
  225. * @returns A boolean indicating whether the extension has been un-registered
  226. */
  227. static UnregisterExtension(name: string): boolean;
  228. /**
  229. * Lazy load a local engine with premultiplied alpha set to false
  230. */
  231. _getLocalEngine(): BABYLON.Engine;
  232. /**
  233. * Writes mesh attribute data to a data buffer
  234. * Returns the bytelength of the data
  235. * @param vertexBufferKind Indicates what kind of vertex data is being passed in
  236. * @param meshAttributeArray Array containing the attribute data
  237. * @param binaryWriter The buffer to write the binary data to
  238. * @param indices Used to specify the order of the vertex data
  239. */
  240. writeAttributeData(vertexBufferKind: string, meshAttributeArray: BABYLON.FloatArray, byteStride: number, binaryWriter: _BinaryWriter): void;
  241. /**
  242. * Generates data for .gltf and .bin files based on the glTF prefix string
  243. * @param glTFPrefix Text to use when prefixing a glTF file
  244. * @returns GLTFData with glTF file data
  245. */
  246. _generateGLTFAsync(glTFPrefix: string): Promise<GLTFData>;
  247. /**
  248. * Generates a glb file from the json and binary data
  249. * Returns an object with the glb file name as the key and data as the value
  250. * @param glTFPrefix
  251. * @returns object with glb filename as key and data as value
  252. */
  253. _generateGLBAsync(glTFPrefix: string): Promise<GLTFData>;
  254. }
  255. /**
  256. * @hidden
  257. *
  258. * Stores glTF binary data. If the array buffer byte length is exceeded, it doubles in size dynamically
  259. */
  260. export class _BinaryWriter {
  261. /**
  262. * Initialize binary writer with an initial byte length
  263. * @param byteLength Initial byte length of the array buffer
  264. */
  265. constructor(byteLength: number);
  266. /**
  267. * Get an array buffer with the length of the byte offset
  268. * @returns ArrayBuffer resized to the byte offset
  269. */
  270. getArrayBuffer(): ArrayBuffer;
  271. /**
  272. * Get the byte offset of the array buffer
  273. * @returns byte offset
  274. */
  275. getByteOffset(): number;
  276. /**
  277. * Stores an UInt8 in the array buffer
  278. * @param entry
  279. * @param byteOffset If defined, specifies where to set the value as an offset.
  280. */
  281. setUInt8(entry: number, byteOffset?: number): void;
  282. /**
  283. * Gets an UInt32 in the array buffer
  284. * @param entry
  285. * @param byteOffset If defined, specifies where to set the value as an offset.
  286. */
  287. getUInt32(byteOffset: number): number;
  288. getVector3Float32FromRef(vector3: BABYLON.Vector3, byteOffset: number): void;
  289. setVector3Float32FromRef(vector3: BABYLON.Vector3, byteOffset: number): void;
  290. getVector4Float32FromRef(vector4: BABYLON.Vector4, byteOffset: number): void;
  291. setVector4Float32FromRef(vector4: BABYLON.Vector4, byteOffset: number): void;
  292. /**
  293. * Stores a Float32 in the array buffer
  294. * @param entry
  295. */
  296. setFloat32(entry: number, byteOffset?: number): void;
  297. /**
  298. * Stores an UInt32 in the array buffer
  299. * @param entry
  300. * @param byteOffset If defined, specifies where to set the value as an offset.
  301. */
  302. setUInt32(entry: number, byteOffset?: number): void;
  303. }
  304. }
  305. declare module BABYLON.GLTF2.Exporter {
  306. /** @hidden */
  307. export var __IGLTFExporterExtensionV2: number;
  308. /**
  309. * Interface for a glTF exporter extension
  310. * @hidden
  311. */
  312. export interface IGLTFExporterExtensionV2 extends IGLTFExporterExtension, BABYLON.IDisposable {
  313. /**
  314. * Define this method to modify the default behavior before exporting a texture
  315. * @param context The context when loading the asset
  316. * @param babylonTexture The glTF texture info property
  317. * @param mimeType The mime-type of the generated image
  318. * @returns A promise that resolves with the exported glTF texture info when the export is complete, or null if not handled
  319. */
  320. preExportTextureAsync?(context: string, babylonTexture: BABYLON.Texture, mimeType: BABYLON.GLTF2.ImageMimeType): BABYLON.Nullable<Promise<BABYLON.Texture>>;
  321. /**
  322. * Define this method to modify the default behavior when exporting texture info
  323. * @param context The context when loading the asset
  324. * @param meshPrimitive glTF mesh primitive
  325. * @param babylonSubMesh Babylon submesh
  326. * @param binaryWriter glTF serializer binary writer instance
  327. */
  328. postExportMeshPrimitiveAsync?(context: string, meshPrimitive: BABYLON.GLTF2.IMeshPrimitive, babylonSubMesh: BABYLON.SubMesh, binaryWriter: _BinaryWriter): BABYLON.Nullable<Promise<BABYLON.GLTF2.IMeshPrimitive>>;
  329. }
  330. }
  331. declare module BABYLON.GLTF2.Exporter {
  332. /**
  333. * Utility methods for working with glTF material conversion properties. This class should only be used internally
  334. * @hidden
  335. */
  336. export class _GLTFMaterialExporter {
  337. constructor(exporter: _Exporter);
  338. /**
  339. * Gets the materials from a Babylon scene and converts them to glTF materials
  340. * @param scene babylonjs scene
  341. * @param mimeType texture mime type
  342. * @param images array of images
  343. * @param textures array of textures
  344. * @param materials array of materials
  345. * @param imageData mapping of texture names to base64 textures
  346. * @param hasTextureCoords specifies if texture coordinates are present on the material
  347. */
  348. _convertMaterialsToGLTFAsync(babylonMaterials: BABYLON.Material[], mimeType: BABYLON.GLTF2.ImageMimeType, hasTextureCoords: boolean): Promise<void>;
  349. /**
  350. * Makes a copy of the glTF material without the texture parameters
  351. * @param originalMaterial original glTF material
  352. * @returns glTF material without texture parameters
  353. */
  354. _stripTexturesFromMaterial(originalMaterial: BABYLON.GLTF2.IMaterial): BABYLON.GLTF2.IMaterial;
  355. /**
  356. * Specifies if the material has any texture parameters present
  357. * @param material glTF BABYLON.Material
  358. * @returns boolean specifying if texture parameters are present
  359. */
  360. _hasTexturesPresent(material: BABYLON.GLTF2.IMaterial): boolean;
  361. /**
  362. * Converts a Babylon BABYLON.StandardMaterial to a glTF Metallic Roughness BABYLON.Material
  363. * @param babylonStandardMaterial
  364. * @returns glTF Metallic Roughness BABYLON.Material representation
  365. */
  366. _convertToGLTFPBRMetallicRoughness(babylonStandardMaterial: BABYLON.StandardMaterial): BABYLON.GLTF2.IMaterialPbrMetallicRoughness;
  367. /**
  368. * Computes the metallic factor
  369. * @param diffuse diffused value
  370. * @param specular specular value
  371. * @param oneMinusSpecularStrength one minus the specular strength
  372. * @returns metallic value
  373. */
  374. static _SolveMetallic(diffuse: number, specular: number, oneMinusSpecularStrength: number): number;
  375. /**
  376. * Gets the glTF alpha mode from the Babylon BABYLON.Material
  377. * @param babylonMaterial Babylon BABYLON.Material
  378. * @returns The Babylon alpha mode value
  379. */
  380. _getAlphaMode(babylonMaterial: BABYLON.Material): BABYLON.GLTF2.MaterialAlphaMode;
  381. /**
  382. * Converts a Babylon Standard BABYLON.Material to a glTF BABYLON.Material
  383. * @param babylonStandardMaterial BJS Standard BABYLON.Material
  384. * @param mimeType mime type to use for the textures
  385. * @param images array of glTF image interfaces
  386. * @param textures array of glTF texture interfaces
  387. * @param materials array of glTF material interfaces
  388. * @param imageData map of image file name to data
  389. * @param hasTextureCoords specifies if texture coordinates are present on the submesh to determine if textures should be applied
  390. */
  391. _convertStandardMaterialAsync(babylonStandardMaterial: BABYLON.StandardMaterial, mimeType: BABYLON.GLTF2.ImageMimeType, hasTextureCoords: boolean): Promise<void>;
  392. /**
  393. * Converts a Babylon PBR Metallic Roughness BABYLON.Material to a glTF BABYLON.Material
  394. * @param babylonPBRMetalRoughMaterial BJS PBR Metallic Roughness BABYLON.Material
  395. * @param mimeType mime type to use for the textures
  396. * @param images array of glTF image interfaces
  397. * @param textures array of glTF texture interfaces
  398. * @param materials array of glTF material interfaces
  399. * @param imageData map of image file name to data
  400. * @param hasTextureCoords specifies if texture coordinates are present on the submesh to determine if textures should be applied
  401. */
  402. _convertPBRMetallicRoughnessMaterialAsync(babylonPBRMetalRoughMaterial: BABYLON.PBRMetallicRoughnessMaterial, mimeType: BABYLON.GLTF2.ImageMimeType, hasTextureCoords: boolean): Promise<void>;
  403. /**
  404. * Converts a Babylon PBR Metallic Roughness BABYLON.Material to a glTF BABYLON.Material
  405. * @param babylonPBRMaterial BJS PBR Metallic Roughness BABYLON.Material
  406. * @param mimeType mime type to use for the textures
  407. * @param images array of glTF image interfaces
  408. * @param textures array of glTF texture interfaces
  409. * @param materials array of glTF material interfaces
  410. * @param imageData map of image file name to data
  411. * @param hasTextureCoords specifies if texture coordinates are present on the submesh to determine if textures should be applied
  412. */
  413. _convertPBRMaterialAsync(babylonPBRMaterial: BABYLON.PBRMaterial, mimeType: BABYLON.GLTF2.ImageMimeType, hasTextureCoords: boolean): Promise<void>;
  414. /**
  415. * Extracts a texture from a Babylon texture into file data and glTF data
  416. * @param babylonTexture Babylon texture to extract
  417. * @param mimeType Mime Type of the babylonTexture
  418. * @return glTF texture info, or null if the texture format is not supported
  419. */
  420. _exportTextureAsync(babylonTexture: BABYLON.BaseTexture, mimeType: BABYLON.GLTF2.ImageMimeType): Promise<BABYLON.Nullable<BABYLON.GLTF2.ITextureInfo>>;
  421. _exportTextureInfoAsync(babylonTexture: BABYLON.BaseTexture, mimeType: BABYLON.GLTF2.ImageMimeType): Promise<BABYLON.Nullable<BABYLON.GLTF2.ITextureInfo>>;
  422. }
  423. }
  424. declare module BABYLON.GLTF2.Exporter {
  425. /**
  426. * Holds a collection of exporter options and parameters
  427. */
  428. export interface IExportOptions {
  429. /**
  430. * Function which indicates whether a babylon mesh should be exported or not
  431. * @param transformNode source Babylon transform node. It is used to check whether it should be exported to glTF or not
  432. * @returns boolean, which indicates whether the mesh should be exported (true) or not (false)
  433. */
  434. shouldExportTransformNode?(transformNode: BABYLON.TransformNode): boolean;
  435. /**
  436. * The sample rate to bake animation curves
  437. */
  438. animationSampleRate?: number;
  439. /**
  440. * Begin serialization without waiting for the scene to be ready
  441. */
  442. exportWithoutWaitingForScene?: boolean;
  443. }
  444. /**
  445. * Class for generating glTF data from a Babylon scene.
  446. */
  447. export class GLTF2Export {
  448. /**
  449. * Exports the geometry of the scene to .gltf file format asynchronously
  450. * @param scene Babylon scene with scene hierarchy information
  451. * @param filePrefix File prefix to use when generating the glTF file
  452. * @param options Exporter options
  453. * @returns Returns an object with a .gltf file and associates texture names
  454. * as keys and their data and paths as values
  455. */
  456. static GLTFAsync(scene: BABYLON.Scene, filePrefix: string, options?: IExportOptions): Promise<GLTFData>;
  457. /**
  458. * Exports the geometry of the scene to .glb file format asychronously
  459. * @param scene Babylon scene with scene hierarchy information
  460. * @param filePrefix File prefix to use when generating glb file
  461. * @param options Exporter options
  462. * @returns Returns an object with a .glb filename as key and data as value
  463. */
  464. static GLBAsync(scene: BABYLON.Scene, filePrefix: string, options?: IExportOptions): Promise<GLTFData>;
  465. }
  466. }
  467. declare module BABYLON.GLTF2.Exporter {
  468. /**
  469. * @hidden
  470. */
  471. export class _GLTFUtilities {
  472. /**
  473. * Creates a buffer view based on the supplied arguments
  474. * @param bufferIndex index value of the specified buffer
  475. * @param byteOffset byte offset value
  476. * @param byteLength byte length of the bufferView
  477. * @param byteStride byte distance between conequential elements
  478. * @param name name of the buffer view
  479. * @returns bufferView for glTF
  480. */
  481. static _CreateBufferView(bufferIndex: number, byteOffset: number, byteLength: number, byteStride?: number, name?: string): BABYLON.GLTF2.IBufferView;
  482. /**
  483. * Creates an accessor based on the supplied arguments
  484. * @param bufferviewIndex The index of the bufferview referenced by this accessor
  485. * @param name The name of the accessor
  486. * @param type The type of the accessor
  487. * @param componentType The datatype of components in the attribute
  488. * @param count The number of attributes referenced by this accessor
  489. * @param byteOffset The offset relative to the start of the bufferView in bytes
  490. * @param min Minimum value of each component in this attribute
  491. * @param max Maximum value of each component in this attribute
  492. * @returns accessor for glTF
  493. */
  494. static _CreateAccessor(bufferviewIndex: number, name: string, type: BABYLON.GLTF2.AccessorType, componentType: BABYLON.GLTF2.AccessorComponentType, count: number, byteOffset: BABYLON.Nullable<number>, min: BABYLON.Nullable<number[]>, max: BABYLON.Nullable<number[]>): BABYLON.GLTF2.IAccessor;
  495. /**
  496. * Calculates the minimum and maximum values of an array of position floats
  497. * @param positions Positions array of a mesh
  498. * @param vertexStart Starting vertex offset to calculate min and max values
  499. * @param vertexCount Number of vertices to check for min and max values
  500. * @returns min number array and max number array
  501. */
  502. static _CalculateMinMaxPositions(positions: BABYLON.FloatArray, vertexStart: number, vertexCount: number, convertToRightHandedSystem: boolean): {
  503. min: number[];
  504. max: number[];
  505. };
  506. /**
  507. * Converts a new right-handed BABYLON.Vector3
  508. * @param vector vector3 array
  509. * @returns right-handed BABYLON.Vector3
  510. */
  511. static _GetRightHandedPositionVector3(vector: BABYLON.Vector3): BABYLON.Vector3;
  512. /**
  513. * Converts a BABYLON.Vector3 to right-handed
  514. * @param vector BABYLON.Vector3 to convert to right-handed
  515. */
  516. static _GetRightHandedPositionVector3FromRef(vector: BABYLON.Vector3): void;
  517. /**
  518. * Converts a three element number array to right-handed
  519. * @param vector number array to convert to right-handed
  520. */
  521. static _GetRightHandedPositionArray3FromRef(vector: number[]): void;
  522. /**
  523. * Converts a new right-handed BABYLON.Vector3
  524. * @param vector vector3 array
  525. * @returns right-handed BABYLON.Vector3
  526. */
  527. static _GetRightHandedNormalVector3(vector: BABYLON.Vector3): BABYLON.Vector3;
  528. /**
  529. * Converts a BABYLON.Vector3 to right-handed
  530. * @param vector BABYLON.Vector3 to convert to right-handed
  531. */
  532. static _GetRightHandedNormalVector3FromRef(vector: BABYLON.Vector3): void;
  533. /**
  534. * Converts a three element number array to right-handed
  535. * @param vector number array to convert to right-handed
  536. */
  537. static _GetRightHandedNormalArray3FromRef(vector: number[]): void;
  538. /**
  539. * Converts a BABYLON.Vector4 to right-handed
  540. * @param vector BABYLON.Vector4 to convert to right-handed
  541. */
  542. static _GetRightHandedVector4FromRef(vector: BABYLON.Vector4): void;
  543. /**
  544. * Converts a BABYLON.Vector4 to right-handed
  545. * @param vector BABYLON.Vector4 to convert to right-handed
  546. */
  547. static _GetRightHandedArray4FromRef(vector: number[]): void;
  548. /**
  549. * Converts a BABYLON.Quaternion to right-handed
  550. * @param quaternion Source quaternion to convert to right-handed
  551. */
  552. static _GetRightHandedQuaternionFromRef(quaternion: BABYLON.Quaternion): void;
  553. /**
  554. * Converts a BABYLON.Quaternion to right-handed
  555. * @param quaternion Source quaternion to convert to right-handed
  556. */
  557. static _GetRightHandedQuaternionArrayFromRef(quaternion: number[]): void;
  558. static _NormalizeTangentFromRef(tangent: BABYLON.Vector4): void;
  559. }
  560. }
  561. declare module BABYLON.GLTF2.Exporter {
  562. /**
  563. * @hidden
  564. */
  565. export class KHR_texture_transform implements IGLTFExporterExtensionV2 {
  566. /** Name of this extension */
  567. readonly name: string;
  568. /** Defines whether this extension is enabled */
  569. enabled: boolean;
  570. /** Defines whether this extension is required */
  571. required: boolean;
  572. constructor(exporter: _Exporter);
  573. dispose(): void;
  574. preExportTextureAsync(context: string, babylonTexture: BABYLON.Texture, mimeType: BABYLON.GLTF2.ImageMimeType): BABYLON.Nullable<Promise<BABYLON.Texture>>;
  575. /**
  576. * Transform the babylon texture by the offset, rotation and scale parameters using a procedural texture
  577. * @param babylonTexture
  578. * @param offset
  579. * @param rotation
  580. * @param scale
  581. * @param scene
  582. */
  583. textureTransformTextureAsync(babylonTexture: BABYLON.Texture, offset: BABYLON.Vector2, rotation: number, scale: BABYLON.Vector2, scene: BABYLON.Scene): Promise<BABYLON.BaseTexture>;
  584. }
  585. }