babylon.glTFFileLoaderInterfaces.ts 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  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. }
  47. export interface IGLTFTechniquePassCommonProfile {
  48. lightingModel: string;
  49. texcoordBindings: Object;
  50. parameters?: Array<any>;
  51. }
  52. export interface IGLTFTechniquePassInstanceProgram {
  53. program: string;
  54. attributes?: Object;
  55. uniforms: Object;
  56. }
  57. export interface IGLTFTechniquePassStates {
  58. enable: number[];
  59. functions: Object;
  60. }
  61. export interface IGLTFTechniquePassDetails {
  62. commonProfile: IGLTFTechniquePassCommonProfile;
  63. type: string;
  64. }
  65. export interface IGLTFTechniquePass {
  66. details: IGLTFTechniquePassDetails;
  67. instanceProgram: IGLTFTechniquePassInstanceProgram;
  68. states: Object;
  69. }
  70. export interface IGLTFTechnique extends IGLTFChildRootProperty {
  71. parameters: Object;
  72. pass: string;
  73. passes: Object;
  74. }
  75. export interface IGLTFMaterialInstanceTechnique {
  76. technique: string;
  77. values?: Object;
  78. }
  79. export interface IGLTFMaterial extends IGLTFChildRootProperty {
  80. instanceTechnique: IGLTFMaterialInstanceTechnique;
  81. }
  82. export interface IGLTFMeshPrimitive {
  83. attributes: Object;
  84. indices: string;
  85. material: string;
  86. primitive?: number;
  87. }
  88. export interface IGLTFMesh extends IGLTFChildRootProperty {
  89. primitives: IGLTFMeshPrimitive[];
  90. }
  91. export interface IGLTFImage extends IGLTFChildRootProperty {
  92. uri: string;
  93. }
  94. export interface IGLTFSampler extends IGLTFChildRootProperty {
  95. magFilter?: number;
  96. minFilter?: number;
  97. wrapS?: number;
  98. wrapT?: number;
  99. }
  100. export interface IGLTFTexture extends IGLTFChildRootProperty {
  101. sampler: string;
  102. source: string;
  103. format?: number;
  104. internalFormat?: number;
  105. target?: number;
  106. type?: number;
  107. }
  108. export interface IGLTFAmbienLight {
  109. color?: number[];
  110. }
  111. export interface IGLTFDirectionalLight {
  112. color?: number[];
  113. }
  114. export interface IGLTFPointLight {
  115. color?: number[];
  116. constantAttenuation?: number;
  117. linearAttenuation?: number;
  118. quadraticAttenuation?: number;
  119. }
  120. export interface IGLTFSpotLight {
  121. color?: number[];
  122. constantAttenuation?: number;
  123. fallOfAngle?: number;
  124. fallOffExponent?: number;
  125. linearAttenuation?: number;
  126. quadraticAttenuation?: number;
  127. }
  128. export interface IGLTFLight extends IGLTFChildRootProperty {
  129. type: string;
  130. }
  131. export interface IGLTFCameraOrthographic {
  132. xmag: number;
  133. ymag: number;
  134. zfar: number;
  135. znear: number;
  136. }
  137. export interface IGLTFCameraPerspective {
  138. aspectRatio: number;
  139. yfov: number;
  140. zfar: number;
  141. znear: number;
  142. }
  143. export interface IGLTFCamera extends IGLTFChildRootProperty {
  144. type: string;
  145. }
  146. export interface IGLTFAnimationChannelTarget {
  147. id: string;
  148. path: string;
  149. }
  150. export interface IGLTFAnimationChannel {
  151. sampler: string;
  152. target: IGLTFAnimationChannelTarget;
  153. }
  154. export interface IGLTFAnimationSampler {
  155. input: string;
  156. output: string;
  157. interpolation?: string;
  158. }
  159. export interface IGLTFAnimation extends IGLTFChildRootProperty {
  160. channels?: IGLTFAnimationChannel[];
  161. parameters?: Object;
  162. samplers?: Object;
  163. }
  164. export interface IGLTFNodeInstanceSkin {
  165. skeletons: string[];
  166. skin: string;
  167. meshes: string[];
  168. }
  169. export interface IGLTFSkins extends IGLTFChildRootProperty {
  170. bindShapeMatrix: number[];
  171. inverseBindMatrices: string;
  172. jointNames: string[];
  173. }
  174. export interface IGLTFNode extends IGLTFChildRootProperty {
  175. camera?: string;
  176. children: string[];
  177. instanceSkin?: IGLTFNodeInstanceSkin;
  178. jointName?: string;
  179. light?: string;
  180. matrix: number[];
  181. meshes?: string[];
  182. rotation?: number[];
  183. scale?: number[];
  184. translation?: number[];
  185. }
  186. export interface IGLTFScene extends IGLTFChildRootProperty {
  187. nodes: string[];
  188. }
  189. /**
  190. * Runtime
  191. */
  192. export interface IGLTFRuntime {
  193. accessors: Object;
  194. buffers: Object;
  195. bufferViews: Object;
  196. meshes: Object;
  197. lights: Object;
  198. cameras: Object;
  199. nodes: Object;
  200. images: Object;
  201. textures: Object;
  202. shaders: Object;
  203. programs: Object;
  204. samplers: Object;
  205. techniques: Object;
  206. materials: Object;
  207. animations: Object;
  208. skins: Object;
  209. currentScene: Object;
  210. buffersCount: number,
  211. shaderscount: number,
  212. scene: Scene;
  213. rootUrl: string;
  214. loadedBuffers: number;
  215. loadedShaders: number;
  216. arrayBuffers: Object;
  217. }
  218. }