babylon.glTF2Interface.d.ts 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855
  1. /**
  2. * @ignoreChildren
  3. * @ignore
  4. */
  5. declare module "babylonjs-gltf2interface" {
  6. export = BABYLON.GLTF2;
  7. }
  8. /**
  9. * Moduel for glTF 2.0 Interface
  10. */
  11. declare module BABYLON.GLTF2 {
  12. /**
  13. * The datatype of the components in the attribute
  14. */
  15. const enum AccessorComponentType {
  16. /**
  17. * Byte
  18. */
  19. BYTE = 5120,
  20. /**
  21. * Unsigned Byte
  22. */
  23. UNSIGNED_BYTE = 5121,
  24. /**
  25. * Short
  26. */
  27. SHORT = 5122,
  28. /**
  29. * Unsigned Short
  30. */
  31. UNSIGNED_SHORT = 5123,
  32. /**
  33. * Unsigned Int
  34. */
  35. UNSIGNED_INT = 5125,
  36. /**
  37. * Float
  38. */
  39. FLOAT = 5126,
  40. }
  41. /**
  42. * Specifies if the attirbute is a scalar, vector, or matrix
  43. */
  44. const enum AccessorType {
  45. /**
  46. * Scalar
  47. */
  48. SCALAR = "SCALAR",
  49. /**
  50. * Vector2
  51. */
  52. VEC2 = "VEC2",
  53. /**
  54. * Vector3
  55. */
  56. VEC3 = "VEC3",
  57. /**
  58. * Vector4
  59. */
  60. VEC4 = "VEC4",
  61. /**
  62. * Matrix2x2
  63. */
  64. MAT2 = "MAT2",
  65. /**
  66. * Matrix3x3
  67. */
  68. MAT3 = "MAT3",
  69. /**
  70. * Matrix4x4
  71. */
  72. MAT4 = "MAT4",
  73. }
  74. /**
  75. * The name of the node's TRS property to modify, or the weights of the Morph Targets it instantiates
  76. */
  77. const enum AnimationChannelTargetPath {
  78. /**
  79. * Translation
  80. */
  81. TRANSLATION = "translation",
  82. /**
  83. * Rotation
  84. */
  85. ROTATION = "rotation",
  86. /**
  87. * Scale
  88. */
  89. SCALE = "scale",
  90. /**
  91. * Weights
  92. */
  93. WEIGHTS = "weights",
  94. }
  95. /**
  96. * Interpolation algorithm
  97. */
  98. const enum AnimationSamplerInterpolation {
  99. /**
  100. * The animated values are linearly interpolated between keyframes
  101. */
  102. LINEAR = "LINEAR",
  103. /**
  104. * The animated values remain constant to the output of the first keyframe, until the next keyframe
  105. */
  106. STEP = "STEP",
  107. /**
  108. * The animation's interpolation is computed using a cubic spline with specified tangents
  109. */
  110. CUBICSPLINE = "CUBICSPLINE",
  111. }
  112. /**
  113. * A camera's projection. A node can reference a camera to apply a transform to place the camera in the scene
  114. */
  115. const enum CameraType {
  116. /**
  117. * A perspective camera containing properties to create a perspective projection matrix
  118. */
  119. PERSPECTIVE = "perspective",
  120. /**
  121. * An orthographic camera containing properties to create an orthographic projection matrix
  122. */
  123. ORTHOGRAPHIC = "orthographic",
  124. }
  125. /**
  126. * The mime-type of the image
  127. */
  128. const enum ImageMimeType {
  129. /**
  130. * JPEG Mime-type
  131. */
  132. JPEG = "image/jpeg",
  133. /**
  134. * PNG Mime-type
  135. */
  136. PNG = "image/png",
  137. }
  138. /**
  139. * The alpha rendering mode of the material
  140. */
  141. const enum MaterialAlphaMode {
  142. /**
  143. * The alpha value is ignored and the rendered output is fully opaque
  144. */
  145. OPAQUE = "OPAQUE",
  146. /**
  147. * The rendered output is either fully opaque or fully transparent depending on the alpha value and the specified alpha cutoff value
  148. */
  149. MASK = "MASK",
  150. /**
  151. * The alpha value is used to composite the source and destination areas. The rendered output is combined with the background using the normal painting operation (i.e. the Porter and Duff over operator)
  152. */
  153. BLEND = "BLEND",
  154. }
  155. /**
  156. * The type of the primitives to render
  157. */
  158. const enum MeshPrimitiveMode {
  159. /**
  160. * Points
  161. */
  162. POINTS = 0,
  163. /**
  164. * Lines
  165. */
  166. LINES = 1,
  167. /**
  168. * Line Loop
  169. */
  170. LINE_LOOP = 2,
  171. /**
  172. * Line Strip
  173. */
  174. LINE_STRIP = 3,
  175. /**
  176. * Triangles
  177. */
  178. TRIANGLES = 4,
  179. /**
  180. * Triangle Strip
  181. */
  182. TRIANGLE_STRIP = 5,
  183. /**
  184. * Triangle Fan
  185. */
  186. TRIANGLE_FAN = 6,
  187. }
  188. /**
  189. * Magnification filter. Valid values correspond to WebGL enums: 9728 (NEAREST) and 9729 (LINEAR)
  190. */
  191. const enum TextureMagFilter {
  192. /**
  193. * Nearest
  194. */
  195. NEAREST = 9728,
  196. /**
  197. * Linear
  198. */
  199. LINEAR = 9729,
  200. }
  201. /**
  202. * Minification filter. All valid values correspond to WebGL enums
  203. */
  204. const enum TextureMinFilter {
  205. /**
  206. * Nearest
  207. */
  208. NEAREST = 9728,
  209. /**
  210. * Linear
  211. */
  212. LINEAR = 9729,
  213. /**
  214. * Nearest Mip-Map Nearest
  215. */
  216. NEAREST_MIPMAP_NEAREST = 9984,
  217. /**
  218. * Linear Mipmap Nearest
  219. */
  220. LINEAR_MIPMAP_NEAREST = 9985,
  221. /**
  222. * Nearest Mipmap Linear
  223. */
  224. NEAREST_MIPMAP_LINEAR = 9986,
  225. /**
  226. * Linear Mipmap Linear
  227. */
  228. LINEAR_MIPMAP_LINEAR = 9987,
  229. }
  230. /**
  231. * S (U) wrapping mode. All valid values correspond to WebGL enums
  232. */
  233. const enum TextureWrapMode {
  234. /**
  235. * Clamp to Edge
  236. */
  237. CLAMP_TO_EDGE = 33071,
  238. /**
  239. * Mirrored Repeat
  240. */
  241. MIRRORED_REPEAT = 33648,
  242. /**
  243. * Repeat
  244. */
  245. REPEAT = 10497,
  246. }
  247. /**
  248. * glTF Property
  249. */
  250. interface IProperty {
  251. /**
  252. * Dictionary object with extension-specific objects
  253. */
  254. extensions?: {
  255. [key: string]: any;
  256. };
  257. /**
  258. * Application-Specific data
  259. */
  260. extras?: any;
  261. }
  262. /**
  263. * glTF Child of Root Property
  264. */
  265. interface IChildRootProperty extends IProperty {
  266. /**
  267. * The user-defined name of this object
  268. */
  269. name?: string;
  270. }
  271. /**
  272. * Indices of those attributes that deviate from their initialization value
  273. */
  274. interface IAccessorSparseIndices extends IProperty {
  275. /**
  276. * The index of the bufferView with sparse indices. Referenced bufferView can't have ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER target
  277. */
  278. bufferView: number;
  279. /**
  280. * The offset relative to the start of the bufferView in bytes. Must be aligned
  281. */
  282. byteOffset?: number;
  283. /**
  284. * The indices data type. Valid values correspond to WebGL enums: 5121 (UNSIGNED_BYTE), 5123 (UNSIGNED_SHORT), 5125 (UNSIGNED_INT)
  285. */
  286. componentType: AccessorComponentType;
  287. }
  288. /**
  289. * Array of size accessor.sparse.count times number of components storing the displaced accessor attributes pointed by accessor.sparse.indices
  290. */
  291. interface IAccessorSparseValues extends IProperty {
  292. /**
  293. * The index of the bufferView with sparse values. Referenced bufferView can't have ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER target
  294. */
  295. bufferView: number;
  296. /**
  297. * The offset relative to the start of the bufferView in bytes. Must be aligned
  298. */
  299. byteOffset?: number;
  300. }
  301. /**
  302. * Sparse storage of attributes that deviate from their initialization value
  303. */
  304. interface IAccessorSparse extends IProperty {
  305. /**
  306. * The number of attributes encoded in this sparse accessor
  307. */
  308. count: number;
  309. /**
  310. * Index array of size count that points to those accessor attributes that deviate from their initialization value. Indices must strictly increase
  311. */
  312. indices: IAccessorSparseIndices;
  313. /**
  314. * Array of size count times number of components, storing the displaced accessor attributes pointed by indices. Substituted values must have the same componentType and number of components as the base accessor
  315. */
  316. values: IAccessorSparseValues;
  317. }
  318. /**
  319. * A typed view into a bufferView. A bufferView contains raw binary data. An accessor provides a typed view into a bufferView or a subset of a bufferView similar to how WebGL's vertexAttribPointer() defines an attribute in a buffer
  320. */
  321. interface IAccessor extends IChildRootProperty {
  322. /**
  323. * The index of the bufferview
  324. */
  325. bufferView?: number;
  326. /**
  327. * The offset relative to the start of the bufferView in bytes
  328. */
  329. byteOffset?: number;
  330. /**
  331. * The datatype of components in the attribute
  332. */
  333. componentType: AccessorComponentType;
  334. /**
  335. * Specifies whether integer data values should be normalized
  336. */
  337. normalized?: boolean;
  338. /**
  339. * The number of attributes referenced by this accessor
  340. */
  341. count: number;
  342. /**
  343. * Specifies if the attribute is a scalar, vector, or matrix
  344. */
  345. type: AccessorType;
  346. /**
  347. * Maximum value of each component in this attribute
  348. */
  349. max?: number[];
  350. /**
  351. * Minimum value of each component in this attribute
  352. */
  353. min?: number[];
  354. /**
  355. * Sparse storage of attributes that deviate from their initialization value
  356. */
  357. sparse?: IAccessorSparse;
  358. }
  359. /**
  360. * Targets an animation's sampler at a node's property
  361. */
  362. interface IAnimationChannel extends IProperty {
  363. /**
  364. * The index of a sampler in this animation used to compute the value for the target
  365. */
  366. sampler: number;
  367. /**
  368. * The index of the node and TRS property to target
  369. */
  370. target: IAnimationChannelTarget;
  371. }
  372. /**
  373. * The index of the node and TRS property that an animation channel targets
  374. */
  375. interface IAnimationChannelTarget extends IProperty {
  376. /**
  377. * The index of the node to target
  378. */
  379. node: number;
  380. /**
  381. * The name of the node's TRS property to modify, or the weights of the Morph Targets it instantiates
  382. */
  383. path: AnimationChannelTargetPath;
  384. }
  385. /**
  386. * Combines input and output accessors with an interpolation algorithm to define a keyframe graph (but not its target)
  387. */
  388. interface IAnimationSampler extends IProperty {
  389. /**
  390. * The index of an accessor containing keyframe input values, e.g., time
  391. */
  392. input: number;
  393. /**
  394. * Interpolation algorithm
  395. */
  396. interpolation?: AnimationSamplerInterpolation;
  397. /**
  398. * The index of an accessor, containing keyframe output values
  399. */
  400. output: number;
  401. }
  402. /**
  403. * A keyframe animation
  404. */
  405. interface IAnimation extends IChildRootProperty {
  406. /**
  407. * An array of channels, each of which targets an animation's sampler at a node's property
  408. */
  409. channels: IAnimationChannel[];
  410. /**
  411. * An array of samplers that combines input and output accessors with an interpolation algorithm to define a keyframe graph (but not its target)
  412. */
  413. samplers: IAnimationSampler[];
  414. }
  415. /**
  416. * Metadata about the glTF asset
  417. */
  418. interface IAsset extends IChildRootProperty {
  419. /**
  420. * A copyright message suitable for display to credit the content creator
  421. */
  422. copyright?: string;
  423. /**
  424. * Tool that generated this glTF model. Useful for debugging
  425. */
  426. generator?: string;
  427. /**
  428. * The glTF version that this asset targets
  429. */
  430. version: string;
  431. /**
  432. * The minimum glTF version that this asset targets
  433. */
  434. minVersion?: string;
  435. }
  436. /**
  437. * A buffer points to binary geometry, animation, or skins
  438. */
  439. interface IBuffer extends IChildRootProperty {
  440. /**
  441. * The uri of the buffer. Relative paths are relative to the .gltf file. Instead of referencing an external file, the uri can also be a data-uri
  442. */
  443. uri?: string;
  444. /**
  445. * The length of the buffer in bytes
  446. */
  447. byteLength: number;
  448. }
  449. /**
  450. * A view into a buffer generally representing a subset of the buffer
  451. */
  452. interface IBufferView extends IChildRootProperty {
  453. /**
  454. * The index of the buffer
  455. */
  456. buffer: number;
  457. /**
  458. * The offset into the buffer in bytes
  459. */
  460. byteOffset?: number;
  461. /**
  462. * The lenth of the bufferView in bytes
  463. */
  464. byteLength: number;
  465. /**
  466. * The stride, in bytes
  467. */
  468. byteStride?: number;
  469. }
  470. /**
  471. * An orthographic camera containing properties to create an orthographic projection matrix
  472. */
  473. interface ICameraOrthographic extends IProperty {
  474. /**
  475. * The floating-point horizontal magnification of the view. Must not be zero
  476. */
  477. xmag: number;
  478. /**
  479. * The floating-point vertical magnification of the view. Must not be zero
  480. */
  481. ymag: number;
  482. /**
  483. * The floating-point distance to the far clipping plane. zfar must be greater than znear
  484. */
  485. zfar: number;
  486. /**
  487. * The floating-point distance to the near clipping plane
  488. */
  489. znear: number;
  490. }
  491. /**
  492. * A perspective camera containing properties to create a perspective projection matrix
  493. */
  494. interface ICameraPerspective extends IProperty {
  495. /**
  496. * The floating-point aspect ratio of the field of view
  497. */
  498. aspectRatio?: number;
  499. /**
  500. * The floating-point vertical field of view in radians
  501. */
  502. yfov: number;
  503. /**
  504. * The floating-point distance to the far clipping plane
  505. */
  506. zfar?: number;
  507. /**
  508. * The floating-point distance to the near clipping plane
  509. */
  510. znear: number;
  511. }
  512. /**
  513. * A camera's projection. A node can reference a camera to apply a transform to place the camera in the scene
  514. */
  515. interface ICamera extends IChildRootProperty {
  516. /**
  517. * An orthographic camera containing properties to create an orthographic projection matrix
  518. */
  519. orthographic?: ICameraOrthographic;
  520. /**
  521. * A perspective camera containing properties to create a perspective projection matrix
  522. */
  523. perspective?: ICameraPerspective;
  524. /**
  525. * Specifies if the camera uses a perspective or orthographic projection
  526. */
  527. type: CameraType;
  528. }
  529. /**
  530. * Image data used to create a texture. Image can be referenced by URI or bufferView index. mimeType is required in the latter case
  531. */
  532. interface IImage extends IChildRootProperty {
  533. /**
  534. * The uri of the image. Relative paths are relative to the .gltf file. Instead of referencing an external file, the uri can also be a data-uri. The image format must be jpg or png
  535. */
  536. uri?: string;
  537. /**
  538. * The image's MIME type
  539. */
  540. mimeType?: ImageMimeType;
  541. /**
  542. * The index of the bufferView that contains the image. Use this instead of the image's uri property
  543. */
  544. bufferView?: number;
  545. }
  546. /**
  547. * Material Normal Texture Info
  548. */
  549. interface IMaterialNormalTextureInfo extends ITextureInfo {
  550. /**
  551. * The scalar multiplier applied to each normal vector of the normal texture
  552. */
  553. scale?: number;
  554. }
  555. /**
  556. * Material Occlusion Texture Info
  557. */
  558. interface IMaterialOcclusionTextureInfo extends ITextureInfo {
  559. /**
  560. * A scalar multiplier controlling the amount of occlusion applied
  561. */
  562. strength?: number;
  563. }
  564. /**
  565. * A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology
  566. */
  567. interface IMaterialPbrMetallicRoughness {
  568. /**
  569. * The material's base color factor
  570. */
  571. baseColorFactor?: number[];
  572. /**
  573. * The base color texture
  574. */
  575. baseColorTexture?: ITextureInfo;
  576. /**
  577. * The metalness of the material
  578. */
  579. metallicFactor?: number;
  580. /**
  581. * The roughness of the material
  582. */
  583. roughnessFactor?: number;
  584. /**
  585. * The metallic-roughness texture
  586. */
  587. metallicRoughnessTexture?: ITextureInfo;
  588. }
  589. /**
  590. * The material appearance of a primitive
  591. */
  592. interface IMaterial extends IChildRootProperty {
  593. /**
  594. * A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology. When not specified, all the default values of pbrMetallicRoughness apply
  595. */
  596. pbrMetallicRoughness?: IMaterialPbrMetallicRoughness;
  597. /**
  598. * The normal map texture
  599. */
  600. normalTexture?: IMaterialNormalTextureInfo;
  601. /**
  602. * The occlusion map texture
  603. */
  604. occlusionTexture?: IMaterialOcclusionTextureInfo;
  605. /**
  606. * The emissive map texture
  607. */
  608. emissiveTexture?: ITextureInfo;
  609. /**
  610. * The RGB components of the emissive color of the material. These values are linear. If an emissiveTexture is specified, this value is multiplied with the texel values
  611. */
  612. emissiveFactor?: number[];
  613. /**
  614. * The alpha rendering mode of the material
  615. */
  616. alphaMode?: MaterialAlphaMode;
  617. /**
  618. * The alpha cutoff value of the material
  619. */
  620. alphaCutoff?: number;
  621. /**
  622. * Specifies whether the material is double sided
  623. */
  624. doubleSided?: boolean;
  625. }
  626. /**
  627. * Geometry to be rendered with the given material
  628. */
  629. interface IMeshPrimitive extends IProperty {
  630. /**
  631. * A dictionary object, where each key corresponds to mesh attribute semantic and each value is the index of the accessor containing attribute's data
  632. */
  633. attributes: {
  634. [name: string]: number;
  635. };
  636. /**
  637. * The index of the accessor that contains the indices
  638. */
  639. indices?: number;
  640. /**
  641. * The index of the material to apply to this primitive when rendering
  642. */
  643. material?: number;
  644. /**
  645. * The type of primitives to render. All valid values correspond to WebGL enums
  646. */
  647. mode?: MeshPrimitiveMode;
  648. /**
  649. * An array of Morph Targets, each Morph Target is a dictionary mapping attributes (only POSITION, NORMAL, and TANGENT supported) to their deviations in the Morph Target
  650. */
  651. targets?: {
  652. [name: string]: number;
  653. }[];
  654. }
  655. /**
  656. * A set of primitives to be rendered. A node can contain one mesh. A node's transform places the mesh in the scene
  657. */
  658. interface IMesh extends IChildRootProperty {
  659. /**
  660. * An array of primitives, each defining geometry to be rendered with a material
  661. */
  662. primitives: IMeshPrimitive[];
  663. /**
  664. * Array of weights to be applied to the Morph Targets
  665. */
  666. weights?: number[];
  667. }
  668. /**
  669. * A node in the node hierarchy
  670. */
  671. interface INode extends IChildRootProperty {
  672. /**
  673. * The index of the camera referenced by this node
  674. */
  675. camera?: number;
  676. /**
  677. * The indices of this node's children
  678. */
  679. children?: number[];
  680. /**
  681. * The index of the skin referenced by this node
  682. */
  683. skin?: number;
  684. /**
  685. * A floating-point 4x4 transformation matrix stored in column-major order
  686. */
  687. matrix?: number[];
  688. /**
  689. * The index of the mesh in this node
  690. */
  691. mesh?: number;
  692. /**
  693. * The node's unit quaternion rotation in the order (x, y, z, w), where w is the scalar
  694. */
  695. rotation?: number[];
  696. /**
  697. * The node's non-uniform scale, given as the scaling factors along the x, y, and z axes
  698. */
  699. scale?: number[];
  700. /**
  701. * The node's translation along the x, y, and z axes
  702. */
  703. translation?: number[];
  704. /**
  705. * The weights of the instantiated Morph Target. Number of elements must match number of Morph Targets of used mesh
  706. */
  707. weights?: number[];
  708. }
  709. /**
  710. * Texture sampler properties for filtering and wrapping modes
  711. */
  712. interface ISampler extends IChildRootProperty {
  713. /**
  714. * Magnification filter. Valid values correspond to WebGL enums: 9728 (NEAREST) and 9729 (LINEAR)
  715. */
  716. magFilter?: TextureMagFilter;
  717. /**
  718. * Minification filter. All valid values correspond to WebGL enums
  719. */
  720. minFilter?: TextureMinFilter;
  721. /**
  722. * S (U) wrapping mode. All valid values correspond to WebGL enums
  723. */
  724. wrapS?: TextureWrapMode;
  725. /**
  726. * T (V) wrapping mode. All valid values correspond to WebGL enums
  727. */
  728. wrapT?: TextureWrapMode;
  729. }
  730. /**
  731. * The root nodes of a scene
  732. */
  733. interface IScene extends IChildRootProperty {
  734. /**
  735. * The indices of each root node
  736. */
  737. nodes: number[];
  738. }
  739. /**
  740. * Joints and matrices defining a skin
  741. */
  742. interface ISkin extends IChildRootProperty {
  743. /**
  744. * The index of the accessor containing the floating-point 4x4 inverse-bind matrices. The default is that each matrix is a 4x4 identity matrix, which implies that inverse-bind matrices were pre-applied
  745. */
  746. inverseBindMatrices?: number;
  747. /**
  748. * The index of the node used as a skeleton root. When undefined, joints transforms resolve to scene root
  749. */
  750. skeleton?: number;
  751. /**
  752. * Indices of skeleton nodes, used as joints in this skin. The array length must be the same as the count property of the inverseBindMatrices accessor (when defined)
  753. */
  754. joints: number[];
  755. }
  756. /**
  757. * A texture and its sampler
  758. */
  759. interface ITexture extends IChildRootProperty {
  760. /**
  761. * The index of the sampler used by this texture. When undefined, a sampler with repeat wrapping and auto filtering should be used
  762. */
  763. sampler?: number;
  764. /**
  765. * The index of the image used by this texture
  766. */
  767. source: number;
  768. }
  769. /**
  770. * Reference to a texture
  771. */
  772. interface ITextureInfo {
  773. /**
  774. * The index of the texture
  775. */
  776. index: number;
  777. /**
  778. * The set index of texture's TEXCOORD attribute used for texture coordinate mapping
  779. */
  780. texCoord?: number;
  781. }
  782. /**
  783. * The root object for a glTF asset
  784. */
  785. interface IGLTF extends IProperty {
  786. /**
  787. * An array of accessors. An accessor is a typed view into a bufferView
  788. */
  789. accessors?: IAccessor[];
  790. /**
  791. * An array of keyframe animations
  792. */
  793. animations?: IAnimation[];
  794. /**
  795. * Metadata about the glTF asset
  796. */
  797. asset: IAsset;
  798. /**
  799. * An array of buffers. A buffer points to binary geometry, animation, or skins
  800. */
  801. buffers?: IBuffer[];
  802. /**
  803. * An array of bufferViews. A bufferView is a view into a buffer generally representing a subset of the buffer
  804. */
  805. bufferViews?: IBufferView[];
  806. /**
  807. * An array of cameras
  808. */
  809. cameras?: ICamera[];
  810. /**
  811. * Names of glTF extensions used somewhere in this asset
  812. */
  813. extensionsUsed?: string[];
  814. /**
  815. * Names of glTF extensions required to properly load this asset
  816. */
  817. extensionsRequired?: string[];
  818. /**
  819. * An array of images. An image defines data used to create a texture
  820. */
  821. images?: IImage[];
  822. /**
  823. * An array of materials. A material defines the appearance of a primitive
  824. */
  825. materials?: IMaterial[];
  826. /**
  827. * An array of meshes. A mesh is a set of primitives to be rendered
  828. */
  829. meshes?: IMesh[];
  830. /**
  831. * An array of nodes
  832. */
  833. nodes?: INode[];
  834. /**
  835. * An array of samplers. A sampler contains properties for texture filtering and wrapping modes
  836. */
  837. samplers?: ISampler[];
  838. /**
  839. * The index of the default scene
  840. */
  841. scene?: number;
  842. /**
  843. * An array of scenes
  844. */
  845. scenes?: IScene[];
  846. /**
  847. * An array of skins. A skin is defined by joints and matrices
  848. */
  849. skins?: ISkin[];
  850. /**
  851. * An array of textures
  852. */
  853. textures?: ITexture[];
  854. }
  855. }