@babylonjs/loaders 5.0.0-rc.3 → 5.0.0-rc.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. package/OBJ/index.js.map +1 -1
  2. package/OBJ/mtlFileLoader.d.ts +7 -6
  3. package/OBJ/mtlFileLoader.js +15 -14
  4. package/OBJ/mtlFileLoader.js.map +1 -1
  5. package/OBJ/objFileLoader.d.ts +11 -18
  6. package/OBJ/objFileLoader.js +19 -23
  7. package/OBJ/objFileLoader.js.map +1 -1
  8. package/OBJ/objLoadingOptions.d.ts +1 -1
  9. package/OBJ/objLoadingOptions.js.map +1 -1
  10. package/OBJ/solidParser.d.ts +6 -5
  11. package/OBJ/solidParser.js +15 -21
  12. package/OBJ/solidParser.js.map +1 -1
  13. package/STL/index.js.map +1 -1
  14. package/STL/stlFileLoader.d.ts +7 -14
  15. package/STL/stlFileLoader.js +15 -21
  16. package/STL/stlFileLoader.js.map +1 -1
  17. package/glTF/1.0/glTFBinaryExtension.d.ts +4 -4
  18. package/glTF/1.0/glTFBinaryExtension.js +4 -5
  19. package/glTF/1.0/glTFBinaryExtension.js.map +1 -1
  20. package/glTF/1.0/glTFLoader.d.ts +80 -50
  21. package/glTF/1.0/glTFLoader.js +265 -146
  22. package/glTF/1.0/glTFLoader.js.map +1 -1
  23. package/glTF/1.0/glTFLoaderInterfaces.d.ts +10 -10
  24. package/glTF/1.0/glTFLoaderInterfaces.js +3 -3
  25. package/glTF/1.0/glTFLoaderInterfaces.js.map +1 -1
  26. package/glTF/1.0/glTFLoaderUtils.d.ts +25 -25
  27. package/glTF/1.0/glTFLoaderUtils.js +70 -52
  28. package/glTF/1.0/glTFLoaderUtils.js.map +1 -1
  29. package/glTF/1.0/glTFMaterialsCommonExtension.d.ts +2 -2
  30. package/glTF/1.0/glTFMaterialsCommonExtension.js +13 -11
  31. package/glTF/1.0/glTFMaterialsCommonExtension.js.map +1 -1
  32. package/glTF/1.0/index.js.map +1 -1
  33. package/glTF/2.0/Extensions/EXT_lights_image_based.d.ts +11 -4
  34. package/glTF/2.0/Extensions/EXT_lights_image_based.js +9 -2
  35. package/glTF/2.0/Extensions/EXT_lights_image_based.js.map +1 -1
  36. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.d.ts +13 -5
  37. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js +12 -4
  38. package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js.map +1 -1
  39. package/glTF/2.0/Extensions/EXT_meshopt_compression.d.ts +10 -3
  40. package/glTF/2.0/Extensions/EXT_meshopt_compression.js +10 -3
  41. package/glTF/2.0/Extensions/EXT_meshopt_compression.js.map +1 -1
  42. package/glTF/2.0/Extensions/EXT_texture_webp.d.ts +12 -4
  43. package/glTF/2.0/Extensions/EXT_texture_webp.js +11 -3
  44. package/glTF/2.0/Extensions/EXT_texture_webp.js.map +1 -1
  45. package/glTF/2.0/Extensions/ExtrasAsMetadata.d.ts +26 -8
  46. package/glTF/2.0/Extensions/ExtrasAsMetadata.js +22 -4
  47. package/glTF/2.0/Extensions/ExtrasAsMetadata.js.map +1 -1
  48. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.d.ts +14 -6
  49. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js +17 -6
  50. package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js.map +1 -1
  51. package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +12 -4
  52. package/glTF/2.0/Extensions/KHR_lights_punctual.js +11 -3
  53. package/glTF/2.0/Extensions/KHR_lights_punctual.js.map +1 -1
  54. package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +12 -4
  55. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +10 -2
  56. package/glTF/2.0/Extensions/KHR_materials_clearcoat.js.map +1 -1
  57. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +12 -4
  58. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +10 -2
  59. package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js.map +1 -1
  60. package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +12 -4
  61. package/glTF/2.0/Extensions/KHR_materials_ior.js +10 -2
  62. package/glTF/2.0/Extensions/KHR_materials_ior.js.map +1 -1
  63. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.d.ts +12 -4
  64. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js +10 -2
  65. package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js.map +1 -1
  66. package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +12 -4
  67. package/glTF/2.0/Extensions/KHR_materials_sheen.js +11 -3
  68. package/glTF/2.0/Extensions/KHR_materials_sheen.js.map +1 -1
  69. package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +12 -4
  70. package/glTF/2.0/Extensions/KHR_materials_specular.js +11 -3
  71. package/glTF/2.0/Extensions/KHR_materials_specular.js.map +1 -1
  72. package/glTF/2.0/Extensions/KHR_materials_translucency.d.ts +12 -4
  73. package/glTF/2.0/Extensions/KHR_materials_translucency.js +11 -4
  74. package/glTF/2.0/Extensions/KHR_materials_translucency.js.map +1 -1
  75. package/glTF/2.0/Extensions/KHR_materials_transmission.d.ts +12 -4
  76. package/glTF/2.0/Extensions/KHR_materials_transmission.js +24 -13
  77. package/glTF/2.0/Extensions/KHR_materials_transmission.js.map +1 -1
  78. package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +12 -4
  79. package/glTF/2.0/Extensions/KHR_materials_unlit.js +10 -2
  80. package/glTF/2.0/Extensions/KHR_materials_unlit.js.map +1 -1
  81. package/glTF/2.0/Extensions/KHR_materials_variants.d.ts +17 -6
  82. package/glTF/2.0/Extensions/KHR_materials_variants.js +19 -8
  83. package/glTF/2.0/Extensions/KHR_materials_variants.js.map +1 -1
  84. package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +12 -4
  85. package/glTF/2.0/Extensions/KHR_materials_volume.js +12 -5
  86. package/glTF/2.0/Extensions/KHR_materials_volume.js.map +1 -1
  87. package/glTF/2.0/Extensions/KHR_mesh_quantization.d.ts +4 -1
  88. package/glTF/2.0/Extensions/KHR_mesh_quantization.js +5 -3
  89. package/glTF/2.0/Extensions/KHR_mesh_quantization.js.map +1 -1
  90. package/glTF/2.0/Extensions/KHR_texture_basisu.d.ts +12 -4
  91. package/glTF/2.0/Extensions/KHR_texture_basisu.js +11 -3
  92. package/glTF/2.0/Extensions/KHR_texture_basisu.js.map +1 -1
  93. package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +12 -4
  94. package/glTF/2.0/Extensions/KHR_texture_transform.js +10 -2
  95. package/glTF/2.0/Extensions/KHR_texture_transform.js.map +1 -1
  96. package/glTF/2.0/Extensions/KHR_xmp_json_ld.d.ts +4 -1
  97. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js +4 -1
  98. package/glTF/2.0/Extensions/KHR_xmp_json_ld.js.map +1 -1
  99. package/glTF/2.0/Extensions/MSFT_audio_emitter.d.ts +23 -7
  100. package/glTF/2.0/Extensions/MSFT_audio_emitter.js +38 -14
  101. package/glTF/2.0/Extensions/MSFT_audio_emitter.js.map +1 -1
  102. package/glTF/2.0/Extensions/MSFT_lod.d.ts +45 -11
  103. package/glTF/2.0/Extensions/MSFT_lod.js +44 -8
  104. package/glTF/2.0/Extensions/MSFT_lod.js.map +1 -1
  105. package/glTF/2.0/Extensions/MSFT_minecraftMesh.d.ts +2 -2
  106. package/glTF/2.0/Extensions/MSFT_minecraftMesh.js.map +1 -1
  107. package/glTF/2.0/Extensions/MSFT_sRGBFactors.d.ts +2 -2
  108. package/glTF/2.0/Extensions/MSFT_sRGBFactors.js.map +1 -1
  109. package/glTF/2.0/Extensions/index.js.map +1 -1
  110. package/glTF/2.0/glTFLoader.d.ts +70 -22
  111. package/glTF/2.0/glTFLoader.js +180 -93
  112. package/glTF/2.0/glTFLoader.js.map +1 -1
  113. package/glTF/2.0/glTFLoaderExtension.d.ts +11 -11
  114. package/glTF/2.0/glTFLoaderExtension.js.map +1 -1
  115. package/glTF/2.0/glTFLoaderInterfaces.d.ts +7 -7
  116. package/glTF/2.0/glTFLoaderInterfaces.js.map +1 -1
  117. package/glTF/2.0/index.js.map +1 -1
  118. package/glTF/glTFFileLoader.d.ts +87 -27
  119. package/glTF/glTFFileLoader.js +102 -45
  120. package/glTF/glTFFileLoader.js.map +1 -1
  121. package/glTF/glTFValidation.d.ts +1 -1
  122. package/glTF/glTFValidation.js +12 -12
  123. package/glTF/glTFValidation.js.map +1 -1
  124. package/glTF/index.js.map +1 -1
  125. package/index.js.map +1 -1
  126. package/legacy/legacy-glTF.d.ts +2 -2
  127. package/legacy/legacy-glTF.js +5 -5
  128. package/legacy/legacy-glTF.js.map +1 -1
  129. package/legacy/legacy-glTF1.d.ts +1 -1
  130. package/legacy/legacy-glTF1.js +2 -2
  131. package/legacy/legacy-glTF1.js.map +1 -1
  132. package/legacy/legacy-glTF1FileLoader.js +1 -0
  133. package/legacy/legacy-glTF1FileLoader.js.map +1 -1
  134. package/legacy/legacy-glTF2.d.ts +1 -1
  135. package/legacy/legacy-glTF2.js +11 -11
  136. package/legacy/legacy-glTF2.js.map +1 -1
  137. package/legacy/legacy-glTF2FileLoader.js +1 -0
  138. package/legacy/legacy-glTF2FileLoader.js.map +1 -1
  139. package/legacy/legacy-glTFFileLoader.js +1 -0
  140. package/legacy/legacy-glTFFileLoader.js.map +1 -1
  141. package/legacy/legacy-objFileLoader.d.ts +1 -1
  142. package/legacy/legacy-objFileLoader.js +3 -3
  143. package/legacy/legacy-objFileLoader.js.map +1 -1
  144. package/legacy/legacy-stlFileLoader.d.ts +1 -1
  145. package/legacy/legacy-stlFileLoader.js +3 -3
  146. package/legacy/legacy-stlFileLoader.js.map +1 -1
  147. package/legacy/legacy.d.ts +1 -1
  148. package/legacy/legacy.js +2 -1
  149. package/legacy/legacy.js.map +1 -1
  150. package/package.json +23 -198
  151. package/readme.md +2 -2
