|
@@ -418,10 +418,10 @@ const EXTENSIONS = {
|
|
};
|
|
};
|
|
|
|
|
|
/**
|
|
/**
|
|
- * Punctual Lights Extension
|
|
|
|
- *
|
|
|
|
- * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_lights_punctual
|
|
|
|
- */
|
|
|
|
|
|
+ * Punctual Lights Extension
|
|
|
|
+ *
|
|
|
|
+ * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_lights_punctual
|
|
|
|
+ */
|
|
class GLTFLightsExtension {
|
|
class GLTFLightsExtension {
|
|
|
|
|
|
constructor( parser ) {
|
|
constructor( parser ) {
|
|
@@ -546,10 +546,10 @@ class GLTFLightsExtension {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * Unlit Materials Extension
|
|
|
|
- *
|
|
|
|
- * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit
|
|
|
|
- */
|
|
|
|
|
|
+ * Unlit Materials Extension
|
|
|
|
+ *
|
|
|
|
+ * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit
|
|
|
|
+ */
|
|
class GLTFMaterialsUnlitExtension {
|
|
class GLTFMaterialsUnlitExtension {
|
|
|
|
|
|
constructor() {
|
|
constructor() {
|
|
@@ -599,10 +599,10 @@ class GLTFMaterialsUnlitExtension {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * Clearcoat Materials Extension
|
|
|
|
- *
|
|
|
|
- * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_clearcoat
|
|
|
|
- */
|
|
|
|
|
|
+ * Clearcoat Materials Extension
|
|
|
|
+ *
|
|
|
|
+ * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_clearcoat
|
|
|
|
+ */
|
|
class GLTFMaterialsClearcoatExtension {
|
|
class GLTFMaterialsClearcoatExtension {
|
|
|
|
|
|
constructor( parser ) {
|
|
constructor( parser ) {
|
|
@@ -684,11 +684,11 @@ class GLTFMaterialsClearcoatExtension {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * Transmission Materials Extension
|
|
|
|
- *
|
|
|
|
- * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_transmission
|
|
|
|
- * Draft: https://github.com/KhronosGroup/glTF/pull/1698
|
|
|
|
- */
|
|
|
|
|
|
+ * Transmission Materials Extension
|
|
|
|
+ *
|
|
|
|
+ * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_transmission
|
|
|
|
+ * Draft: https://github.com/KhronosGroup/glTF/pull/1698
|
|
|
|
+ */
|
|
class GLTFMaterialsTransmissionExtension {
|
|
class GLTFMaterialsTransmissionExtension {
|
|
|
|
|
|
constructor( parser ) {
|
|
constructor( parser ) {
|
|
@@ -743,10 +743,10 @@ class GLTFMaterialsTransmissionExtension {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * BasisU Texture Extension
|
|
|
|
- *
|
|
|
|
- * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu
|
|
|
|
- */
|
|
|
|
|
|
+ * BasisU Texture Extension
|
|
|
|
+ *
|
|
|
|
+ * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu
|
|
|
|
+ */
|
|
class GLTFTextureBasisUExtension {
|
|
class GLTFTextureBasisUExtension {
|
|
|
|
|
|
constructor( parser ) {
|
|
constructor( parser ) {
|
|
@@ -795,10 +795,10 @@ class GLTFTextureBasisUExtension {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * WebP Texture Extension
|
|
|
|
- *
|
|
|
|
- * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_texture_webp
|
|
|
|
- */
|
|
|
|
|
|
+ * WebP Texture Extension
|
|
|
|
+ *
|
|
|
|
+ * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_texture_webp
|
|
|
|
+ */
|
|
class GLTFTextureWebPExtension {
|
|
class GLTFTextureWebPExtension {
|
|
|
|
|
|
constructor( parser ) {
|
|
constructor( parser ) {
|
|
@@ -880,10 +880,10 @@ class GLTFTextureWebPExtension {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * meshopt BufferView Compression Extension
|
|
|
|
- *
|
|
|
|
- * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_meshopt_compression
|
|
|
|
- */
|
|
|
|
|
|
+ * meshopt BufferView Compression Extension
|
|
|
|
+ *
|
|
|
|
+ * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_meshopt_compression
|
|
|
|
+ */
|
|
class GLTFMeshoptCompression {
|
|
class GLTFMeshoptCompression {
|
|
|
|
|
|
constructor( parser ) {
|
|
constructor( parser ) {
|
|
@@ -1018,10 +1018,10 @@ class GLTFBinaryExtension {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * DRACO Mesh Compression Extension
|
|
|
|
- *
|
|
|
|
- * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression
|
|
|
|
- */
|
|
|
|
|
|
+ * DRACO Mesh Compression Extension
|
|
|
|
+ *
|
|
|
|
+ * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression
|
|
|
|
+ */
|
|
class GLTFDracoMeshCompressionExtension {
|
|
class GLTFDracoMeshCompressionExtension {
|
|
|
|
|
|
constructor( json, dracoLoader ) {
|
|
constructor( json, dracoLoader ) {
|
|
@@ -1101,10 +1101,10 @@ class GLTFDracoMeshCompressionExtension {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * Texture Transform Extension
|
|
|
|
- *
|
|
|
|
- * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_transform
|
|
|
|
- */
|
|
|
|
|
|
+ * Texture Transform Extension
|
|
|
|
+ *
|
|
|
|
+ * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_transform
|
|
|
|
+ */
|
|
class GLTFTextureTransformExtension {
|
|
class GLTFTextureTransformExtension {
|
|
|
|
|
|
constructor() {
|
|
constructor() {
|
|
@@ -1150,17 +1150,16 @@ class GLTFTextureTransformExtension {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * Specular-Glossiness Extension
|
|
|
|
- *
|
|
|
|
- * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness
|
|
|
|
- */
|
|
|
|
|
|
+ * Specular-Glossiness Extension
|
|
|
|
+ *
|
|
|
|
+ * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness
|
|
|
|
+ */
|
|
|
|
|
|
/**
|
|
/**
|
|
- * A sub class of StandardMaterial with some of the functionality
|
|
|
|
- * changed via the `onBeforeCompile` callback
|
|
|
|
- * @pailhead
|
|
|
|
- */
|
|
|
|
-
|
|
|
|
|
|
+ * A sub class of StandardMaterial with some of the functionality
|
|
|
|
+ * changed via the `onBeforeCompile` callback
|
|
|
|
+ * @pailhead
|
|
|
|
+ */
|
|
class GLTFMeshStandardSGMaterial extends MeshStandardMaterial {
|
|
class GLTFMeshStandardSGMaterial extends MeshStandardMaterial {
|
|
|
|
|
|
constructor( params ) {
|
|
constructor( params ) {
|
|
@@ -1484,10 +1483,10 @@ class GLTFMaterialsPbrSpecularGlossinessExtension {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * Mesh Quantization Extension
|
|
|
|
- *
|
|
|
|
- * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization
|
|
|
|
- */
|
|
|
|
|
|
+ * Mesh Quantization Extension
|
|
|
|
+ *
|
|
|
|
+ * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization
|
|
|
|
+ */
|
|
class GLTFMeshQuantizationExtension {
|
|
class GLTFMeshQuantizationExtension {
|
|
|
|
|
|
constructor() {
|
|
constructor() {
|
|
@@ -1700,8 +1699,8 @@ function resolveURL( url, path ) {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#default-material
|
|
|
|
- */
|
|
|
|
|
|
+ * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#default-material
|
|
|
|
+ */
|
|
function createDefaultMaterial( cache ) {
|
|
function createDefaultMaterial( cache ) {
|
|
|
|
|
|
if ( cache[ 'DefaultMaterial' ] === undefined ) {
|
|
if ( cache[ 'DefaultMaterial' ] === undefined ) {
|
|
@@ -1740,9 +1739,9 @@ function addUnknownExtensionsToUserData( knownExtensions, object, objectDef ) {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * @param {Object3D|Material|BufferGeometry} object
|
|
|
|
- * @param {GLTF.definition} gltfDef
|
|
|
|
- */
|
|
|
|
|
|
+ * @param {Object3D|Material|BufferGeometry} object
|
|
|
|
+ * @param {GLTF.definition} gltfDef
|
|
|
|
+ */
|
|
function assignExtrasToUserData( object, gltfDef ) {
|
|
function assignExtrasToUserData( object, gltfDef ) {
|
|
|
|
|
|
if ( gltfDef.extras !== undefined ) {
|
|
if ( gltfDef.extras !== undefined ) {
|
|
@@ -1762,13 +1761,13 @@ function assignExtrasToUserData( object, gltfDef ) {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#morph-targets
|
|
|
|
- *
|
|
|
|
- * @param {BufferGeometry} geometry
|
|
|
|
- * @param {Array<GLTF.Target>} targets
|
|
|
|
- * @param {GLTFParser} parser
|
|
|
|
- * @return {Promise<BufferGeometry>}
|
|
|
|
- */
|
|
|
|
|
|
+ * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#morph-targets
|
|
|
|
+ *
|
|
|
|
+ * @param {BufferGeometry} geometry
|
|
|
|
+ * @param {Array<GLTF.Target>} targets
|
|
|
|
+ * @param {GLTFParser} parser
|
|
|
|
+ * @return {Promise<BufferGeometry>}
|
|
|
|
+ */
|
|
function addMorphTargets( geometry, targets, parser ) {
|
|
function addMorphTargets( geometry, targets, parser ) {
|
|
|
|
|
|
let hasMorphPosition = false;
|
|
let hasMorphPosition = false;
|
|
@@ -1835,9 +1834,9 @@ function addMorphTargets( geometry, targets, parser ) {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * @param {Mesh} mesh
|
|
|
|
- * @param {GLTF.Mesh} meshDef
|
|
|
|
- */
|
|
|
|
|
|
+ * @param {Mesh} mesh
|
|
|
|
+ * @param {GLTF.Mesh} meshDef
|
|
|
|
+ */
|
|
function updateMorphTargets( mesh, meshDef ) {
|
|
function updateMorphTargets( mesh, meshDef ) {
|
|
|
|
|
|
mesh.updateMorphTargets();
|
|
mesh.updateMorphTargets();
|