super-three 0.133.2 → 0.135.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/three.js +619 -538
- package/build/three.min.js +1 -1
- package/build/three.module.js +763 -616
- package/examples/fonts/open-sans/open-sans-v15-cyrillic-ext_greek_greek-ext_cyrillic_latin_latin-ext_vietnamese-regular.woff +0 -0
- package/examples/fonts/open-sans/open-sans-v15-cyrillic-ext_greek_greek-ext_cyrillic_latin_latin-ext_vietnamese-regular.woff2 +0 -0
- package/examples/fonts/open-sans/open-sans.css +9 -0
- package/examples/fonts/tabler-icons/fonts/tabler-icons.eot +0 -0
- package/examples/fonts/tabler-icons/fonts/tabler-icons.ttf +0 -0
- package/examples/fonts/tabler-icons/fonts/tabler-icons.woff +0 -0
- package/examples/fonts/tabler-icons/fonts/tabler-icons.woff2 +0 -0
- package/examples/fonts/tabler-icons/tabler-icons.min.css +4 -0
- package/examples/js/controls/ArcballControls.js +68 -27
- package/examples/js/controls/DragControls.js +7 -0
- package/examples/js/controls/OrbitControls.js +5 -36
- package/examples/js/controls/TrackballControls.js +3 -2
- package/examples/js/csm/CSM.js +2 -2
- package/examples/js/csm/CSMFrustum.js +133 -0
- package/examples/js/exporters/GLTFExporter.js +147 -63
- package/examples/js/exporters/USDZExporter.js +45 -26
- package/examples/js/lines/LineMaterial.js +58 -20
- package/examples/js/lines/LineSegments2.js +29 -24
- package/examples/js/loaders/3DMLoader.js +24 -11
- package/examples/js/loaders/3MFLoader.js +2 -2
- package/examples/js/loaders/ColladaLoader.js +61 -3
- package/examples/js/loaders/FBXLoader.js +1 -1
- package/examples/js/loaders/GLTFLoader.js +94 -31
- package/examples/js/loaders/KTX2Loader.js +12 -0
- package/examples/js/loaders/LWOLoader.js +8 -6
- package/examples/js/loaders/LogLuvLoader.js +766 -0
- package/examples/js/loaders/PLYLoader.js +32 -7
- package/examples/js/loaders/RGBELoader.js +2 -1
- package/examples/js/loaders/SVGLoader.js +7 -3
- package/examples/js/loaders/TDSLoader.js +237 -271
- package/examples/js/loaders/lwo/LWO2Parser.js +1 -0
- package/examples/js/loaders/lwo/LWO3Parser.js +4 -2
- package/examples/js/objects/MarchingCubes.js +42 -128
- package/examples/js/renderers/CSS2DRenderer.js +4 -4
- package/examples/js/renderers/CSS3DRenderer.js +4 -4
- package/examples/js/utils/RoughnessMipmapper.js +1 -0
- package/examples/jsm/controls/ArcballControls.js +61 -29
- package/examples/jsm/controls/DragControls.js +7 -0
- package/examples/jsm/controls/OrbitControls.js +9 -51
- package/examples/jsm/controls/TrackballControls.js +1 -1
- package/examples/jsm/csm/CSM.js +3 -3
- package/examples/jsm/csm/{Frustum.js → CSMFrustum.js} +3 -3
- package/examples/jsm/exporters/GLTFExporter.js +160 -74
- package/examples/jsm/exporters/USDZExporter.js +47 -26
- package/examples/jsm/libs/flow.module.js +3218 -0
- package/examples/jsm/libs/lil-gui.module.min.js +8 -0
- package/examples/jsm/libs/rhino3dm/rhino3dm.wasm +0 -0
- package/examples/jsm/lines/LineMaterial.js +59 -23
- package/examples/jsm/lines/LineSegments2.js +22 -18
- package/examples/jsm/loaders/3DMLoader.js +18 -12
- package/examples/jsm/loaders/3MFLoader.js +2 -2
- package/examples/jsm/loaders/ColladaLoader.js +61 -3
- package/examples/jsm/loaders/FBXLoader.js +1 -1
- package/examples/jsm/loaders/GLTFLoader.js +99 -35
- package/examples/jsm/loaders/KTX2Loader.js +19 -0
- package/examples/jsm/loaders/LWOLoader.js +8 -6
- package/examples/jsm/loaders/LogLuvLoader.js +606 -0
- package/examples/jsm/loaders/PLYLoader.js +33 -7
- package/examples/jsm/loaders/SVGLoader.js +7 -4
- package/examples/jsm/loaders/TDSLoader.js +225 -285
- package/examples/jsm/loaders/lwo/LWO2Parser.js +1 -0
- package/examples/jsm/loaders/lwo/LWO3Parser.js +2 -2
- package/examples/jsm/node-editor/NodeEditor.js +455 -0
- package/examples/jsm/node-editor/accessors/NormalEditor.js +30 -0
- package/examples/jsm/node-editor/accessors/PositionEditor.js +30 -0
- package/examples/jsm/node-editor/accessors/UVEditor.js +26 -0
- package/examples/jsm/node-editor/display/BlendEditor.js +43 -0
- package/examples/jsm/node-editor/examples/animate-uv.json +1 -0
- package/examples/jsm/node-editor/examples/fake-top-light.json +1 -0
- package/examples/jsm/node-editor/examples/oscillator-color.json +1 -0
- package/examples/jsm/node-editor/examples/rim.json +1 -0
- package/examples/jsm/node-editor/inputs/ColorEditor.js +91 -0
- package/examples/jsm/node-editor/inputs/FloatEditor.js +24 -0
- package/examples/jsm/node-editor/inputs/SliderEditor.js +68 -0
- package/examples/jsm/node-editor/inputs/Vector2Editor.js +28 -0
- package/examples/jsm/node-editor/inputs/Vector3Editor.js +30 -0
- package/examples/jsm/node-editor/inputs/Vector4Editor.js +37 -0
- package/examples/jsm/node-editor/materials/StandardMaterialEditor.js +69 -0
- package/examples/jsm/node-editor/math/DotEditor.js +36 -0
- package/examples/jsm/node-editor/math/InvertEditor.js +38 -0
- package/examples/jsm/node-editor/math/LimiterEditor.js +48 -0
- package/examples/jsm/node-editor/math/NormalizeEditor.js +26 -0
- package/examples/jsm/node-editor/math/OperatorEditor.js +50 -0
- package/examples/jsm/node-editor/math/PowerEditor.js +34 -0
- package/examples/jsm/node-editor/math/TrigonometryEditor.js +39 -0
- package/examples/jsm/node-editor/procedural/CheckerEditor.js +26 -0
- package/examples/jsm/node-editor/utils/OscillatorEditor.js +42 -0
- package/examples/jsm/node-editor/utils/TimerEditor.js +57 -0
- package/examples/jsm/nodes/materials/StandardNodeMaterial.js +1 -1
- package/examples/jsm/nodes/materials/nodes/StandardNode.js +6 -6
- package/examples/jsm/nodes/utils/ColorSpaceNode.js +1 -49
- package/examples/jsm/objects/MarchingCubes.js +46 -152
- package/examples/jsm/postprocessing/AdaptiveToneMappingPass.js +1 -1
- package/examples/jsm/postprocessing/AfterimagePass.js +1 -1
- package/examples/jsm/postprocessing/BloomPass.js +1 -1
- package/examples/jsm/postprocessing/BokehPass.js +1 -1
- package/examples/jsm/postprocessing/ClearPass.js +1 -1
- package/examples/jsm/postprocessing/CubeTexturePass.js +1 -1
- package/examples/jsm/postprocessing/DotScreenPass.js +1 -1
- package/examples/jsm/postprocessing/EffectComposer.js +3 -3
- package/examples/jsm/postprocessing/FilmPass.js +1 -1
- package/examples/jsm/postprocessing/GlitchPass.js +1 -1
- package/examples/jsm/postprocessing/HalftonePass.js +1 -1
- package/examples/jsm/postprocessing/MaskPass.js +1 -1
- package/examples/jsm/postprocessing/OutlinePass.js +1 -1
- package/examples/jsm/postprocessing/RenderPass.js +1 -1
- package/examples/jsm/postprocessing/SAOPass.js +1 -1
- package/examples/jsm/postprocessing/SMAAPass.js +1 -1
- package/examples/jsm/postprocessing/SSAARenderPass.js +1 -1
- package/examples/jsm/postprocessing/SSAOPass.js +1 -1
- package/examples/jsm/postprocessing/SSRPass.js +1 -1
- package/examples/jsm/postprocessing/SSRrPass.js +1 -1
- package/examples/jsm/postprocessing/SavePass.js +1 -1
- package/examples/jsm/postprocessing/ShaderPass.js +1 -1
- package/examples/jsm/postprocessing/TAARenderPass.js +1 -1
- package/examples/jsm/postprocessing/TexturePass.js +1 -1
- package/examples/jsm/postprocessing/UnrealBloomPass.js +1 -1
- package/examples/jsm/renderers/CSS2DRenderer.js +5 -4
- package/examples/jsm/renderers/CSS3DRenderer.js +5 -4
- package/examples/jsm/renderers/nodes/Nodes.js +14 -13
- package/examples/jsm/renderers/nodes/ShaderNode.js +193 -41
- package/examples/jsm/renderers/nodes/accessors/MaterialNode.js +6 -6
- package/examples/jsm/renderers/nodes/accessors/ModelViewProjectionNode.js +5 -5
- package/examples/jsm/renderers/nodes/accessors/NormalNode.js +14 -3
- package/examples/jsm/renderers/nodes/accessors/PointUVNode.js +3 -3
- package/examples/jsm/renderers/nodes/accessors/PositionNode.js +15 -5
- package/examples/jsm/renderers/nodes/accessors/SkinningNode.js +107 -0
- package/examples/jsm/renderers/nodes/accessors/UVNode.js +7 -5
- package/examples/jsm/renderers/nodes/core/ArrayInputNode.js +3 -3
- package/examples/jsm/renderers/nodes/core/AttributeNode.js +6 -0
- package/examples/jsm/renderers/nodes/core/BypassNode.js +38 -0
- package/examples/jsm/renderers/nodes/core/CodeNode.js +3 -3
- package/examples/jsm/renderers/nodes/core/ContextNode.js +4 -19
- package/examples/jsm/renderers/nodes/core/ExpressionNode.js +13 -2
- package/examples/jsm/renderers/nodes/core/FunctionNode.js +19 -132
- package/examples/jsm/renderers/nodes/core/InputNode.js +13 -3
- package/examples/jsm/renderers/nodes/core/Node.js +32 -10
- package/examples/jsm/renderers/nodes/core/NodeBuilder.js +146 -128
- package/examples/jsm/renderers/nodes/core/NodeFunction.js +22 -0
- package/examples/jsm/renderers/nodes/core/NodeFunctionInput.js +4 -4
- package/examples/jsm/renderers/nodes/core/NodeKeywords.js +18 -179
- package/examples/jsm/renderers/nodes/core/NodeParser.js +11 -0
- package/examples/jsm/renderers/nodes/core/NodeVar.js +2 -2
- package/examples/jsm/renderers/nodes/core/PropertyNode.js +14 -2
- package/examples/jsm/renderers/nodes/core/TempNode.js +10 -13
- package/examples/jsm/renderers/nodes/core/VarNode.js +12 -7
- package/examples/jsm/renderers/nodes/core/VaryNode.js +23 -8
- package/examples/jsm/renderers/nodes/core/constants.js +2 -0
- package/examples/jsm/renderers/nodes/display/ColorSpaceNode.js +47 -25
- package/examples/jsm/renderers/nodes/display/NormalMapNode.js +21 -22
- package/examples/jsm/renderers/nodes/functions/BSDFs.js +64 -101
- package/examples/jsm/renderers/nodes/inputs/BufferNode.js +25 -0
- package/examples/jsm/renderers/nodes/inputs/IntNode.js +17 -0
- package/examples/jsm/renderers/nodes/inputs/TextureNode.js +10 -2
- package/examples/jsm/renderers/nodes/lights/LightContextNode.js +20 -14
- package/examples/jsm/renderers/nodes/lights/LightNode.js +32 -36
- package/examples/jsm/renderers/nodes/math/CondNode.js +60 -0
- package/examples/jsm/renderers/nodes/math/MathNode.js +87 -36
- package/examples/jsm/renderers/nodes/math/OperatorNode.js +124 -31
- package/examples/jsm/renderers/nodes/parsers/GLSLNodeFunction.js +137 -0
- package/examples/jsm/renderers/nodes/parsers/GLSLNodeParser.js +14 -0
- package/examples/jsm/renderers/nodes/parsers/WGSLNodeFunction.js +89 -0
- package/examples/jsm/renderers/nodes/parsers/WGSLNodeParser.js +14 -0
- package/examples/jsm/renderers/nodes/procedural/CheckerNode.js +7 -9
- package/examples/jsm/renderers/nodes/utils/ArrayElementNode.js +31 -0
- package/examples/jsm/renderers/nodes/utils/ConvertNode.js +33 -0
- package/examples/jsm/renderers/nodes/utils/JoinNode.js +7 -7
- package/examples/jsm/renderers/nodes/utils/OscNode.js +58 -0
- package/examples/jsm/renderers/nodes/utils/SplitNode.js +18 -8
- package/examples/jsm/renderers/nodes/utils/SpriteSheetUVNode.js +7 -7
- package/examples/jsm/renderers/webgl/nodes/SlotNode.js +22 -0
- package/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.js +191 -94
- package/examples/jsm/renderers/webgl/nodes/WebGLNodes.js +2 -2
- package/examples/jsm/renderers/webgl/nodes/WebGLPhysicalContextNode.js +2 -2
- package/examples/jsm/renderers/webgpu/WebGPUBackground.js +1 -1
- package/examples/jsm/renderers/webgpu/WebGPUBindings.js +3 -3
- package/examples/jsm/renderers/webgpu/WebGPUComputePipelines.js +2 -4
- package/examples/jsm/renderers/webgpu/WebGPUProgrammableStage.js +2 -4
- package/examples/jsm/renderers/webgpu/WebGPURenderPipeline.js +15 -23
- package/examples/jsm/renderers/webgpu/WebGPURenderPipelines.js +3 -5
- package/examples/jsm/renderers/webgpu/WebGPURenderer.js +11 -27
- package/examples/jsm/renderers/webgpu/WebGPUTextureUtils.js +62 -28
- package/examples/jsm/renderers/webgpu/WebGPUTextures.js +34 -27
- package/examples/jsm/renderers/webgpu/constants.js +2 -2
- package/examples/jsm/renderers/webgpu/nodes/WebGPUNodeBuilder.js +430 -98
- package/examples/jsm/renderers/webgpu/nodes/WebGPUNodes.js +1 -1
- package/examples/jsm/utils/RoughnessMipmapper.js +1 -0
- package/examples/jsm/webxr/OculusHandPointerModel.js +6 -6
- package/package.json +10 -10
- package/src/Three.Legacy.js +6 -0
- package/src/Three.js +0 -1
- package/src/cameras/StereoCamera.js +8 -7
- package/src/constants.js +1 -2
- package/src/core/Layers.js +7 -1
- package/src/core/Object3D.js +2 -0
- package/src/extras/PMREMGenerator.js +11 -6
- package/src/loaders/FileLoader.js +89 -152
- package/src/loaders/ImageLoader.js +9 -4
- package/src/loaders/LoaderUtils.js +26 -0
- package/src/loaders/MaterialLoader.js +7 -4
- package/src/loaders/ObjectLoader.js +2 -0
- package/src/materials/Material.js +4 -4
- package/src/materials/MeshPhysicalMaterial.js +20 -14
- package/src/math/MathUtils.js +5 -16
- package/src/renderers/WebGLMultisampleRenderTarget.js +7 -1
- package/src/renderers/WebGLRenderer.js +83 -117
- package/src/renderers/shaders/ShaderChunk/bsdfs.glsl.js +2 -2
- package/src/renderers/shaders/ShaderChunk/encodings_pars_fragment.glsl.js +0 -27
- package/src/renderers/shaders/ShaderChunk/envmap_common_pars_fragment.glsl.js +0 -1
- package/src/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl.js +19 -6
- package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +2 -2
- package/src/renderers/shaders/ShaderChunk/transmission_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/transmission_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +13 -5
- package/src/renderers/shaders/ShaderLib/vsm.glsl.js +2 -1
- package/src/renderers/shaders/ShaderLib.js +6 -4
- package/src/renderers/shaders/UniformsLib.js +1 -2
- package/src/renderers/webgl/WebGLExtensions.js +1 -0
- package/src/renderers/webgl/WebGLMaterials.js +27 -15
- package/src/renderers/webgl/WebGLProgram.js +10 -6
- package/src/renderers/webgl/WebGLPrograms.js +17 -12
- package/src/renderers/webgl/WebGLShadowMap.js +14 -5
- package/src/renderers/webgl/WebGLState.js +31 -17
- package/src/renderers/webgl/WebGLTextures.js +188 -51
- package/src/renderers/webgl/WebGLUniforms.js +45 -1
- package/src/renderers/webxr/WebXRManager.js +71 -110
- package/src/textures/Texture.js +6 -0
- package/src/utils.js +37 -1
- package/examples/js/controls/DeviceOrientationControls.js +0 -147
- package/examples/js/libs/dat.gui.min.js +0 -14
- package/examples/jsm/controls/DeviceOrientationControls.js +0 -153
- package/examples/jsm/libs/dat.gui.module.js +0 -3575
- package/examples/jsm/libs/glslang.js +0 -78
- package/examples/jsm/libs/glslang.wasm +0 -0
- package/examples/jsm/renderers/nodes/consts/MathConsts.js +0 -7
- package/examples/jsm/renderers/nodes/core/ConstNode.js +0 -39
- package/examples/jsm/renderers/nodes/core/NodeSlot.js +0 -13
- package/examples/jsm/renderers/nodes/core/StructNode.js +0 -80
- package/examples/jsm/renderers/nodes/core/StructVarNode.js +0 -75
- package/examples/jsm/renderers/nodes/functions/EncodingFunctions.js +0 -99
- package/examples/jsm/renderers/nodes/functions/MathFunctions.js +0 -47
- package/examples/jsm/renderers/webgpu/nodes/ShaderLib.js +0 -152
- package/src/extras/objects/ImmediateRenderObject.js +0 -31
|
@@ -19,7 +19,7 @@ class WebGPUNodes {
|
|
|
19
19
|
|
|
20
20
|
if ( nodeBuilder === undefined ) {
|
|
21
21
|
|
|
22
|
-
nodeBuilder = new WebGPUNodeBuilder( object
|
|
22
|
+
nodeBuilder = new WebGPUNodeBuilder( object, this.renderer, lightNode ).build();
|
|
23
23
|
|
|
24
24
|
this.builders.set( object, nodeBuilder );
|
|
25
25
|
|
|
@@ -98,6 +98,7 @@ class RoughnessMipmapper {
|
|
|
98
98
|
material.roughnessMap.repeat.copy( roughnessMap.repeat );
|
|
99
99
|
material.roughnessMap.center.copy( roughnessMap.center );
|
|
100
100
|
material.roughnessMap.rotation = roughnessMap.rotation;
|
|
101
|
+
material.roughnessMap.image = roughnessMap.image;
|
|
101
102
|
|
|
102
103
|
material.roughnessMap.matrixAutoUpdate = roughnessMap.matrixAutoUpdate;
|
|
103
104
|
material.roughnessMap.matrix.copy( roughnessMap.matrix );
|
|
@@ -329,31 +329,31 @@ class OculusHandPointerModel extends THREE.Object3D {
|
|
|
329
329
|
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
-
intersectObject( object ) {
|
|
332
|
+
intersectObject( object, recursive = true ) {
|
|
333
333
|
|
|
334
334
|
if ( this.raycaster ) {
|
|
335
335
|
|
|
336
|
-
return this.raycaster.intersectObject( object );
|
|
336
|
+
return this.raycaster.intersectObject( object, recursive );
|
|
337
337
|
|
|
338
338
|
}
|
|
339
339
|
|
|
340
340
|
}
|
|
341
341
|
|
|
342
|
-
intersectObjects( objects ) {
|
|
342
|
+
intersectObjects( objects, recursive = true ) {
|
|
343
343
|
|
|
344
344
|
if ( this.raycaster ) {
|
|
345
345
|
|
|
346
|
-
return this.raycaster.intersectObjects( objects,
|
|
346
|
+
return this.raycaster.intersectObjects( objects, recursive );
|
|
347
347
|
|
|
348
348
|
}
|
|
349
349
|
|
|
350
350
|
}
|
|
351
351
|
|
|
352
|
-
checkIntersections( objects ) {
|
|
352
|
+
checkIntersections( objects, recursive = false ) {
|
|
353
353
|
|
|
354
354
|
if ( this.raycaster && ! this.attached ) {
|
|
355
355
|
|
|
356
|
-
const intersections = this.raycaster.intersectObjects( objects,
|
|
356
|
+
const intersections = this.raycaster.intersectObjects( objects, recursive );
|
|
357
357
|
const direction = new THREE.Vector3( 0, 0, - 1 );
|
|
358
358
|
if ( intersections.length > 0 ) {
|
|
359
359
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "super-three",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.135.0",
|
|
4
4
|
"description": "JavaScript 3D library",
|
|
5
5
|
"main": "build/three.js",
|
|
6
6
|
"module": "build/three.module.js",
|
|
@@ -104,23 +104,23 @@
|
|
|
104
104
|
},
|
|
105
105
|
"homepage": "https://threejs.org/",
|
|
106
106
|
"devDependencies": {
|
|
107
|
-
"@babel/core": "^7.15.
|
|
108
|
-
"@babel/eslint-parser": "^7.15.
|
|
107
|
+
"@babel/core": "^7.15.5",
|
|
108
|
+
"@babel/eslint-parser": "^7.15.7",
|
|
109
109
|
"@babel/plugin-proposal-class-properties": "^7.14.5",
|
|
110
|
-
"@babel/preset-env": "^7.15.
|
|
110
|
+
"@babel/preset-env": "^7.15.6",
|
|
111
111
|
"@rollup/plugin-babel": "^5.3.0",
|
|
112
|
-
"@rollup/plugin-node-resolve": "^13.0.
|
|
112
|
+
"@rollup/plugin-node-resolve": "^13.0.5",
|
|
113
113
|
"chalk": "^4.1.2",
|
|
114
|
-
"concurrently": "^6.2.
|
|
114
|
+
"concurrently": "^6.2.2",
|
|
115
115
|
"eslint": "^7.32.0",
|
|
116
116
|
"eslint-config-mdcs": "^5.0.0",
|
|
117
|
-
"eslint-plugin-html": "^6.
|
|
118
|
-
"glob": "^7.
|
|
119
|
-
"rollup": "^2.
|
|
117
|
+
"eslint-plugin-html": "^6.2.0",
|
|
118
|
+
"glob": "^7.2.0",
|
|
119
|
+
"rollup": "^2.57.0",
|
|
120
120
|
"rollup-plugin-filesize": "^9.1.1",
|
|
121
121
|
"rollup-plugin-terser": "^7.0.2",
|
|
122
122
|
"rollup-plugin-visualizer": "^5.5.2",
|
|
123
|
-
"servez": "^1.
|
|
123
|
+
"servez": "^1.12.0"
|
|
124
124
|
},
|
|
125
125
|
"jspm": {
|
|
126
126
|
"files": [
|
package/src/Three.Legacy.js
CHANGED
|
@@ -1945,3 +1945,9 @@ export function Font() {
|
|
|
1945
1945
|
console.error( 'THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js' );
|
|
1946
1946
|
|
|
1947
1947
|
}
|
|
1948
|
+
|
|
1949
|
+
export function ImmediateRenderObject() {
|
|
1950
|
+
|
|
1951
|
+
console.error( 'THREE.ImmediateRenderObject has been removed.' );
|
|
1952
|
+
|
|
1953
|
+
}
|
package/src/Three.js
CHANGED
|
@@ -125,7 +125,6 @@ export { Vector2 } from './math/Vector2.js';
|
|
|
125
125
|
export { Quaternion } from './math/Quaternion.js';
|
|
126
126
|
export { Color } from './math/Color.js';
|
|
127
127
|
export { SphericalHarmonics3 } from './math/SphericalHarmonics3.js';
|
|
128
|
-
export { ImmediateRenderObject } from './extras/objects/ImmediateRenderObject.js';
|
|
129
128
|
export { SpotLightHelper } from './helpers/SpotLightHelper.js';
|
|
130
129
|
export { SkeletonHelper } from './helpers/SkeletonHelper.js';
|
|
131
130
|
export { PointLightHelper } from './helpers/PointLightHelper.js';
|
|
@@ -4,6 +4,7 @@ import { PerspectiveCamera } from './PerspectiveCamera.js';
|
|
|
4
4
|
|
|
5
5
|
const _eyeRight = /*@__PURE__*/ new Matrix4();
|
|
6
6
|
const _eyeLeft = /*@__PURE__*/ new Matrix4();
|
|
7
|
+
const _projectionMatrix = /*@__PURE__*/ new Matrix4();
|
|
7
8
|
|
|
8
9
|
class StereoCamera {
|
|
9
10
|
|
|
@@ -56,7 +57,7 @@ class StereoCamera {
|
|
|
56
57
|
// Off-axis stereoscopic effect based on
|
|
57
58
|
// http://paulbourke.net/stereographics/stereorender/
|
|
58
59
|
|
|
59
|
-
|
|
60
|
+
_projectionMatrix.copy( camera.projectionMatrix );
|
|
60
61
|
const eyeSepHalf = cache.eyeSep / 2;
|
|
61
62
|
const eyeSepOnProjection = eyeSepHalf * cache.near / cache.focus;
|
|
62
63
|
const ymax = ( cache.near * Math.tan( MathUtils.DEG2RAD * cache.fov * 0.5 ) ) / cache.zoom;
|
|
@@ -72,20 +73,20 @@ class StereoCamera {
|
|
|
72
73
|
xmin = - ymax * cache.aspect + eyeSepOnProjection;
|
|
73
74
|
xmax = ymax * cache.aspect + eyeSepOnProjection;
|
|
74
75
|
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
_projectionMatrix.elements[ 0 ] = 2 * cache.near / ( xmax - xmin );
|
|
77
|
+
_projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin );
|
|
77
78
|
|
|
78
|
-
this.cameraL.projectionMatrix.copy(
|
|
79
|
+
this.cameraL.projectionMatrix.copy( _projectionMatrix );
|
|
79
80
|
|
|
80
81
|
// for right eye
|
|
81
82
|
|
|
82
83
|
xmin = - ymax * cache.aspect - eyeSepOnProjection;
|
|
83
84
|
xmax = ymax * cache.aspect - eyeSepOnProjection;
|
|
84
85
|
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
_projectionMatrix.elements[ 0 ] = 2 * cache.near / ( xmax - xmin );
|
|
87
|
+
_projectionMatrix.elements[ 8 ] = ( xmax + xmin ) / ( xmax - xmin );
|
|
87
88
|
|
|
88
|
-
this.cameraR.projectionMatrix.copy(
|
|
89
|
+
this.cameraR.projectionMatrix.copy( _projectionMatrix );
|
|
89
90
|
|
|
90
91
|
}
|
|
91
92
|
|
package/src/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const REVISION = '
|
|
1
|
+
export const REVISION = '135';
|
|
2
2
|
export const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
|
|
3
3
|
export const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
|
|
4
4
|
export const CullFaceNone = 0;
|
|
@@ -159,7 +159,6 @@ export const LinearEncoding = 3000;
|
|
|
159
159
|
export const sRGBEncoding = 3001;
|
|
160
160
|
export const GammaEncoding = 3007;
|
|
161
161
|
export const RGBEEncoding = 3002;
|
|
162
|
-
export const LogLuvEncoding = 3003;
|
|
163
162
|
export const RGBM7Encoding = 3004;
|
|
164
163
|
export const RGBM16Encoding = 3005;
|
|
165
164
|
export const RGBDEncoding = 3006;
|
package/src/core/Layers.js
CHANGED
|
@@ -8,7 +8,7 @@ class Layers {
|
|
|
8
8
|
|
|
9
9
|
set( channel ) {
|
|
10
10
|
|
|
11
|
-
this.mask = 1 << channel | 0;
|
|
11
|
+
this.mask = ( 1 << channel | 0 ) >>> 0;
|
|
12
12
|
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -48,6 +48,12 @@ class Layers {
|
|
|
48
48
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
isEnabled( channel ) {
|
|
52
|
+
|
|
53
|
+
return ( this.mask & ( 1 << channel | 0 ) ) !== 0;
|
|
54
|
+
|
|
55
|
+
}
|
|
56
|
+
|
|
51
57
|
}
|
|
52
58
|
|
|
53
59
|
|
package/src/core/Object3D.js
CHANGED
|
@@ -405,6 +405,8 @@ class Object3D extends EventDispatcher {
|
|
|
405
405
|
|
|
406
406
|
// adds object as a child of this, while maintaining the object's world transform
|
|
407
407
|
|
|
408
|
+
// Note: This method does not support scene graphs having non-uniformly-scaled nodes(s)
|
|
409
|
+
|
|
408
410
|
this.updateWorldMatrix( true, false );
|
|
409
411
|
|
|
410
412
|
_m1.copy( this.matrixWorld ).invert();
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
+
CubeReflectionMapping,
|
|
3
|
+
CubeRefractionMapping,
|
|
2
4
|
CubeUVReflectionMapping,
|
|
3
5
|
GammaEncoding,
|
|
4
6
|
LinearEncoding,
|
|
@@ -8,7 +10,6 @@ import {
|
|
|
8
10
|
RGBDEncoding,
|
|
9
11
|
RGBEEncoding,
|
|
10
12
|
RGBEFormat,
|
|
11
|
-
RGBAFormat,
|
|
12
13
|
RGBM16Encoding,
|
|
13
14
|
RGBM7Encoding,
|
|
14
15
|
UnsignedByteType,
|
|
@@ -348,7 +349,7 @@ class PMREMGenerator {
|
|
|
348
349
|
|
|
349
350
|
_setEncoding( uniform, texture ) {
|
|
350
351
|
|
|
351
|
-
if ( this._renderer.capabilities.isWebGL2 === true && texture.format === RGBAFormat && texture.type === UnsignedByteType && texture.encoding === sRGBEncoding ) {
|
|
352
|
+
/* if ( this._renderer.capabilities.isWebGL2 === true && texture.format === RGBAFormat && texture.type === UnsignedByteType && texture.encoding === sRGBEncoding ) {
|
|
352
353
|
|
|
353
354
|
uniform.value = ENCODINGS[ LinearEncoding ];
|
|
354
355
|
|
|
@@ -356,7 +357,9 @@ class PMREMGenerator {
|
|
|
356
357
|
|
|
357
358
|
uniform.value = ENCODINGS[ texture.encoding ];
|
|
358
359
|
|
|
359
|
-
}
|
|
360
|
+
} */
|
|
361
|
+
|
|
362
|
+
uniform.value = ENCODINGS[ texture.encoding ];
|
|
360
363
|
|
|
361
364
|
}
|
|
362
365
|
|
|
@@ -364,7 +367,9 @@ class PMREMGenerator {
|
|
|
364
367
|
|
|
365
368
|
const renderer = this._renderer;
|
|
366
369
|
|
|
367
|
-
|
|
370
|
+
const isCubeTexture = ( texture.mapping === CubeReflectionMapping || texture.mapping === CubeRefractionMapping );
|
|
371
|
+
|
|
372
|
+
if ( isCubeTexture ) {
|
|
368
373
|
|
|
369
374
|
if ( this._cubemapShader == null ) {
|
|
370
375
|
|
|
@@ -382,14 +387,14 @@ class PMREMGenerator {
|
|
|
382
387
|
|
|
383
388
|
}
|
|
384
389
|
|
|
385
|
-
const material =
|
|
390
|
+
const material = isCubeTexture ? this._cubemapShader : this._equirectShader;
|
|
386
391
|
const mesh = new Mesh( _lodPlanes[ 0 ], material );
|
|
387
392
|
|
|
388
393
|
const uniforms = material.uniforms;
|
|
389
394
|
|
|
390
395
|
uniforms[ 'envMap' ].value = texture;
|
|
391
396
|
|
|
392
|
-
if ( !
|
|
397
|
+
if ( ! isCubeTexture ) {
|
|
393
398
|
|
|
394
399
|
uniforms[ 'texelSize' ].value.set( 1.0 / texture.image.width, 1.0 / texture.image.height );
|
|
395
400
|
|
|
@@ -19,19 +19,17 @@ class FileLoader extends Loader {
|
|
|
19
19
|
|
|
20
20
|
url = this.manager.resolveURL( url );
|
|
21
21
|
|
|
22
|
-
const scope = this;
|
|
23
|
-
|
|
24
22
|
const cached = Cache.get( url );
|
|
25
23
|
|
|
26
24
|
if ( cached !== undefined ) {
|
|
27
25
|
|
|
28
|
-
|
|
26
|
+
this.manager.itemStart( url );
|
|
29
27
|
|
|
30
|
-
setTimeout(
|
|
28
|
+
setTimeout( () => {
|
|
31
29
|
|
|
32
30
|
if ( onLoad ) onLoad( cached );
|
|
33
31
|
|
|
34
|
-
|
|
32
|
+
this.manager.itemEnd( url );
|
|
35
33
|
|
|
36
34
|
}, 0 );
|
|
37
35
|
|
|
@@ -55,225 +53,164 @@ class FileLoader extends Loader {
|
|
|
55
53
|
|
|
56
54
|
}
|
|
57
55
|
|
|
58
|
-
//
|
|
59
|
-
|
|
60
|
-
const dataUriRegexResult = url.match( dataUriRegex );
|
|
61
|
-
let request;
|
|
62
|
-
|
|
63
|
-
// Safari can not handle Data URIs through XMLHttpRequest so process manually
|
|
64
|
-
if ( dataUriRegexResult ) {
|
|
65
|
-
|
|
66
|
-
const mimeType = dataUriRegexResult[ 1 ];
|
|
67
|
-
const isBase64 = !! dataUriRegexResult[ 2 ];
|
|
68
|
-
|
|
69
|
-
let data = dataUriRegexResult[ 3 ];
|
|
70
|
-
data = decodeURIComponent( data );
|
|
71
|
-
|
|
72
|
-
if ( isBase64 ) data = atob( data );
|
|
73
|
-
|
|
74
|
-
try {
|
|
75
|
-
|
|
76
|
-
let response;
|
|
77
|
-
const responseType = ( this.responseType || '' ).toLowerCase();
|
|
78
|
-
|
|
79
|
-
switch ( responseType ) {
|
|
80
|
-
|
|
81
|
-
case 'arraybuffer':
|
|
82
|
-
case 'blob':
|
|
83
|
-
|
|
84
|
-
const view = new Uint8Array( data.length );
|
|
85
|
-
|
|
86
|
-
for ( let i = 0; i < data.length; i ++ ) {
|
|
87
|
-
|
|
88
|
-
view[ i ] = data.charCodeAt( i );
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
if ( responseType === 'blob' ) {
|
|
93
|
-
|
|
94
|
-
response = new Blob( [ view.buffer ], { type: mimeType } );
|
|
56
|
+
// Initialise array for duplicate requests
|
|
57
|
+
loading[ url ] = [];
|
|
95
58
|
|
|
96
|
-
|
|
59
|
+
loading[ url ].push( {
|
|
60
|
+
onLoad: onLoad,
|
|
61
|
+
onProgress: onProgress,
|
|
62
|
+
onError: onError,
|
|
63
|
+
} );
|
|
97
64
|
|
|
98
|
-
|
|
65
|
+
// create request
|
|
66
|
+
const req = new Request( url, {
|
|
67
|
+
headers: new Headers( this.requestHeader ),
|
|
68
|
+
credentials: this.withCredentials ? 'include' : 'same-origin',
|
|
69
|
+
// An abort controller could be added within a future PR
|
|
70
|
+
} );
|
|
99
71
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
case 'document':
|
|
105
|
-
|
|
106
|
-
const parser = new DOMParser();
|
|
107
|
-
response = parser.parseFromString( data, mimeType );
|
|
108
|
-
|
|
109
|
-
break;
|
|
110
|
-
|
|
111
|
-
case 'json':
|
|
112
|
-
|
|
113
|
-
response = JSON.parse( data );
|
|
72
|
+
// start the fetch
|
|
73
|
+
fetch( req )
|
|
74
|
+
.then( response => {
|
|
114
75
|
|
|
115
|
-
|
|
76
|
+
if ( response.status === 200 || response.status === 0 ) {
|
|
116
77
|
|
|
117
|
-
|
|
78
|
+
// Some browsers return HTTP Status 0 when using non-http protocol
|
|
79
|
+
// e.g. 'file://' or 'data://'. Handle as success.
|
|
118
80
|
|
|
119
|
-
|
|
81
|
+
if ( response.status === 0 ) {
|
|
120
82
|
|
|
121
|
-
|
|
83
|
+
console.warn( 'THREE.FileLoader: HTTP Status 0 received.' );
|
|
122
84
|
|
|
123
|
-
|
|
85
|
+
}
|
|
124
86
|
|
|
125
|
-
|
|
126
|
-
|
|
87
|
+
const callbacks = loading[ url ];
|
|
88
|
+
const reader = response.body.getReader();
|
|
89
|
+
const contentLength = response.headers.get( 'Content-Length' );
|
|
90
|
+
const total = contentLength ? parseInt( contentLength ) : 0;
|
|
91
|
+
const lengthComputable = total !== 0;
|
|
92
|
+
let loaded = 0;
|
|
127
93
|
|
|
128
|
-
|
|
94
|
+
// periodically read data into the new stream tracking while download progress
|
|
95
|
+
return new ReadableStream( {
|
|
96
|
+
start( controller ) {
|
|
129
97
|
|
|
130
|
-
|
|
98
|
+
readData();
|
|
131
99
|
|
|
132
|
-
|
|
100
|
+
function readData() {
|
|
133
101
|
|
|
134
|
-
|
|
102
|
+
reader.read().then( ( { done, value } ) => {
|
|
135
103
|
|
|
136
|
-
|
|
137
|
-
setTimeout( function () {
|
|
104
|
+
if ( done ) {
|
|
138
105
|
|
|
139
|
-
|
|
106
|
+
controller.close();
|
|
140
107
|
|
|
141
|
-
|
|
142
|
-
scope.manager.itemEnd( url );
|
|
108
|
+
} else {
|
|
143
109
|
|
|
144
|
-
|
|
110
|
+
loaded += value.byteLength;
|
|
145
111
|
|
|
146
|
-
|
|
112
|
+
const event = new ProgressEvent( 'progress', { lengthComputable, loaded, total } );
|
|
113
|
+
for ( let i = 0, il = callbacks.length; i < il; i ++ ) {
|
|
147
114
|
|
|
148
|
-
|
|
115
|
+
const callback = callbacks[ i ];
|
|
116
|
+
if ( callback.onProgress ) callback.onProgress( event );
|
|
149
117
|
|
|
150
|
-
|
|
118
|
+
}
|
|
151
119
|
|
|
152
|
-
|
|
120
|
+
controller.enqueue( value );
|
|
121
|
+
readData();
|
|
153
122
|
|
|
154
|
-
|
|
123
|
+
}
|
|
155
124
|
|
|
156
|
-
|
|
157
|
-
onProgress: onProgress,
|
|
158
|
-
onError: onError
|
|
125
|
+
} );
|
|
159
126
|
|
|
160
|
-
|
|
127
|
+
}
|
|
161
128
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
request.open( 'GET', url, true );
|
|
165
|
-
|
|
166
|
-
request.addEventListener( 'load', function ( event ) {
|
|
167
|
-
|
|
168
|
-
const response = this.response;
|
|
169
|
-
|
|
170
|
-
const callbacks = loading[ url ];
|
|
129
|
+
}
|
|
171
130
|
|
|
172
|
-
|
|
131
|
+
} );
|
|
173
132
|
|
|
174
|
-
|
|
133
|
+
} else {
|
|
175
134
|
|
|
176
|
-
|
|
177
|
-
// e.g. 'file://' or 'data://'. Handle as success.
|
|
135
|
+
throw Error( `fetch for "${response.url}" responded with ${response.status}: ${response.statusText}` );
|
|
178
136
|
|
|
179
|
-
|
|
137
|
+
}
|
|
180
138
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
Cache.add( url, response );
|
|
139
|
+
} )
|
|
140
|
+
.then( stream => {
|
|
184
141
|
|
|
185
|
-
|
|
142
|
+
const response = new Response( stream );
|
|
186
143
|
|
|
187
|
-
|
|
188
|
-
if ( callback.onLoad ) callback.onLoad( response );
|
|
144
|
+
switch ( this.responseType ) {
|
|
189
145
|
|
|
190
|
-
|
|
146
|
+
case 'arraybuffer':
|
|
191
147
|
|
|
192
|
-
|
|
148
|
+
return response.arrayBuffer();
|
|
193
149
|
|
|
194
|
-
|
|
150
|
+
case 'blob':
|
|
195
151
|
|
|
196
|
-
|
|
152
|
+
return response.blob();
|
|
197
153
|
|
|
198
|
-
|
|
199
|
-
if ( callback.onError ) callback.onError( event );
|
|
154
|
+
case 'document':
|
|
200
155
|
|
|
201
|
-
|
|
156
|
+
return response.text()
|
|
157
|
+
.then( text => {
|
|
202
158
|
|
|
203
|
-
|
|
204
|
-
|
|
159
|
+
const parser = new DOMParser();
|
|
160
|
+
return parser.parseFromString( text, this.mimeType );
|
|
205
161
|
|
|
206
|
-
|
|
162
|
+
} );
|
|
207
163
|
|
|
208
|
-
|
|
164
|
+
case 'json':
|
|
209
165
|
|
|
210
|
-
|
|
166
|
+
return response.json();
|
|
211
167
|
|
|
212
|
-
|
|
168
|
+
default:
|
|
213
169
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
const callback = callbacks[ i ];
|
|
217
|
-
if ( callback.onProgress ) callback.onProgress( event );
|
|
170
|
+
return response.text();
|
|
218
171
|
|
|
219
172
|
}
|
|
220
173
|
|
|
221
|
-
}
|
|
174
|
+
} )
|
|
175
|
+
.then( data => {
|
|
222
176
|
|
|
223
|
-
|
|
177
|
+
// Add to cache only on HTTP success, so that we do not cache
|
|
178
|
+
// error response bodies as proper responses to requests.
|
|
179
|
+
Cache.add( url, data );
|
|
224
180
|
|
|
225
181
|
const callbacks = loading[ url ];
|
|
226
|
-
|
|
227
182
|
delete loading[ url ];
|
|
228
183
|
|
|
229
184
|
for ( let i = 0, il = callbacks.length; i < il; i ++ ) {
|
|
230
185
|
|
|
231
186
|
const callback = callbacks[ i ];
|
|
232
|
-
if ( callback.
|
|
187
|
+
if ( callback.onLoad ) callback.onLoad( data );
|
|
233
188
|
|
|
234
189
|
}
|
|
235
190
|
|
|
236
|
-
|
|
237
|
-
scope.manager.itemEnd( url );
|
|
191
|
+
this.manager.itemEnd( url );
|
|
238
192
|
|
|
239
|
-
}
|
|
193
|
+
} )
|
|
194
|
+
.catch( err => {
|
|
240
195
|
|
|
241
|
-
|
|
196
|
+
// Abort errors and other errors are handled the same
|
|
242
197
|
|
|
243
198
|
const callbacks = loading[ url ];
|
|
244
|
-
|
|
245
199
|
delete loading[ url ];
|
|
246
200
|
|
|
247
201
|
for ( let i = 0, il = callbacks.length; i < il; i ++ ) {
|
|
248
202
|
|
|
249
203
|
const callback = callbacks[ i ];
|
|
250
|
-
if ( callback.onError ) callback.onError(
|
|
204
|
+
if ( callback.onError ) callback.onError( err );
|
|
251
205
|
|
|
252
206
|
}
|
|
253
207
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
}, false );
|
|
258
|
-
|
|
259
|
-
if ( this.responseType !== undefined ) request.responseType = this.responseType;
|
|
260
|
-
if ( this.withCredentials !== undefined ) request.withCredentials = this.withCredentials;
|
|
208
|
+
this.manager.itemError( url );
|
|
209
|
+
this.manager.itemEnd( url );
|
|
261
210
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
for ( const header in this.requestHeader ) {
|
|
265
|
-
|
|
266
|
-
request.setRequestHeader( header, this.requestHeader[ header ] );
|
|
267
|
-
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
request.send( null );
|
|
271
|
-
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
scope.manager.itemStart( url );
|
|
211
|
+
} );
|
|
275
212
|
|
|
276
|
-
|
|
213
|
+
this.manager.itemStart( url );
|
|
277
214
|
|
|
278
215
|
}
|
|
279
216
|
|
|
@@ -40,8 +40,7 @@ class ImageLoader extends Loader {
|
|
|
40
40
|
|
|
41
41
|
function onImageLoad() {
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
image.removeEventListener( 'error', onImageError, false );
|
|
43
|
+
removeEventListeners();
|
|
45
44
|
|
|
46
45
|
Cache.add( url, this );
|
|
47
46
|
|
|
@@ -53,8 +52,7 @@ class ImageLoader extends Loader {
|
|
|
53
52
|
|
|
54
53
|
function onImageError( event ) {
|
|
55
54
|
|
|
56
|
-
|
|
57
|
-
image.removeEventListener( 'error', onImageError, false );
|
|
55
|
+
removeEventListeners();
|
|
58
56
|
|
|
59
57
|
if ( onError ) onError( event );
|
|
60
58
|
|
|
@@ -63,6 +61,13 @@ class ImageLoader extends Loader {
|
|
|
63
61
|
|
|
64
62
|
}
|
|
65
63
|
|
|
64
|
+
function removeEventListeners() {
|
|
65
|
+
|
|
66
|
+
image.removeEventListener( 'load', onImageLoad, false );
|
|
67
|
+
image.removeEventListener( 'error', onImageError, false );
|
|
68
|
+
|
|
69
|
+
}
|
|
70
|
+
|
|
66
71
|
image.addEventListener( 'load', onImageLoad, false );
|
|
67
72
|
image.addEventListener( 'error', onImageError, false );
|
|
68
73
|
|
|
@@ -44,6 +44,32 @@ class LoaderUtils {
|
|
|
44
44
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
static resolveURL( url, path ) {
|
|
48
|
+
|
|
49
|
+
// Invalid URL
|
|
50
|
+
if ( typeof url !== 'string' || url === '' ) return '';
|
|
51
|
+
|
|
52
|
+
// Host Relative URL
|
|
53
|
+
if ( /^https?:\/\//i.test( path ) && /^\//.test( url ) ) {
|
|
54
|
+
|
|
55
|
+
path = path.replace( /(^https?:\/\/[^\/]+).*/i, '$1' );
|
|
56
|
+
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Absolute URL http://,https://,//
|
|
60
|
+
if ( /^(https?:)?\/\//i.test( url ) ) return url;
|
|
61
|
+
|
|
62
|
+
// Data URI
|
|
63
|
+
if ( /^data:.*,.*$/i.test( url ) ) return url;
|
|
64
|
+
|
|
65
|
+
// Blob URL
|
|
66
|
+
if ( /^blob:.*$/i.test( url ) ) return url;
|
|
67
|
+
|
|
68
|
+
// Relative URL
|
|
69
|
+
return path + url;
|
|
70
|
+
|
|
71
|
+
}
|
|
72
|
+
|
|
47
73
|
}
|
|
48
74
|
|
|
49
75
|
export { LoaderUtils };
|