@@ -1,14 +1,14 @@
1
- import { AssetContainer } from "@babylonjs/core/assetContainer";
2
- import { Bone } from "@babylonjs/core/Bones/bone";
3
- import { Skeleton } from "@babylonjs/core/Bones/skeleton";
4
- import { Texture } from "@babylonjs/core/Materials/Textures/texture";
5
- import { Node } from "@babylonjs/core/node";
6
- import { Scene } from "@babylonjs/core/scene";
7
- import { Nullable } from "@babylonjs/core/types";
1
+ import { AssetContainer } from "@babylonjs/core/assetContainer.js";
2
+ import { Bone } from "@babylonjs/core/Bones/bone.js";
3
+ import { Skeleton } from "@babylonjs/core/Bones/skeleton.js";
4
+ import { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
5
+ import { Node } from "@babylonjs/core/node.js";
6
+ import { Scene } from "@babylonjs/core/scene.js";
7
+ import { Nullable } from "@babylonjs/core/types.js";
8
8
  /**
9
- * Enums
10
- * @hidden
11
- */
9
+ * Enums
10
+ * @hidden
11
+ */
12
12
  export declare enum EComponentType {
13
13
  BYTE = 5120,
14
14
  UNSIGNED_BYTE = 5121,
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Enums
3
- * @hidden
4
- */
2
+ * Enums
3
+ * @hidden
4
+ */
5
5
  export var EComponentType;
6
6
  (function (EComponentType) {
7
7
  EComponentType[EComponentType["BYTE"] = 5120] = "BYTE";
@@ -1 +1 @@
1
- {"version":3,"file":"glTFLoaderInterfaces.js","sourceRoot":"","sources":["../../../../sourceES6/loaders/src/glTF/1.0/glTFLoaderInterfaces.ts"],"names":[],"mappings":"AAQA;;;EAGE;AACF,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACtB,sDAAW,CAAA;IACX,wEAAoB,CAAA;IACpB,wDAAY,CAAA;IACZ,0EAAqB,CAAA;IACrB,wDAAY,CAAA;AAChB,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB;AAED,cAAc;AACd,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACnB,yDAAgB,CAAA;IAChB,qDAAc,CAAA;AAClB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB;AAED,cAAc;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;AACzB,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AAED,cAAc;AACd,MAAM,CAAN,IAAY,iBAgBX;AAhBD,WAAY,iBAAiB;IACzB,yDAAQ,CAAA;IACR,uDAAO,CAAA;IACP,qEAAe,CAAA;IACf,yFAAyB,CAAA;IACzB,qEAAe,CAAA;IACf,yFAAyB,CAAA;IACzB,qEAAe,CAAA;IACf,yFAAyB,CAAA;IACzB,qEAAe,CAAA;IACf,yFAAyB,CAAA;IACzB,iFAAsB,CAAA;IACtB,qGAAgC,CAAA;IAChC,iFAAsB,CAAA;IACtB,qGAAgC,CAAA;IAChC,uFAAwB,CAAA;AAC5B,CAAC,EAhBW,iBAAiB,KAAjB,iBAAiB,QAgB5B","sourcesContent":["import { AssetContainer } from \"@babylonjs/core/assetContainer\";\r\nimport { Bone } from \"@babylonjs/core/Bones/bone\";\r\nimport { Skeleton } from \"@babylonjs/core/Bones/skeleton\";\r\nimport { Texture } from \"@babylonjs/core/Materials/Textures/texture\";\r\nimport { Node } from \"@babylonjs/core/node\";\r\nimport { Scene } from \"@babylonjs/core/scene\";\r\nimport { Nullable } from \"@babylonjs/core/types\";\r\n\r\n/**\r\n* Enums\r\n* @hidden\r\n*/\r\nexport enum EComponentType {\r\n BYTE = 5120,\r\n UNSIGNED_BYTE = 5121,\r\n SHORT = 5122,\r\n UNSIGNED_SHORT = 5123,\r\n FLOAT = 5126\r\n}\r\n\r\n/** @hidden */\r\nexport enum EShaderType {\r\n FRAGMENT = 35632,\r\n VERTEX = 35633\r\n}\r\n\r\n/** @hidden */\r\nexport enum EParameterType {\r\n BYTE = 5120,\r\n UNSIGNED_BYTE = 5121,\r\n SHORT = 5122,\r\n UNSIGNED_SHORT = 5123,\r\n INT = 5124,\r\n UNSIGNED_INT = 5125,\r\n FLOAT = 5126,\r\n FLOAT_VEC2 = 35664,\r\n FLOAT_VEC3 = 35665,\r\n FLOAT_VEC4 = 35666,\r\n INT_VEC2 = 35667,\r\n INT_VEC3 = 35668,\r\n INT_VEC4 = 35669,\r\n BOOL = 35670,\r\n BOOL_VEC2 = 35671,\r\n BOOL_VEC3 = 35672,\r\n BOOL_VEC4 = 35673,\r\n FLOAT_MAT2 = 35674,\r\n FLOAT_MAT3 = 35675,\r\n FLOAT_MAT4 = 35676,\r\n SAMPLER_2D = 35678\r\n}\r\n\r\n/** @hidden */\r\nexport enum ETextureWrapMode {\r\n CLAMP_TO_EDGE = 33071,\r\n MIRRORED_REPEAT = 33648,\r\n REPEAT = 10497\r\n}\r\n\r\n/** @hidden */\r\nexport enum ETextureFilterType {\r\n NEAREST = 9728,\r\n LINEAR = 9728,\r\n NEAREST_MIPMAP_NEAREST = 9984,\r\n LINEAR_MIPMAP_NEAREST = 9985,\r\n NEAREST_MIPMAP_LINEAR = 9986,\r\n LINEAR_MIPMAP_LINEAR = 9987\r\n}\r\n\r\n/** @hidden */\r\nexport enum ETextureFormat {\r\n ALPHA = 6406,\r\n RGB = 6407,\r\n RGBA = 6408,\r\n LUMINANCE = 6409,\r\n LUMINANCE_ALPHA = 6410\r\n}\r\n\r\n/** @hidden */\r\nexport enum ECullingType {\r\n FRONT = 1028,\r\n BACK = 1029,\r\n FRONT_AND_BACK = 1032\r\n}\r\n\r\n/** @hidden */\r\nexport enum EBlendingFunction {\r\n ZERO = 0,\r\n ONE = 1,\r\n SRC_COLOR = 768,\r\n ONE_MINUS_SRC_COLOR = 769,\r\n DST_COLOR = 774,\r\n ONE_MINUS_DST_COLOR = 775,\r\n SRC_ALPHA = 770,\r\n ONE_MINUS_SRC_ALPHA = 771,\r\n DST_ALPHA = 772,\r\n ONE_MINUS_DST_ALPHA = 773,\r\n CONSTANT_COLOR = 32769,\r\n ONE_MINUS_CONSTANT_COLOR = 32770,\r\n CONSTANT_ALPHA = 32771,\r\n ONE_MINUS_CONSTANT_ALPHA = 32772,\r\n SRC_ALPHA_SATURATE = 776\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFProperty {\r\n extensions?: { [key: string]: any };\r\n extras?: Object;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFChildRootProperty extends IGLTFProperty {\r\n name?: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAccessor extends IGLTFChildRootProperty {\r\n bufferView: string;\r\n byteOffset: number;\r\n byteStride: number;\r\n count: number;\r\n type: string;\r\n componentType: EComponentType;\r\n\r\n max?: number[];\r\n min?: number[];\r\n name?: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFBufferView extends IGLTFChildRootProperty {\r\n buffer: string;\r\n byteOffset: number;\r\n byteLength: number;\r\n byteStride: number;\r\n\r\n target?: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFBuffer extends IGLTFChildRootProperty {\r\n uri: string;\r\n\r\n byteLength?: number;\r\n type?: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFShader extends IGLTFChildRootProperty {\r\n uri: string;\r\n type: EShaderType;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFProgram extends IGLTFChildRootProperty {\r\n attributes: string[];\r\n fragmentShader: string;\r\n vertexShader: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTechniqueParameter {\r\n type: number;\r\n\r\n count?: number;\r\n semantic?: string;\r\n node?: string;\r\n value?: number | boolean | string | Array<any>;\r\n source?: string;\r\n\r\n babylonValue?: any;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTechniqueCommonProfile {\r\n lightingModel: string;\r\n texcoordBindings: Object;\r\n\r\n parameters?: Array<any>;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTechniqueStatesFunctions {\r\n blendColor?: number[];\r\n blendEquationSeparate?: number[];\r\n blendFuncSeparate?: number[];\r\n colorMask: boolean[];\r\n cullFace: number[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTechniqueStates {\r\n enable: number[];\r\n functions: IGLTFTechniqueStatesFunctions;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTechnique extends IGLTFChildRootProperty {\r\n parameters: { [key: string]: IGLTFTechniqueParameter };\r\n program: string;\r\n\r\n attributes: { [key: string]: string };\r\n uniforms: { [key: string]: string };\r\n states: IGLTFTechniqueStates;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFMaterial extends IGLTFChildRootProperty {\r\n technique?: string;\r\n values: string[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFMeshPrimitive extends IGLTFProperty {\r\n attributes: { [key: string]: string };\r\n indices: string;\r\n material: string;\r\n\r\n mode?: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFMesh extends IGLTFChildRootProperty {\r\n primitives: IGLTFMeshPrimitive[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFImage extends IGLTFChildRootProperty {\r\n uri: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFSampler extends IGLTFChildRootProperty {\r\n magFilter?: number;\r\n minFilter?: number;\r\n wrapS?: number;\r\n wrapT?: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTexture extends IGLTFChildRootProperty {\r\n sampler: string;\r\n source: string;\r\n\r\n format?: ETextureFormat;\r\n internalFormat?: ETextureFormat;\r\n target?: number;\r\n type?: number;\r\n\r\n // Babylon.js values (optimize)\r\n babylonTexture?: Texture;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAmbienLight {\r\n color?: number[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFDirectionalLight {\r\n color?: number[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFPointLight {\r\n color?: number[];\r\n constantAttenuation?: number;\r\n linearAttenuation?: number;\r\n quadraticAttenuation?: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFSpotLight {\r\n color?: number[];\r\n constantAttenuation?: number;\r\n fallOfAngle?: number;\r\n fallOffExponent?: number;\r\n linearAttenuation?: number;\r\n quadraticAttenuation?: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFLight extends IGLTFChildRootProperty {\r\n type: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFCameraOrthographic {\r\n xmag: number;\r\n ymag: number;\r\n zfar: number;\r\n znear: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFCameraPerspective {\r\n aspectRatio: number;\r\n yfov: number;\r\n zfar: number;\r\n znear: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFCamera extends IGLTFChildRootProperty {\r\n type: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAnimationChannelTarget {\r\n id: string;\r\n path: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAnimationChannel {\r\n sampler: string;\r\n target: IGLTFAnimationChannelTarget;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAnimationSampler {\r\n input: string;\r\n output: string;\r\n\r\n interpolation?: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAnimation extends IGLTFChildRootProperty {\r\n channels?: IGLTFAnimationChannel[];\r\n parameters?: { [key: string]: string };\r\n samplers?: { [key: string]: IGLTFAnimationSampler };\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFNodeInstanceSkin {\r\n skeletons: string[];\r\n skin: string;\r\n meshes: string[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFSkins extends IGLTFChildRootProperty {\r\n bindShapeMatrix: number[];\r\n inverseBindMatrices: string;\r\n jointNames: string[];\r\n\r\n babylonSkeleton?: Skeleton;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFNode extends IGLTFChildRootProperty {\r\n camera?: string;\r\n children: string[];\r\n skin?: string;\r\n jointName?: string;\r\n light?: string;\r\n matrix: number[];\r\n mesh?: string;\r\n meshes?: string[];\r\n rotation?: number[];\r\n scale?: number[];\r\n translation?: number[];\r\n\r\n // Babylon.js values (optimize)\r\n babylonNode?: Node;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFScene extends IGLTFChildRootProperty {\r\n nodes: string[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFRuntime {\r\n extensions: { [key: string]: any };\r\n accessors: { [key: string]: IGLTFAccessor };\r\n buffers: { [key: string]: IGLTFBuffer };\r\n bufferViews: { [key: string]: IGLTFBufferView };\r\n meshes: { [key: string]: IGLTFMesh };\r\n lights: { [key: string]: IGLTFLight };\r\n cameras: { [key: string]: IGLTFCamera };\r\n nodes: { [key: string]: IGLTFNode };\r\n images: { [key: string]: IGLTFImage };\r\n textures: { [key: string]: IGLTFTexture };\r\n shaders: { [key: string]: IGLTFShader };\r\n programs: { [key: string]: IGLTFProgram };\r\n samplers: { [key: string]: IGLTFSampler };\r\n techniques: { [key: string]: IGLTFTechnique };\r\n materials: { [key: string]: IGLTFMaterial };\r\n animations: { [key: string]: IGLTFAnimation };\r\n skins: { [key: string]: IGLTFSkins };\r\n\r\n currentScene?: Object;\r\n scenes: { [key: string]: IGLTFScene }; // v1.1\r\n\r\n extensionsUsed: string[];\r\n extensionsRequired?: string[]; // v1.1\r\n\r\n buffersCount: number;\r\n shaderscount: number;\r\n\r\n scene: Scene;\r\n rootUrl: string;\r\n\r\n loadedBufferCount: number;\r\n loadedBufferViews: { [name: string]: ArrayBufferView };\r\n\r\n loadedShaderCount: number;\r\n\r\n importOnlyMeshes: boolean;\r\n importMeshesNames?: string[];\r\n\r\n dummyNodes: Node[];\r\n\r\n assetContainer: Nullable<AssetContainer>;\r\n}\r\n\r\n/** @hidden */\r\nexport interface INodeToRoot {\r\n bone: Bone;\r\n node: IGLTFNode;\r\n id: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IJointNode {\r\n node: IGLTFNode;\r\n id: string;\r\n}\r\n"]}
1
+ {"version":3,"file":"glTFLoaderInterfaces.js","sourceRoot":"","sources":["../../../../../../lts/loaders/generated/glTF/1.0/glTFLoaderInterfaces.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,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d,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACtB,wDAAY,CAAA;IACZ,oDAAU,CAAA;IACV,sDAAW,CAAA;IACX,gEAAgB,CAAA;IAChB,4EAAsB,CAAA;AAC1B,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB;AAED,cAAc;AACd,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,oDAAY,CAAA;IACZ,kDAAW,CAAA;IACX,sEAAqB,CAAA;AACzB,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AAED,cAAc;AACd,MAAM,CAAN,IAAY,iBAgBX;AAhBD,WAAY,iBAAiB;IACzB,yDAAQ,CAAA;IACR,uDAAO,CAAA;IACP,qEAAe,CAAA;IACf,yFAAyB,CAAA;IACzB,qEAAe,CAAA;IACf,yFAAyB,CAAA;IACzB,qEAAe,CAAA;IACf,yFAAyB,CAAA;IACzB,qEAAe,CAAA;IACf,yFAAyB,CAAA;IACzB,iFAAsB,CAAA;IACtB,qGAAgC,CAAA;IAChC,iFAAsB,CAAA;IACtB,qGAAgC,CAAA;IAChC,uFAAwB,CAAA;AAC5B,CAAC,EAhBW,iBAAiB,KAAjB,iBAAiB,QAgB5B","sourcesContent":["import { AssetContainer } from \"core/assetContainer\";\r\nimport { Bone } from \"core/Bones/bone\";\r\nimport { Skeleton } from \"core/Bones/skeleton\";\r\nimport { Texture } from \"core/Materials/Textures/texture\";\r\nimport { Node } from \"core/node\";\r\nimport { Scene } from \"core/scene\";\r\nimport { Nullable } from \"core/types\";\r\n\r\n/**\r\n * Enums\r\n * @hidden\r\n */\r\nexport enum EComponentType {\r\n BYTE = 5120,\r\n UNSIGNED_BYTE = 5121,\r\n SHORT = 5122,\r\n UNSIGNED_SHORT = 5123,\r\n FLOAT = 5126,\r\n}\r\n\r\n/** @hidden */\r\nexport enum EShaderType {\r\n FRAGMENT = 35632,\r\n VERTEX = 35633,\r\n}\r\n\r\n/** @hidden */\r\nexport enum EParameterType {\r\n BYTE = 5120,\r\n UNSIGNED_BYTE = 5121,\r\n SHORT = 5122,\r\n UNSIGNED_SHORT = 5123,\r\n INT = 5124,\r\n UNSIGNED_INT = 5125,\r\n FLOAT = 5126,\r\n FLOAT_VEC2 = 35664,\r\n FLOAT_VEC3 = 35665,\r\n FLOAT_VEC4 = 35666,\r\n INT_VEC2 = 35667,\r\n INT_VEC3 = 35668,\r\n INT_VEC4 = 35669,\r\n BOOL = 35670,\r\n BOOL_VEC2 = 35671,\r\n BOOL_VEC3 = 35672,\r\n BOOL_VEC4 = 35673,\r\n FLOAT_MAT2 = 35674,\r\n FLOAT_MAT3 = 35675,\r\n FLOAT_MAT4 = 35676,\r\n SAMPLER_2D = 35678,\r\n}\r\n\r\n/** @hidden */\r\nexport enum ETextureWrapMode {\r\n CLAMP_TO_EDGE = 33071,\r\n MIRRORED_REPEAT = 33648,\r\n REPEAT = 10497,\r\n}\r\n\r\n/** @hidden */\r\nexport enum ETextureFilterType {\r\n NEAREST = 9728,\r\n LINEAR = 9728,\r\n NEAREST_MIPMAP_NEAREST = 9984,\r\n LINEAR_MIPMAP_NEAREST = 9985,\r\n NEAREST_MIPMAP_LINEAR = 9986,\r\n LINEAR_MIPMAP_LINEAR = 9987,\r\n}\r\n\r\n/** @hidden */\r\nexport enum ETextureFormat {\r\n ALPHA = 6406,\r\n RGB = 6407,\r\n RGBA = 6408,\r\n LUMINANCE = 6409,\r\n LUMINANCE_ALPHA = 6410,\r\n}\r\n\r\n/** @hidden */\r\nexport enum ECullingType {\r\n FRONT = 1028,\r\n BACK = 1029,\r\n FRONT_AND_BACK = 1032,\r\n}\r\n\r\n/** @hidden */\r\nexport enum EBlendingFunction {\r\n ZERO = 0,\r\n ONE = 1,\r\n SRC_COLOR = 768,\r\n ONE_MINUS_SRC_COLOR = 769,\r\n DST_COLOR = 774,\r\n ONE_MINUS_DST_COLOR = 775,\r\n SRC_ALPHA = 770,\r\n ONE_MINUS_SRC_ALPHA = 771,\r\n DST_ALPHA = 772,\r\n ONE_MINUS_DST_ALPHA = 773,\r\n CONSTANT_COLOR = 32769,\r\n ONE_MINUS_CONSTANT_COLOR = 32770,\r\n CONSTANT_ALPHA = 32771,\r\n ONE_MINUS_CONSTANT_ALPHA = 32772,\r\n SRC_ALPHA_SATURATE = 776,\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFProperty {\r\n extensions?: { [key: string]: any };\r\n extras?: Object;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFChildRootProperty extends IGLTFProperty {\r\n name?: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAccessor extends IGLTFChildRootProperty {\r\n bufferView: string;\r\n byteOffset: number;\r\n byteStride: number;\r\n count: number;\r\n type: string;\r\n componentType: EComponentType;\r\n\r\n max?: number[];\r\n min?: number[];\r\n name?: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFBufferView extends IGLTFChildRootProperty {\r\n buffer: string;\r\n byteOffset: number;\r\n byteLength: number;\r\n byteStride: number;\r\n\r\n target?: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFBuffer extends IGLTFChildRootProperty {\r\n uri: string;\r\n\r\n byteLength?: number;\r\n type?: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFShader extends IGLTFChildRootProperty {\r\n uri: string;\r\n type: EShaderType;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFProgram extends IGLTFChildRootProperty {\r\n attributes: string[];\r\n fragmentShader: string;\r\n vertexShader: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTechniqueParameter {\r\n type: number;\r\n\r\n count?: number;\r\n semantic?: string;\r\n node?: string;\r\n value?: number | boolean | string | Array<any>;\r\n source?: string;\r\n\r\n babylonValue?: any;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTechniqueCommonProfile {\r\n lightingModel: string;\r\n texcoordBindings: Object;\r\n\r\n parameters?: Array<any>;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTechniqueStatesFunctions {\r\n blendColor?: number[];\r\n blendEquationSeparate?: number[];\r\n blendFuncSeparate?: number[];\r\n colorMask: boolean[];\r\n cullFace: number[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTechniqueStates {\r\n enable: number[];\r\n functions: IGLTFTechniqueStatesFunctions;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTechnique extends IGLTFChildRootProperty {\r\n parameters: { [key: string]: IGLTFTechniqueParameter };\r\n program: string;\r\n\r\n attributes: { [key: string]: string };\r\n uniforms: { [key: string]: string };\r\n states: IGLTFTechniqueStates;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFMaterial extends IGLTFChildRootProperty {\r\n technique?: string;\r\n values: string[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFMeshPrimitive extends IGLTFProperty {\r\n attributes: { [key: string]: string };\r\n indices: string;\r\n material: string;\r\n\r\n mode?: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFMesh extends IGLTFChildRootProperty {\r\n primitives: IGLTFMeshPrimitive[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFImage extends IGLTFChildRootProperty {\r\n uri: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFSampler extends IGLTFChildRootProperty {\r\n magFilter?: number;\r\n minFilter?: number;\r\n wrapS?: number;\r\n wrapT?: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFTexture extends IGLTFChildRootProperty {\r\n sampler: string;\r\n source: string;\r\n\r\n format?: ETextureFormat;\r\n internalFormat?: ETextureFormat;\r\n target?: number;\r\n type?: number;\r\n\r\n // Babylon.js values (optimize)\r\n babylonTexture?: Texture;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAmbienLight {\r\n color?: number[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFDirectionalLight {\r\n color?: number[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFPointLight {\r\n color?: number[];\r\n constantAttenuation?: number;\r\n linearAttenuation?: number;\r\n quadraticAttenuation?: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFSpotLight {\r\n color?: number[];\r\n constantAttenuation?: number;\r\n fallOfAngle?: number;\r\n fallOffExponent?: number;\r\n linearAttenuation?: number;\r\n quadraticAttenuation?: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFLight extends IGLTFChildRootProperty {\r\n type: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFCameraOrthographic {\r\n xmag: number;\r\n ymag: number;\r\n zfar: number;\r\n znear: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFCameraPerspective {\r\n aspectRatio: number;\r\n yfov: number;\r\n zfar: number;\r\n znear: number;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFCamera extends IGLTFChildRootProperty {\r\n type: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAnimationChannelTarget {\r\n id: string;\r\n path: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAnimationChannel {\r\n sampler: string;\r\n target: IGLTFAnimationChannelTarget;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAnimationSampler {\r\n input: string;\r\n output: string;\r\n\r\n interpolation?: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFAnimation extends IGLTFChildRootProperty {\r\n channels?: IGLTFAnimationChannel[];\r\n parameters?: { [key: string]: string };\r\n samplers?: { [key: string]: IGLTFAnimationSampler };\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFNodeInstanceSkin {\r\n skeletons: string[];\r\n skin: string;\r\n meshes: string[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFSkins extends IGLTFChildRootProperty {\r\n bindShapeMatrix: number[];\r\n inverseBindMatrices: string;\r\n jointNames: string[];\r\n\r\n babylonSkeleton?: Skeleton;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFNode extends IGLTFChildRootProperty {\r\n camera?: string;\r\n children: string[];\r\n skin?: string;\r\n jointName?: string;\r\n light?: string;\r\n matrix: number[];\r\n mesh?: string;\r\n meshes?: string[];\r\n rotation?: number[];\r\n scale?: number[];\r\n translation?: number[];\r\n\r\n // Babylon.js values (optimize)\r\n babylonNode?: Node;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFScene extends IGLTFChildRootProperty {\r\n nodes: string[];\r\n}\r\n\r\n/** @hidden */\r\nexport interface IGLTFRuntime {\r\n extensions: { [key: string]: any };\r\n accessors: { [key: string]: IGLTFAccessor };\r\n buffers: { [key: string]: IGLTFBuffer };\r\n bufferViews: { [key: string]: IGLTFBufferView };\r\n meshes: { [key: string]: IGLTFMesh };\r\n lights: { [key: string]: IGLTFLight };\r\n cameras: { [key: string]: IGLTFCamera };\r\n nodes: { [key: string]: IGLTFNode };\r\n images: { [key: string]: IGLTFImage };\r\n textures: { [key: string]: IGLTFTexture };\r\n shaders: { [key: string]: IGLTFShader };\r\n programs: { [key: string]: IGLTFProgram };\r\n samplers: { [key: string]: IGLTFSampler };\r\n techniques: { [key: string]: IGLTFTechnique };\r\n materials: { [key: string]: IGLTFMaterial };\r\n animations: { [key: string]: IGLTFAnimation };\r\n skins: { [key: string]: IGLTFSkins };\r\n\r\n currentScene?: Object;\r\n scenes: { [key: string]: IGLTFScene }; // v1.1\r\n\r\n extensionsUsed: string[];\r\n extensionsRequired?: string[]; // v1.1\r\n\r\n buffersCount: number;\r\n shaderscount: number;\r\n\r\n scene: Scene;\r\n rootUrl: string;\r\n\r\n loadedBufferCount: number;\r\n loadedBufferViews: { [name: string]: ArrayBufferView };\r\n\r\n loadedShaderCount: number;\r\n\r\n importOnlyMeshes: boolean;\r\n importMeshesNames?: string[];\r\n\r\n dummyNodes: Node[];\r\n\r\n assetContainer: Nullable<AssetContainer>;\r\n}\r\n\r\n/** @hidden */\r\nexport interface INodeToRoot {\r\n bone: Bone;\r\n node: IGLTFNode;\r\n id: string;\r\n}\r\n\r\n/** @hidden */\r\nexport interface IJointNode {\r\n node: IGLTFNode;\r\n id: string;\r\n}\r\n"]}
@@ -1,61 +1,61 @@
1
1
  import { IGLTFTechniqueParameter, IGLTFAccessor, ETextureFilterType, IGLTFRuntime, IGLTFBufferView, EComponentType } from "./glTFLoaderInterfaces";
2
- import { Effect } from "@babylonjs/core/Materials/effect";
3
- import { ShaderMaterial } from "@babylonjs/core/Materials/shaderMaterial";
4
- import { Node } from "@babylonjs/core/node";
5
- import { Scene } from "@babylonjs/core/scene";
2
+ import { Effect } from "@babylonjs/core/Materials/effect.js";
3
+ import { ShaderMaterial } from "@babylonjs/core/Materials/shaderMaterial.js";
4
+ import { Node } from "@babylonjs/core/node.js";
5
+ import { Scene } from "@babylonjs/core/scene.js";
6
6
  /**
7
- * Utils functions for GLTF
8
- * @hidden
9
- */
7
+ * Utils functions for GLTF
8
+ * @hidden
9
+ */
10
10
  export declare class GLTFUtils {
11
11
  /**
12
12
  * Sets the given "parameter" matrix
13
- * @param scene: the Scene object
14
- * @param source: the source node where to pick the matrix
15
- * @param parameter: the GLTF technique parameter
16
- * @param uniformName: the name of the shader's uniform
17
- * @param shaderMaterial: the shader material
13
+ * @param scene the Scene object
14
+ * @param source the source node where to pick the matrix
15
+ * @param parameter the GLTF technique parameter
16
+ * @param uniformName the name of the shader's uniform
17
+ * @param shaderMaterial the shader material
18
18
  */
19
19
  static SetMatrix(scene: Scene, source: Node, parameter: IGLTFTechniqueParameter, uniformName: string, shaderMaterial: ShaderMaterial | Effect): void;
20
20
  /**
21
21
  * Sets the given "parameter" matrix
22
- * @param shaderMaterial: the shader material
23
- * @param uniform: the name of the shader's uniform
24
- * @param value: the value of the uniform
25
- * @param type: the uniform's type (EParameterType FLOAT, VEC2, VEC3 or VEC4)
22
+ * @param shaderMaterial the shader material
23
+ * @param uniform the name of the shader's uniform
24
+ * @param value the value of the uniform
25
+ * @param type the uniform's type (EParameterType FLOAT, VEC2, VEC3 or VEC4)
26
26
  */
27
27
  static SetUniform(shaderMaterial: ShaderMaterial | Effect, uniform: string, value: any, type: number): boolean;
28
28
  /**
29
- * Returns the wrap mode of the texture
30
- * @param mode: the mode value
31
- */
29
+ * Returns the wrap mode of the texture
30
+ * @param mode the mode value
31
+ */
32
32
  static GetWrapMode(mode: number): number;
33
33
  /**
34
34
  * Returns the byte stride giving an accessor
35
- * @param accessor: the GLTF accessor objet
35
+ * @param accessor the GLTF accessor objet
36
36
  */
37
37
  static GetByteStrideFromType(accessor: IGLTFAccessor): number;
38
38
  /**
39
39
  * Returns the texture filter mode giving a mode value
40
- * @param mode: the filter mode value
40
+ * @param mode the filter mode value
41
41
  */
42
42
  static GetTextureFilterMode(mode: number): ETextureFilterType;
43
43
  static GetBufferFromBufferView(gltfRuntime: IGLTFRuntime, bufferView: IGLTFBufferView, byteOffset: number, byteLength: number, componentType: EComponentType): ArrayBufferView;
44
44
  /**
45
45
  * Returns a buffer from its accessor
46
- * @param gltfRuntime: the GLTF runtime
47
- * @param accessor: the GLTF accessor
46
+ * @param gltfRuntime the GLTF runtime
47
+ * @param accessor the GLTF accessor
48
48
  */
49
49
  static GetBufferFromAccessor(gltfRuntime: IGLTFRuntime, accessor: IGLTFAccessor): any;
50
50
  /**
51
51
  * Decodes a buffer view into a string
52
- * @param view: the buffer view
52
+ * @param view the buffer view
53
53
  */
54
54
  static DecodeBufferToText(view: ArrayBufferView): string;
55
55
  /**
56
56
  * Returns the default material of gltf. Related to
57
57
  * https://github.com/KhronosGroup/glTF/tree/master/specification/1.0#appendix-a-default-material
58
- * @param scene: the Babylon.js scene
58
+ * @param scene the Babylon.js scene
59
59
  */
60
60
  static GetDefaultMaterial(scene: Scene): ShaderMaterial;
61
61
  private static _DefaultMaterial;
@@ -1,23 +1,23 @@
1
- import { EParameterType, ETextureWrapMode, ETextureFilterType, EComponentType } from "./glTFLoaderInterfaces.js";
1
+ import { EParameterType, ETextureWrapMode, ETextureFilterType, EComponentType, } from "./glTFLoaderInterfaces.js";
2
2
  import { Vector2, Vector3, Vector4, Matrix } from "@babylonjs/core/Maths/math.vector.js";
3
- import { Color4 } from '@babylonjs/core/Maths/math.color.js';
3
+ import { Color4 } from "@babylonjs/core/Maths/math.color.js";
4
4
  import { Effect } from "@babylonjs/core/Materials/effect.js";
5
5
  import { ShaderMaterial } from "@babylonjs/core/Materials/shaderMaterial.js";
6
6
  import { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
7
7
  /**
8
- * Utils functions for GLTF
9
- * @hidden
10
- */
8
+ * Utils functions for GLTF
9
+ * @hidden
10
+ */
11
11
  var GLTFUtils = /** @class */ (function () {
12
12
  function GLTFUtils() {
13
13
  }
14
14
  /**
15
15
  * Sets the given "parameter" matrix
16
- * @param scene: the Scene object
17
- * @param source: the source node where to pick the matrix
18
- * @param parameter: the GLTF technique parameter
19
- * @param uniformName: the name of the shader's uniform
20
- * @param shaderMaterial: the shader material
16
+ * @param scene the Scene object
17
+ * @param source the source node where to pick the matrix
18
+ * @param parameter the GLTF technique parameter
19
+ * @param uniformName the name of the shader's uniform
20
+ * @param shaderMaterial the shader material
21
21
  */
22
22
  GLTFUtils.SetMatrix = function (scene, source, parameter, uniformName, shaderMaterial) {
23
23
  var mat = null;
@@ -57,9 +57,6 @@ var GLTFUtils = /** @class */ (function () {
57
57
  else if (parameter.semantic === "MODELINVERSETRANSPOSE") {
58
58
  mat = Matrix.Transpose(source.getWorldMatrix().invert());
59
59
  }
60
- else {
61
- debugger;
62
- }
63
60
  if (mat) {
64
61
  switch (parameter.type) {
65
62
  case EParameterType.FLOAT_MAT2:
@@ -71,16 +68,17 @@ var GLTFUtils = /** @class */ (function () {
71
68
  case EParameterType.FLOAT_MAT4:
72
69
  shaderMaterial.setMatrix(uniformName, mat);
73
70
  break;
74
- default: break;
71
+ default:
72
+ break;
75
73
  }
76
74
  }
77
75
  };
78
76
  /**
79
77
  * Sets the given "parameter" matrix
80
- * @param shaderMaterial: the shader material
81
- * @param uniform: the name of the shader's uniform
82
- * @param value: the value of the uniform
83
- * @param type: the uniform's type (EParameterType FLOAT, VEC2, VEC3 or VEC4)
78
+ * @param shaderMaterial the shader material
79
+ * @param uniform the name of the shader's uniform
80
+ * @param value the value of the uniform
81
+ * @param type the uniform's type (EParameterType FLOAT, VEC2, VEC3 or VEC4)
84
82
  */
85
83
  GLTFUtils.SetUniform = function (shaderMaterial, uniform, value, type) {
86
84
  switch (type) {
@@ -96,54 +94,69 @@ var GLTFUtils = /** @class */ (function () {
96
94
  case EParameterType.FLOAT_VEC4:
97
95
  shaderMaterial.setVector4(uniform, Vector4.FromArray(value));
98
96
  return true;
99
- default: return false;
97
+ default:
98
+ return false;
100
99
  }
101
100
  };
102
101
  /**
103
- * Returns the wrap mode of the texture
104
- * @param mode: the mode value
105
- */
102
+ * Returns the wrap mode of the texture
103
+ * @param mode the mode value
104
+ */
106
105
  GLTFUtils.GetWrapMode = function (mode) {
107
106
  switch (mode) {
108
- case ETextureWrapMode.CLAMP_TO_EDGE: return Texture.CLAMP_ADDRESSMODE;
109
- case ETextureWrapMode.MIRRORED_REPEAT: return Texture.MIRROR_ADDRESSMODE;
110
- case ETextureWrapMode.REPEAT: return Texture.WRAP_ADDRESSMODE;
111
- default: return Texture.WRAP_ADDRESSMODE;
107
+ case ETextureWrapMode.CLAMP_TO_EDGE:
108
+ return Texture.CLAMP_ADDRESSMODE;
109
+ case ETextureWrapMode.MIRRORED_REPEAT:
110
+ return Texture.MIRROR_ADDRESSMODE;
111
+ case ETextureWrapMode.REPEAT:
112
+ return Texture.WRAP_ADDRESSMODE;
113
+ default:
114
+ return Texture.WRAP_ADDRESSMODE;
112
115
  }
113
116
  };
114
117
  /**
115
118
  * Returns the byte stride giving an accessor
116
- * @param accessor: the GLTF accessor objet
119
+ * @param accessor the GLTF accessor objet
117
120
  */
118
121
  GLTFUtils.GetByteStrideFromType = function (accessor) {
119
122
  // Needs this function since "byteStride" isn't requiered in glTF format
120
123
  var type = accessor.type;
121
124
  switch (type) {
122
- case "VEC2": return 2;
123
- case "VEC3": return 3;
124
- case "VEC4": return 4;
125
- case "MAT2": return 4;
126
- case "MAT3": return 9;
127
- case "MAT4": return 16;
128
- default: return 1;
125
+ case "VEC2":
126
+ return 2;
127
+ case "VEC3":
128
+ return 3;
129
+ case "VEC4":
130
+ return 4;
131
+ case "MAT2":
132
+ return 4;
133
+ case "MAT3":
134
+ return 9;
135
+ case "MAT4":
136
+ return 16;
137
+ default:
138
+ return 1;
129
139
  }
130
140
  };
131
141
  /**
132
142
  * Returns the texture filter mode giving a mode value
133
- * @param mode: the filter mode value
143
+ * @param mode the filter mode value
134
144
  */
135
145
  GLTFUtils.GetTextureFilterMode = function (mode) {
136
146
  switch (mode) {
137
147
  case ETextureFilterType.LINEAR:
138
148
  case ETextureFilterType.LINEAR_MIPMAP_NEAREST:
139
- case ETextureFilterType.LINEAR_MIPMAP_LINEAR: return Texture.TRILINEAR_SAMPLINGMODE;
149
+ case ETextureFilterType.LINEAR_MIPMAP_LINEAR:
150
+ return Texture.TRILINEAR_SAMPLINGMODE;
140
151
  case ETextureFilterType.NEAREST:
141
- case ETextureFilterType.NEAREST_MIPMAP_NEAREST: return Texture.NEAREST_SAMPLINGMODE;
142
- default: return Texture.BILINEAR_SAMPLINGMODE;
152
+ case ETextureFilterType.NEAREST_MIPMAP_NEAREST:
153
+ return Texture.NEAREST_SAMPLINGMODE;
154
+ default:
155
+ return Texture.BILINEAR_SAMPLINGMODE;
143
156
  }
144
157
  };
145
158
  GLTFUtils.GetBufferFromBufferView = function (gltfRuntime, bufferView, byteOffset, byteLength, componentType) {
146
- var byteOffset = bufferView.byteOffset + byteOffset;
159
+ byteOffset = bufferView.byteOffset + byteOffset;
147
160
  var loadedBufferView = gltfRuntime.loadedBufferViews[bufferView.buffer];
148
161
  if (byteOffset + byteLength > loadedBufferView.byteLength) {
149
162
  throw new Error("Buffer access is out of range");
@@ -151,17 +164,22 @@ var GLTFUtils = /** @class */ (function () {
151
164
  var buffer = loadedBufferView.buffer;
152
165
  byteOffset += loadedBufferView.byteOffset;
153
166
  switch (componentType) {
154
- case EComponentType.BYTE: return new Int8Array(buffer, byteOffset, byteLength);
155
- case EComponentType.UNSIGNED_BYTE: return new Uint8Array(buffer, byteOffset, byteLength);
156
- case EComponentType.SHORT: return new Int16Array(buffer, byteOffset, byteLength);
157
- case EComponentType.UNSIGNED_SHORT: return new Uint16Array(buffer, byteOffset, byteLength);
158
- default: return new Float32Array(buffer, byteOffset, byteLength);
167
+ case EComponentType.BYTE:
168
+ return new Int8Array(buffer, byteOffset, byteLength);
169
+ case EComponentType.UNSIGNED_BYTE:
170
+ return new Uint8Array(buffer, byteOffset, byteLength);
171
+ case EComponentType.SHORT:
172
+ return new Int16Array(buffer, byteOffset, byteLength);
173
+ case EComponentType.UNSIGNED_SHORT:
174
+ return new Uint16Array(buffer, byteOffset, byteLength);
175
+ default:
176
+ return new Float32Array(buffer, byteOffset, byteLength);
159
177
  }
160
178
  };
161
179
  /**
162
180
  * Returns a buffer from its accessor
163
- * @param gltfRuntime: the GLTF runtime
164
- * @param accessor: the GLTF accessor
181
+ * @param gltfRuntime the GLTF runtime
182
+ * @param accessor the GLTF accessor
165
183
  */
166
184
  GLTFUtils.GetBufferFromAccessor = function (gltfRuntime, accessor) {
167
185
  var bufferView = gltfRuntime.bufferViews[accessor.bufferView];
@@ -170,7 +188,7 @@ var GLTFUtils = /** @class */ (function () {
170
188
  };
171
189
  /**
172
190
  * Decodes a buffer view into a string
173
- * @param view: the buffer view
191
+ * @param view the buffer view
174
192
  */
175
193
  GLTFUtils.DecodeBufferToText = function (view) {
176
194
  var result = "";
@@ -183,7 +201,7 @@ var GLTFUtils = /** @class */ (function () {
183
201
  /**
184
202
  * Returns the default material of gltf. Related to
185
203
  * https://github.com/KhronosGroup/glTF/tree/master/specification/1.0#appendix-a-default-material
186
- * @param scene: the Babylon.js scene
204
+ * @param scene the Babylon.js scene
187
205
  */
188
206
  GLTFUtils.GetDefaultMaterial = function (scene) {
189
207
  if (!GLTFUtils._DefaultMaterial) {
@@ -198,7 +216,7 @@ var GLTFUtils = /** @class */ (function () {
198
216
  "void main(void)",
199
217
  "{",
200
218
  " gl_Position = projection * worldView * vec4(position, 1.0);",
201
- "}"
219
+ "}",
202
220
  ].join("\n");
203
221
  Effect.ShadersStore["GLTFDefaultMaterialPixelShader"] = [
204
222
  "precision highp float;",
@@ -208,17 +226,17 @@ var GLTFUtils = /** @class */ (function () {
208
226
  "void main(void)",
209
227
  "{",
210
228
  " gl_FragColor = u_emission;",
211
- "}"
229
+ "}",
212
230
  ].join("\n");
213
231
  var shaderPath = {
214
232
  vertex: "GLTFDefaultMaterial",
215
- fragment: "GLTFDefaultMaterial"
233
+ fragment: "GLTFDefaultMaterial",
216
234
  };
217
235
  var options = {
218
236
  attributes: ["position"],
219
237
  uniforms: ["worldView", "projection", "u_emission"],
220
238
  samplers: new Array(),
221
- needAlphaBlending: false
239
+ needAlphaBlending: false,
222
240
  };
223
241
  GLTFUtils._DefaultMaterial = new ShaderMaterial("GLTFDefaultMaterial", scene, shaderPath, options);
224
242
  GLTFUtils._DefaultMaterial.setColor4("u_emission", new Color4(0.5, 0.5, 0.5, 1.0));
@@ -1 +1 @@
1
- {"version":3,"file":"glTFLoaderUtils.js","sourceRoot":"","sources":["../../../../sourceES6/loaders/src/glTF/1.0/glTFLoaderUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,cAAc,EAAE,gBAAgB,EAAiB,kBAAkB,EAAiC,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGrL,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,4CAA4C,CAAC;A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","sourcesContent":["import { IGLTFTechniqueParameter, EParameterType, ETextureWrapMode, IGLTFAccessor, ETextureFilterType, IGLTFRuntime, IGLTFBufferView, EComponentType } from \"./glTFLoaderInterfaces\";\r\n\r\nimport { Nullable } from \"@babylonjs/core/types\";\r\nimport { Vector2, Vector3, Vector4, Matrix } from \"@babylonjs/core/Maths/math.vector\";\r\nimport { Color4 } from '@babylonjs/core/Maths/math.color';\r\nimport { Effect } from \"@babylonjs/core/Materials/effect\";\r\nimport { ShaderMaterial } from \"@babylonjs/core/Materials/shaderMaterial\";\r\nimport { Texture } from \"@babylonjs/core/Materials/Textures/texture\";\r\nimport { Node } from \"@babylonjs/core/node\";\r\nimport { Scene } from \"@babylonjs/core/scene\";\r\n\r\n/**\r\n* Utils functions for GLTF\r\n* @hidden\r\n*/\r\nexport class GLTFUtils {\r\n /**\r\n * Sets the given \"parameter\" matrix\r\n * @param scene: the Scene object\r\n * @param source: the source node where to pick the matrix\r\n * @param parameter: the GLTF technique parameter\r\n * @param uniformName: the name of the shader's uniform\r\n * @param shaderMaterial: the shader material\r\n */\r\n public static SetMatrix(scene: Scene, source: Node, parameter: IGLTFTechniqueParameter, uniformName: string, shaderMaterial: ShaderMaterial | Effect): void {\r\n var mat: Nullable<Matrix> = null;\r\n\r\n if (parameter.semantic === \"MODEL\") {\r\n mat = source.getWorldMatrix();\r\n }\r\n else if (parameter.semantic === \"PROJECTION\") {\r\n mat = scene.getProjectionMatrix();\r\n }\r\n else if (parameter.semantic === \"VIEW\") {\r\n mat = scene.getViewMatrix();\r\n }\r\n else if (parameter.semantic === \"MODELVIEWINVERSETRANSPOSE\") {\r\n mat = Matrix.Transpose(source.getWorldMatrix().multiply(scene.getViewMatrix()).invert());\r\n }\r\n else if (parameter.semantic === \"MODELVIEW\") {\r\n mat = source.getWorldMatrix().multiply(scene.getViewMatrix());\r\n }\r\n else if (parameter.semantic === \"MODELVIEWPROJECTION\") {\r\n mat = source.getWorldMatrix().multiply(scene.getTransformMatrix());\r\n }\r\n else if (parameter.semantic === \"MODELINVERSE\") {\r\n mat = source.getWorldMatrix().invert();\r\n }\r\n else if (parameter.semantic === \"VIEWINVERSE\") {\r\n mat = scene.getViewMatrix().invert();\r\n }\r\n else if (parameter.semantic === \"PROJECTIONINVERSE\") {\r\n mat = scene.getProjectionMatrix().invert();\r\n }\r\n else if (parameter.semantic === \"MODELVIEWINVERSE\") {\r\n mat = source.getWorldMatrix().multiply(scene.getViewMatrix()).invert();\r\n }\r\n else if (parameter.semantic === \"MODELVIEWPROJECTIONINVERSE\") {\r\n mat = source.getWorldMatrix().multiply(scene.getTransformMatrix()).invert();\r\n }\r\n else if (parameter.semantic === \"MODELINVERSETRANSPOSE\") {\r\n mat = Matrix.Transpose(source.getWorldMatrix().invert());\r\n }\r\n else {\r\n debugger;\r\n }\r\n\r\n if (mat) {\r\n switch (parameter.type) {\r\n case EParameterType.FLOAT_MAT2: shaderMaterial.setMatrix2x2(uniformName, Matrix.GetAsMatrix2x2(mat)); break;\r\n case EParameterType.FLOAT_MAT3: shaderMaterial.setMatrix3x3(uniformName, Matrix.GetAsMatrix3x3(mat)); break;\r\n case EParameterType.FLOAT_MAT4: shaderMaterial.setMatrix(uniformName, mat); break;\r\n default: break;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Sets the given \"parameter\" matrix\r\n * @param shaderMaterial: the shader material\r\n * @param uniform: the name of the shader's uniform\r\n * @param value: the value of the uniform\r\n * @param type: the uniform's type (EParameterType FLOAT, VEC2, VEC3 or VEC4)\r\n */\r\n public static SetUniform(shaderMaterial: ShaderMaterial | Effect, uniform: string, value: any, type: number): boolean {\r\n switch (type) {\r\n case EParameterType.FLOAT: shaderMaterial.setFloat(uniform, value); return true;\r\n case EParameterType.FLOAT_VEC2: shaderMaterial.setVector2(uniform, Vector2.FromArray(value)); return true;\r\n case EParameterType.FLOAT_VEC3: shaderMaterial.setVector3(uniform, Vector3.FromArray(value)); return true;\r\n case EParameterType.FLOAT_VEC4: shaderMaterial.setVector4(uniform, Vector4.FromArray(value)); return true;\r\n default: return false;\r\n }\r\n }\r\n\r\n /**\r\n * Returns the wrap mode of the texture\r\n * @param mode: the mode value\r\n */\r\n public static GetWrapMode(mode: number): number {\r\n switch (mode) {\r\n case ETextureWrapMode.CLAMP_TO_EDGE: return Texture.CLAMP_ADDRESSMODE;\r\n case ETextureWrapMode.MIRRORED_REPEAT: return Texture.MIRROR_ADDRESSMODE;\r\n case ETextureWrapMode.REPEAT: return Texture.WRAP_ADDRESSMODE;\r\n default: return Texture.WRAP_ADDRESSMODE;\r\n }\r\n }\r\n\r\n /**\r\n * Returns the byte stride giving an accessor\r\n * @param accessor: the GLTF accessor objet\r\n */\r\n public static GetByteStrideFromType(accessor: IGLTFAccessor): number {\r\n // Needs this function since \"byteStride\" isn't requiered in glTF format\r\n var type = accessor.type;\r\n\r\n switch (type) {\r\n case \"VEC2\": return 2;\r\n case \"VEC3\": return 3;\r\n case \"VEC4\": return 4;\r\n case \"MAT2\": return 4;\r\n case \"MAT3\": return 9;\r\n case \"MAT4\": return 16;\r\n default: return 1;\r\n }\r\n }\r\n\r\n /**\r\n * Returns the texture filter mode giving a mode value\r\n * @param mode: the filter mode value\r\n */\r\n public static GetTextureFilterMode(mode: number): ETextureFilterType {\r\n switch (mode) {\r\n case ETextureFilterType.LINEAR:\r\n case ETextureFilterType.LINEAR_MIPMAP_NEAREST:\r\n case ETextureFilterType.LINEAR_MIPMAP_LINEAR: return Texture.TRILINEAR_SAMPLINGMODE;\r\n case ETextureFilterType.NEAREST:\r\n case ETextureFilterType.NEAREST_MIPMAP_NEAREST: return Texture.NEAREST_SAMPLINGMODE;\r\n default: return Texture.BILINEAR_SAMPLINGMODE;\r\n }\r\n }\r\n\r\n public static GetBufferFromBufferView(gltfRuntime: IGLTFRuntime, bufferView: IGLTFBufferView, byteOffset: number, byteLength: number, componentType: EComponentType): ArrayBufferView {\r\n var byteOffset = bufferView.byteOffset + byteOffset;\r\n\r\n var loadedBufferView = gltfRuntime.loadedBufferViews[bufferView.buffer];\r\n if (byteOffset + byteLength > loadedBufferView.byteLength) {\r\n throw new Error(\"Buffer access is out of range\");\r\n }\r\n\r\n var buffer = loadedBufferView.buffer;\r\n byteOffset += loadedBufferView.byteOffset;\r\n\r\n switch (componentType) {\r\n case EComponentType.BYTE: return new Int8Array(buffer, byteOffset, byteLength);\r\n case EComponentType.UNSIGNED_BYTE: return new Uint8Array(buffer, byteOffset, byteLength);\r\n case EComponentType.SHORT: return new Int16Array(buffer, byteOffset, byteLength);\r\n case EComponentType.UNSIGNED_SHORT: return new Uint16Array(buffer, byteOffset, byteLength);\r\n default: return new Float32Array(buffer, byteOffset, byteLength);\r\n }\r\n }\r\n\r\n /**\r\n * Returns a buffer from its accessor\r\n * @param gltfRuntime: the GLTF runtime\r\n * @param accessor: the GLTF accessor\r\n */\r\n public static GetBufferFromAccessor(gltfRuntime: IGLTFRuntime, accessor: IGLTFAccessor): any {\r\n var bufferView: IGLTFBufferView = gltfRuntime.bufferViews[accessor.bufferView];\r\n var byteLength = accessor.count * GLTFUtils.GetByteStrideFromType(accessor);\r\n return GLTFUtils.GetBufferFromBufferView(gltfRuntime, bufferView, accessor.byteOffset, byteLength, accessor.componentType);\r\n }\r\n\r\n /**\r\n * Decodes a buffer view into a string\r\n * @param view: the buffer view\r\n */\r\n public static DecodeBufferToText(view: ArrayBufferView): string {\r\n var result = \"\";\r\n var length = view.byteLength;\r\n\r\n for (var i = 0; i < length; ++i) {\r\n result += String.fromCharCode((<any>view)[i]);\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns the default material of gltf. Related to\r\n * https://github.com/KhronosGroup/glTF/tree/master/specification/1.0#appendix-a-default-material\r\n * @param scene: the Babylon.js scene\r\n */\r\n public static GetDefaultMaterial(scene: Scene): ShaderMaterial {\r\n if (!GLTFUtils._DefaultMaterial) {\r\n Effect.ShadersStore[\"GLTFDefaultMaterialVertexShader\"] = [\r\n \"precision highp float;\",\r\n \"\",\r\n \"uniform mat4 worldView;\",\r\n \"uniform mat4 projection;\",\r\n \"\",\r\n \"attribute vec3 position;\",\r\n \"\",\r\n \"void main(void)\",\r\n \"{\",\r\n \" gl_Position = projection * worldView * vec4(position, 1.0);\",\r\n \"}\"\r\n ].join(\"\\n\");\r\n\r\n Effect.ShadersStore[\"GLTFDefaultMaterialPixelShader\"] = [\r\n \"precision highp float;\",\r\n \"\",\r\n \"uniform vec4 u_emission;\",\r\n \"\",\r\n \"void main(void)\",\r\n \"{\",\r\n \" gl_FragColor = u_emission;\",\r\n \"}\"\r\n ].join(\"\\n\");\r\n\r\n var shaderPath = {\r\n vertex: \"GLTFDefaultMaterial\",\r\n fragment: \"GLTFDefaultMaterial\"\r\n };\r\n\r\n var options = {\r\n attributes: [\"position\"],\r\n uniforms: [\"worldView\", \"projection\", \"u_emission\"],\r\n samplers: new Array<string>(),\r\n needAlphaBlending: false\r\n };\r\n\r\n GLTFUtils._DefaultMaterial = new ShaderMaterial(\"GLTFDefaultMaterial\", scene, shaderPath, options);\r\n GLTFUtils._DefaultMaterial.setColor4(\"u_emission\", new Color4(0.5, 0.5, 0.5, 1.0));\r\n }\r\n\r\n return GLTFUtils._DefaultMaterial;\r\n }\r\n\r\n // The GLTF default material\r\n private static _DefaultMaterial: Nullable<ShaderMaterial> = null;\r\n}"]}
1
+ {"version":3,"file":"glTFLoaderUtils.js","sourceRoot":"","sources":["../../../../../../lts/loaders/generated/glTF/1.0/glTFLoaderUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,cAAc,EACd,gBAAgB,EAEhB,kBAAkB,EAGlB,cAAc,GACjB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,6CAA+B;AAC3E,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAC/C,OAAO,EAAE,MAAM,EAAE,4CAA8B;AAC/C,OAAO,EAAE,cAAc,EAAE,oDAAsC;AAC/D,OAAO,EAAE,OA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wBAAwB;gBACxB,EAAE;gBACF,yBAAyB;gBACzB,0BAA0B;gBAC1B,EAAE;gBACF,0BAA0B;gBAC1B,EAAE;gBACF,iBAAiB;gBACjB,GAAG;gBACH,iEAAiE;gBACjE,GAAG;aACN,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAEb,MAAM,CAAC,YAAY,CAAC,gCAAgC,CAAC,GAAG;gBACpD,wBAAwB;gBACxB,EAAE;gBACF,0BAA0B;gBAC1B,EAAE;gBACF,iBAAiB;gBACjB,GAAG;gBACH,gCAAgC;gBAChC,GAAG;aACN,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAEb,IAAM,UAAU,GAAG;gBACf,MAAM,EAAE,qBAAqB;gBAC7B,QAAQ,EAAE,qBAAqB;aAClC,CAAC;YAEF,IAAM,OAAO,GAAG;gBACZ,UAAU,EAAE,CAAC,UAAU,CAAC;gBACxB,QAAQ,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,YAAY,CAAC;gBACnD,QAAQ,EAAE,IAAI,KAAK,EAAU;gBAC7B,iBAAiB,EAAE,KAAK;aAC3B,CAAC;YAEF,SAAS,CAAC,gBAAgB,GAAG,IAAI,cAAc,CAAC,qBAAqB,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;YACnG,SAAS,CAAC,gBAAgB,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;SACtF;QAED,OAAO,SAAS,CAAC,gBAAgB,CAAC;IACtC,CAAC;IAED,4BAA4B;IACb,0BAAgB,GAA6B,IAAI,CAAC;IACrE,gBAAC;CAAA,AA5PD,IA4PC;SA5PY,SAAS","sourcesContent":["import {\r\n IGLTFTechniqueParameter,\r\n EParameterType,\r\n ETextureWrapMode,\r\n IGLTFAccessor,\r\n ETextureFilterType,\r\n IGLTFRuntime,\r\n IGLTFBufferView,\r\n EComponentType,\r\n} from \"./glTFLoaderInterfaces\";\r\n\r\nimport { Nullable } from \"core/types\";\r\nimport { Vector2, Vector3, Vector4, Matrix } from \"core/Maths/math.vector\";\r\nimport { Color4 } from \"core/Maths/math.color\";\r\nimport { Effect } from \"core/Materials/effect\";\r\nimport { ShaderMaterial } from \"core/Materials/shaderMaterial\";\r\nimport { Texture } from \"core/Materials/Textures/texture\";\r\nimport { Node } from \"core/node\";\r\nimport { Scene } from \"core/scene\";\r\n\r\n/**\r\n * Utils functions for GLTF\r\n * @hidden\r\n */\r\nexport class GLTFUtils {\r\n /**\r\n * Sets the given \"parameter\" matrix\r\n * @param scene the Scene object\r\n * @param source the source node where to pick the matrix\r\n * @param parameter the GLTF technique parameter\r\n * @param uniformName the name of the shader's uniform\r\n * @param shaderMaterial the shader material\r\n */\r\n public static SetMatrix(scene: Scene, source: Node, parameter: IGLTFTechniqueParameter, uniformName: string, shaderMaterial: ShaderMaterial | Effect): void {\r\n let mat: Nullable<Matrix> = null;\r\n\r\n if (parameter.semantic === \"MODEL\") {\r\n mat = source.getWorldMatrix();\r\n } else if (parameter.semantic === \"PROJECTION\") {\r\n mat = scene.getProjectionMatrix();\r\n } else if (parameter.semantic === \"VIEW\") {\r\n mat = scene.getViewMatrix();\r\n } else if (parameter.semantic === \"MODELVIEWINVERSETRANSPOSE\") {\r\n mat = Matrix.Transpose(source.getWorldMatrix().multiply(scene.getViewMatrix()).invert());\r\n } else if (parameter.semantic === \"MODELVIEW\") {\r\n mat = source.getWorldMatrix().multiply(scene.getViewMatrix());\r\n } else if (parameter.semantic === \"MODELVIEWPROJECTION\") {\r\n mat = source.getWorldMatrix().multiply(scene.getTransformMatrix());\r\n } else if (parameter.semantic === \"MODELINVERSE\") {\r\n mat = source.getWorldMatrix().invert();\r\n } else if (parameter.semantic === \"VIEWINVERSE\") {\r\n mat = scene.getViewMatrix().invert();\r\n } else if (parameter.semantic === \"PROJECTIONINVERSE\") {\r\n mat = scene.getProjectionMatrix().invert();\r\n } else if (parameter.semantic === \"MODELVIEWINVERSE\") {\r\n mat = source.getWorldMatrix().multiply(scene.getViewMatrix()).invert();\r\n } else if (parameter.semantic === \"MODELVIEWPROJECTIONINVERSE\") {\r\n mat = source.getWorldMatrix().multiply(scene.getTransformMatrix()).invert();\r\n } else if (parameter.semantic === \"MODELINVERSETRANSPOSE\") {\r\n mat = Matrix.Transpose(source.getWorldMatrix().invert());\r\n }\r\n\r\n if (mat) {\r\n switch (parameter.type) {\r\n case EParameterType.FLOAT_MAT2:\r\n shaderMaterial.setMatrix2x2(uniformName, Matrix.GetAsMatrix2x2(mat));\r\n break;\r\n case EParameterType.FLOAT_MAT3:\r\n shaderMaterial.setMatrix3x3(uniformName, Matrix.GetAsMatrix3x3(mat));\r\n break;\r\n case EParameterType.FLOAT_MAT4:\r\n shaderMaterial.setMatrix(uniformName, mat);\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Sets the given \"parameter\" matrix\r\n * @param shaderMaterial the shader material\r\n * @param uniform the name of the shader's uniform\r\n * @param value the value of the uniform\r\n * @param type the uniform's type (EParameterType FLOAT, VEC2, VEC3 or VEC4)\r\n */\r\n public static SetUniform(shaderMaterial: ShaderMaterial | Effect, uniform: string, value: any, type: number): boolean {\r\n switch (type) {\r\n case EParameterType.FLOAT:\r\n shaderMaterial.setFloat(uniform, value);\r\n return true;\r\n case EParameterType.FLOAT_VEC2:\r\n shaderMaterial.setVector2(uniform, Vector2.FromArray(value));\r\n return true;\r\n case EParameterType.FLOAT_VEC3:\r\n shaderMaterial.setVector3(uniform, Vector3.FromArray(value));\r\n return true;\r\n case EParameterType.FLOAT_VEC4:\r\n shaderMaterial.setVector4(uniform, Vector4.FromArray(value));\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }\r\n\r\n /**\r\n * Returns the wrap mode of the texture\r\n * @param mode the mode value\r\n */\r\n public static GetWrapMode(mode: number): number {\r\n switch (mode) {\r\n case ETextureWrapMode.CLAMP_TO_EDGE:\r\n return Texture.CLAMP_ADDRESSMODE;\r\n case ETextureWrapMode.MIRRORED_REPEAT:\r\n return Texture.MIRROR_ADDRESSMODE;\r\n case ETextureWrapMode.REPEAT:\r\n return Texture.WRAP_ADDRESSMODE;\r\n default:\r\n return Texture.WRAP_ADDRESSMODE;\r\n }\r\n }\r\n\r\n /**\r\n * Returns the byte stride giving an accessor\r\n * @param accessor the GLTF accessor objet\r\n */\r\n public static GetByteStrideFromType(accessor: IGLTFAccessor): number {\r\n // Needs this function since \"byteStride\" isn't requiered in glTF format\r\n const type = accessor.type;\r\n\r\n switch (type) {\r\n case \"VEC2\":\r\n return 2;\r\n case \"VEC3\":\r\n return 3;\r\n case \"VEC4\":\r\n return 4;\r\n case \"MAT2\":\r\n return 4;\r\n case \"MAT3\":\r\n return 9;\r\n case \"MAT4\":\r\n return 16;\r\n default:\r\n return 1;\r\n }\r\n }\r\n\r\n /**\r\n * Returns the texture filter mode giving a mode value\r\n * @param mode the filter mode value\r\n */\r\n public static GetTextureFilterMode(mode: number): ETextureFilterType {\r\n switch (mode) {\r\n case ETextureFilterType.LINEAR:\r\n case ETextureFilterType.LINEAR_MIPMAP_NEAREST:\r\n case ETextureFilterType.LINEAR_MIPMAP_LINEAR:\r\n return Texture.TRILINEAR_SAMPLINGMODE;\r\n case ETextureFilterType.NEAREST:\r\n case ETextureFilterType.NEAREST_MIPMAP_NEAREST:\r\n return Texture.NEAREST_SAMPLINGMODE;\r\n default:\r\n return Texture.BILINEAR_SAMPLINGMODE;\r\n }\r\n }\r\n\r\n public static GetBufferFromBufferView(\r\n gltfRuntime: IGLTFRuntime,\r\n bufferView: IGLTFBufferView,\r\n byteOffset: number,\r\n byteLength: number,\r\n componentType: EComponentType\r\n ): ArrayBufferView {\r\n byteOffset = bufferView.byteOffset + byteOffset;\r\n\r\n const loadedBufferView = gltfRuntime.loadedBufferViews[bufferView.buffer];\r\n if (byteOffset + byteLength > loadedBufferView.byteLength) {\r\n throw new Error(\"Buffer access is out of range\");\r\n }\r\n\r\n const buffer = loadedBufferView.buffer;\r\n byteOffset += loadedBufferView.byteOffset;\r\n\r\n switch (componentType) {\r\n case EComponentType.BYTE:\r\n return new Int8Array(buffer, byteOffset, byteLength);\r\n case EComponentType.UNSIGNED_BYTE:\r\n return new Uint8Array(buffer, byteOffset, byteLength);\r\n case EComponentType.SHORT:\r\n return new Int16Array(buffer, byteOffset, byteLength);\r\n case EComponentType.UNSIGNED_SHORT:\r\n return new Uint16Array(buffer, byteOffset, byteLength);\r\n default:\r\n return new Float32Array(buffer, byteOffset, byteLength);\r\n }\r\n }\r\n\r\n /**\r\n * Returns a buffer from its accessor\r\n * @param gltfRuntime the GLTF runtime\r\n * @param accessor the GLTF accessor\r\n */\r\n public static GetBufferFromAccessor(gltfRuntime: IGLTFRuntime, accessor: IGLTFAccessor): any {\r\n const bufferView: IGLTFBufferView = gltfRuntime.bufferViews[accessor.bufferView];\r\n const byteLength = accessor.count * GLTFUtils.GetByteStrideFromType(accessor);\r\n return GLTFUtils.GetBufferFromBufferView(gltfRuntime, bufferView, accessor.byteOffset, byteLength, accessor.componentType);\r\n }\r\n\r\n /**\r\n * Decodes a buffer view into a string\r\n * @param view the buffer view\r\n */\r\n public static DecodeBufferToText(view: ArrayBufferView): string {\r\n let result = \"\";\r\n const length = view.byteLength;\r\n\r\n for (let i = 0; i < length; ++i) {\r\n result += String.fromCharCode((<any>view)[i]);\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns the default material of gltf. Related to\r\n * https://github.com/KhronosGroup/glTF/tree/master/specification/1.0#appendix-a-default-material\r\n * @param scene the Babylon.js scene\r\n */\r\n public static GetDefaultMaterial(scene: Scene): ShaderMaterial {\r\n if (!GLTFUtils._DefaultMaterial) {\r\n Effect.ShadersStore[\"GLTFDefaultMaterialVertexShader\"] = [\r\n \"precision highp float;\",\r\n \"\",\r\n \"uniform mat4 worldView;\",\r\n \"uniform mat4 projection;\",\r\n \"\",\r\n \"attribute vec3 position;\",\r\n \"\",\r\n \"void main(void)\",\r\n \"{\",\r\n \" gl_Position = projection * worldView * vec4(position, 1.0);\",\r\n \"}\",\r\n ].join(\"\\n\");\r\n\r\n Effect.ShadersStore[\"GLTFDefaultMaterialPixelShader\"] = [\r\n \"precision highp float;\",\r\n \"\",\r\n \"uniform vec4 u_emission;\",\r\n \"\",\r\n \"void main(void)\",\r\n \"{\",\r\n \" gl_FragColor = u_emission;\",\r\n \"}\",\r\n ].join(\"\\n\");\r\n\r\n const shaderPath = {\r\n vertex: \"GLTFDefaultMaterial\",\r\n fragment: \"GLTFDefaultMaterial\",\r\n };\r\n\r\n const options = {\r\n attributes: [\"position\"],\r\n uniforms: [\"worldView\", \"projection\", \"u_emission\"],\r\n samplers: new Array<string>(),\r\n needAlphaBlending: false,\r\n };\r\n\r\n GLTFUtils._DefaultMaterial = new ShaderMaterial(\"GLTFDefaultMaterial\", scene, shaderPath, options);\r\n GLTFUtils._DefaultMaterial.setColor4(\"u_emission\", new Color4(0.5, 0.5, 0.5, 1.0));\r\n }\r\n\r\n return GLTFUtils._DefaultMaterial;\r\n }\r\n\r\n // The GLTF default material\r\n private static _DefaultMaterial: Nullable<ShaderMaterial> = null;\r\n}\r\n"]}
@@ -1,10 +1,10 @@
1
1
  import { GLTFLoaderExtension } from "./glTFLoader";
2
2
  import { IGLTFRuntime } from "./glTFLoaderInterfaces";
3
- import { Material } from "@babylonjs/core/Materials/material";
3
+ import { Material } from "@babylonjs/core/Materials/material.js";
4
4
  /** @hidden */
5
5
  export declare class GLTFMaterialsCommonExtension extends GLTFLoaderExtension {
6
6
  constructor();
7
- loadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: (message: string) => void): boolean;
7
+ loadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime): boolean;
8
8
  loadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): boolean;
9
9
  private _loadTexture;
10
10
  }
@@ -1,8 +1,7 @@
1
1
  import { __extends } from "tslib";
2
- import { GLTFLoaderExtension } from "./glTFLoader.js";
3
- import { GLTFLoaderBase } from "./glTFLoader.js";
2
+ import { GLTFLoaderExtension, GLTFLoaderBase, GLTFLoader } from "./glTFLoader.js";
4
3
  import { Vector3 } from "@babylonjs/core/Maths/math.vector.js";
5
- import { Color3 } from '@babylonjs/core/Maths/math.color.js';
4
+ import { Color3 } from "@babylonjs/core/Maths/math.color.js";
6
5
  import { Tools } from "@babylonjs/core/Misc/tools.js";
7
6
  import { Material } from "@babylonjs/core/Materials/material.js";
8
7
  import { StandardMaterial } from "@babylonjs/core/Materials/standardMaterial.js";
@@ -10,14 +9,13 @@ import { HemisphericLight } from "@babylonjs/core/Lights/hemisphericLight.js";
10
9
  import { DirectionalLight } from "@babylonjs/core/Lights/directionalLight.js";
11
10
  import { PointLight } from "@babylonjs/core/Lights/pointLight.js";
12
11
  import { SpotLight } from "@babylonjs/core/Lights/spotLight.js";
13
- import { GLTFLoader } from "./glTFLoader.js";
14
12
  /** @hidden */
15
13
  var GLTFMaterialsCommonExtension = /** @class */ (function (_super) {
16
14
  __extends(GLTFMaterialsCommonExtension, _super);
17
15
  function GLTFMaterialsCommonExtension() {
18
16
  return _super.call(this, "KHR_materials_common") || this;
19
17
  }
20
- GLTFMaterialsCommonExtension.prototype.loadRuntimeExtensionsAsync = function (gltfRuntime, onSuccess, onError) {
18
+ GLTFMaterialsCommonExtension.prototype.loadRuntimeExtensionsAsync = function (gltfRuntime) {
21
19
  if (!gltfRuntime.extensions) {
22
20
  return false;
23
21
  }
@@ -31,36 +29,40 @@ var GLTFMaterialsCommonExtension = /** @class */ (function (_super) {
31
29
  for (var thing in lights) {
32
30
  var light = lights[thing];
33
31
  switch (light.type) {
34
- case "ambient":
32
+ case "ambient": {
35
33
  var ambientLight = new HemisphericLight(light.name, new Vector3(0, 1, 0), gltfRuntime.scene);
36
34
  var ambient = light.ambient;
37
35
  if (ambient) {
38
36
  ambientLight.diffuse = Color3.FromArray(ambient.color || [1, 1, 1]);
39
37
  }
40
38
  break;
41
- case "point":
39
+ }
40
+ case "point": {
42
41
  var pointLight = new PointLight(light.name, new Vector3(10, 10, 10), gltfRuntime.scene);
43
42
  var point = light.point;
44
43
  if (point) {
45
44
  pointLight.diffuse = Color3.FromArray(point.color || [1, 1, 1]);
46
45
  }
47
46
  break;
48
- case "directional":
47
+ }
48
+ case "directional": {
49
49
  var dirLight = new DirectionalLight(light.name, new Vector3(0, -1, 0), gltfRuntime.scene);
50
50
  var directional = light.directional;
51
51
  if (directional) {
52
52
  dirLight.diffuse = Color3.FromArray(directional.color || [1, 1, 1]);
53
53
  }
54
54
  break;
55
- case "spot":
55
+ }
56
+ case "spot": {
56
57
  var spot = light.spot;
57
58
  if (spot) {
58
59
  var spotLight = new SpotLight(light.name, new Vector3(0, 10, 0), new Vector3(0, -1, 0), spot.fallOffAngle || Math.PI, spot.fallOffExponent || 0.0, gltfRuntime.scene);
59
60
  spotLight.diffuse = Color3.FromArray(spot.color || [1, 1, 1]);
60
61
  }
61
62
  break;
63
+ }
62
64
  default:
63
- Tools.Warn("GLTF Material Common extension: light type \"" + light.type + "\” not supported");
65
+ Tools.Warn('GLTF Material Common extension: light type "' + light.type + " not supported");
64
66
  break;
65
67
  }
66
68
  }
@@ -118,7 +120,7 @@ var GLTFMaterialsCommonExtension = /** @class */ (function (_super) {
118
120
  // Create buffer from texture url
119
121
  GLTFLoaderBase.LoadTextureBufferAsync(gltfRuntime, id, function (buffer) {
120
122
  // Create texture from buffer
121
- GLTFLoaderBase.CreateTextureAsync(gltfRuntime, id, buffer, function (texture) { return material[propertyPath] = texture; }, onError);
123
+ GLTFLoaderBase.CreateTextureAsync(gltfRuntime, id, buffer, function (texture) { return (material[propertyPath] = texture); });
122
124
  }, onError);
123
125
  };
124
126
  return GLTFMaterialsCommonExtension;