babylon.glTFFileLoaderInterfaces.ts 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. module BABYLON {
  2. /**
  3. * Interfaces
  4. */
  5. export interface IGLTFChildRootProperty {
  6. name?: string;
  7. }
  8. export interface IGLTFAccessor extends IGLTFChildRootProperty {
  9. bufferView: string;
  10. byteOffset: number;
  11. byteStride: number;
  12. count: number;
  13. type: string;
  14. componentType: EComponentType;
  15. max?: number[],
  16. min?: number[],
  17. name?: string;
  18. }
  19. export interface IGLTFBufferView extends IGLTFChildRootProperty {
  20. buffer: string;
  21. byteOffset: number;
  22. byteLength: number;
  23. target?: number;
  24. }
  25. export interface IGLTFBuffer extends IGLTFChildRootProperty {
  26. uri: string;
  27. byteLength?: number;
  28. type?: string;
  29. }
  30. export interface IGLTFShader extends IGLTFChildRootProperty {
  31. uri: string;
  32. type: EShaderType;
  33. }
  34. export interface IGLTFProgram extends IGLTFChildRootProperty {
  35. attributes: string[];
  36. fragmentShader: string;
  37. vertexShader: string;
  38. }
  39. export interface IGLTFTechniqueParameter {
  40. type: number;
  41. count?: number;
  42. semantic?: string;
  43. node?: string;
  44. value?: number|boolean|string|Array<any>;
  45. source?: string;
  46. babylonValue?: any;
  47. }
  48. export interface IGLTFTechniquePassCommonProfile {
  49. lightingModel: string;
  50. texcoordBindings: Object;
  51. parameters?: Array<any>;
  52. }
  53. export interface IGLTFTechniquePassInstanceProgram {
  54. program: string;
  55. attributes?: Object;
  56. uniforms: Object;
  57. }
  58. export interface IGLTFTechniquePassStatesFunctions {
  59. blendColor?: number[];
  60. blendEquationSeparate?: number[];
  61. blendFuncSeparate?: number[];
  62. }
  63. export interface IGLTFTechniquePassStates {
  64. enable: number[];
  65. functions: IGLTFTechniquePassStatesFunctions;
  66. }
  67. export interface IGLTFTechniquePassDetails {
  68. commonProfile: IGLTFTechniquePassCommonProfile;
  69. type: string;
  70. }
  71. export interface IGLTFTechniquePass {
  72. details: IGLTFTechniquePassDetails;
  73. instanceProgram: IGLTFTechniquePassInstanceProgram;
  74. states: IGLTFTechniquePassStates;
  75. }
  76. export interface IGLTFTechnique extends IGLTFChildRootProperty {
  77. parameters: Object;
  78. pass: string;
  79. passes: Object;
  80. }
  81. export interface IGLTFMaterialInstanceTechnique {
  82. technique: string;
  83. values?: Object;
  84. }
  85. export interface IGLTFMaterial extends IGLTFChildRootProperty {
  86. instanceTechnique: IGLTFMaterialInstanceTechnique;
  87. }
  88. export interface IGLTFMeshPrimitive {
  89. attributes: Object;
  90. indices: string;
  91. material: string;
  92. primitive?: number;
  93. }
  94. export interface IGLTFMesh extends IGLTFChildRootProperty {
  95. primitives: IGLTFMeshPrimitive[];
  96. }
  97. export interface IGLTFImage extends IGLTFChildRootProperty {
  98. uri: string;
  99. }
  100. export interface IGLTFSampler extends IGLTFChildRootProperty {
  101. magFilter?: number;
  102. minFilter?: number;
  103. wrapS?: number;
  104. wrapT?: number;
  105. }
  106. export interface IGLTFTexture extends IGLTFChildRootProperty {
  107. sampler: string;
  108. source: string;
  109. format?: ETextureFormat;
  110. internalFormat?: ETextureFormat;
  111. target?: number;
  112. type?: number;
  113. // Babylon.js values (optimize)
  114. babylonTexture?: Texture;
  115. }
  116. export interface IGLTFAmbienLight {
  117. color?: number[];
  118. }
  119. export interface IGLTFDirectionalLight {
  120. color?: number[];
  121. }
  122. export interface IGLTFPointLight {
  123. color?: number[];
  124. constantAttenuation?: number;
  125. linearAttenuation?: number;
  126. quadraticAttenuation?: number;
  127. }
  128. export interface IGLTFSpotLight {
  129. color?: number[];
  130. constantAttenuation?: number;
  131. fallOfAngle?: number;
  132. fallOffExponent?: number;
  133. linearAttenuation?: number;
  134. quadraticAttenuation?: number;
  135. }
  136. export interface IGLTFLight extends IGLTFChildRootProperty {
  137. type: string;
  138. }
  139. export interface IGLTFCameraOrthographic {
  140. xmag: number;
  141. ymag: number;
  142. zfar: number;
  143. znear: number;
  144. }
  145. export interface IGLTFCameraPerspective {
  146. aspectRatio: number;
  147. yfov: number;
  148. zfar: number;
  149. znear: number;
  150. }
  151. export interface IGLTFCamera extends IGLTFChildRootProperty {
  152. type: string;
  153. }
  154. export interface IGLTFAnimationChannelTarget {
  155. id: string;
  156. path: string;
  157. }
  158. export interface IGLTFAnimationChannel {
  159. sampler: string;
  160. target: IGLTFAnimationChannelTarget;
  161. }
  162. export interface IGLTFAnimationSampler {
  163. input: string;
  164. output: string;
  165. interpolation?: string;
  166. }
  167. export interface IGLTFAnimation extends IGLTFChildRootProperty {
  168. channels?: IGLTFAnimationChannel[];
  169. parameters?: Object;
  170. samplers?: Object;
  171. }
  172. export interface IGLTFNodeInstanceSkin {
  173. skeletons: string[];
  174. skin: string;
  175. meshes: string[];
  176. }
  177. export interface IGLTFSkins extends IGLTFChildRootProperty {
  178. bindShapeMatrix: number[];
  179. inverseBindMatrices: string;
  180. jointNames: string[];
  181. }
  182. export interface IGLTFNode extends IGLTFChildRootProperty {
  183. camera?: string;
  184. children: string[];
  185. instanceSkin?: IGLTFNodeInstanceSkin;
  186. jointName?: string;
  187. light?: string;
  188. matrix: number[];
  189. mesh?: string;
  190. meshes?: string[];
  191. rotation?: number[];
  192. scale?: number[];
  193. translation?: number[];
  194. }
  195. export interface IGLTFScene extends IGLTFChildRootProperty {
  196. nodes: string[];
  197. }
  198. /**
  199. * Runtime
  200. */
  201. export interface IGLTFRuntime {
  202. accessors: Object;
  203. buffers: Object;
  204. bufferViews: Object;
  205. meshes: Object;
  206. lights: Object;
  207. cameras: Object;
  208. nodes: Object;
  209. images: Object;
  210. textures: Object;
  211. shaders: Object;
  212. programs: Object;
  213. samplers: Object;
  214. techniques: Object;
  215. materials: Object;
  216. animations: Object;
  217. skins: Object;
  218. currentScene: Object;
  219. buffersCount: number;
  220. shaderscount: number;
  221. scene: Scene;
  222. rootUrl: string;
  223. loadedBuffers: number;
  224. loadedShaders: number;
  225. arrayBuffers: Object;
  226. dummyNodes: Node[];
  227. }
  228. }