super-three 0.135.0 → 0.136.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 +527 -332
- package/build/three.min.js +1 -1
- package/build/three.module.js +752 -370
- package/examples/fonts/tabler-icons/fonts/tabler-icons.svg +3966 -0
- package/examples/js/animation/CCDIKSolver.js +0 -1
- package/examples/js/animation/MMDPhysics.js +1 -3
- package/examples/js/controls/ArcballControls.js +38 -52
- package/examples/js/controls/TransformControls.js +24 -1
- package/examples/js/curves/CurveExtras.js +0 -2
- package/examples/js/effects/AsciiEffect.js +2 -9
- package/examples/js/exporters/GLTFExporter.js +1 -1
- package/examples/js/geometries/TeapotGeometry.js +0 -1
- package/examples/js/interactive/SelectionBox.js +2 -0
- package/examples/js/interactive/SelectionHelper.js +22 -7
- package/examples/js/lights/RectAreaLightUniformsLib.js +4 -0
- package/examples/js/loaders/AMFLoader.js +0 -2
- package/examples/js/loaders/ColladaLoader.js +1 -2
- package/examples/js/loaders/EXRLoader.js +185 -262
- package/examples/js/loaders/FBXLoader.js +3 -4
- package/examples/js/loaders/GLTFLoader.js +2 -2
- package/examples/js/loaders/HDRCubeTextureLoader.js +0 -8
- package/examples/js/loaders/KTX2Loader.js +11 -2
- package/examples/js/loaders/KTXLoader.js +1 -1
- package/examples/js/loaders/LDrawLoader.js +26 -30
- package/examples/js/loaders/LUT3dlLoader.js +2 -0
- package/examples/js/loaders/LUTCubeLoader.js +2 -0
- package/examples/js/loaders/MMDLoader.js +0 -1
- package/examples/js/loaders/NRRDLoader.js +9 -2
- package/examples/js/loaders/OBJLoader.js +0 -2
- package/examples/js/loaders/PLYLoader.js +1 -1
- package/examples/js/loaders/RGBELoader.js +0 -15
- package/examples/js/loaders/RGBMLoader.js +55 -5
- package/examples/js/loaders/SVGLoader.js +2 -2
- package/examples/js/loaders/VOXLoader.js +1 -0
- package/examples/js/loaders/VRMLLoader.js +2 -1
- package/examples/js/math/ImprovedNoise.js +1 -1
- package/examples/js/misc/GPUComputationRenderer.js +3 -1
- package/examples/js/objects/Lensflare.js +2 -10
- package/examples/js/objects/Reflector.js +7 -0
- package/examples/js/objects/Refractor.js +7 -0
- package/examples/js/objects/Sky.js +1 -1
- package/examples/js/objects/Water.js +2 -2
- package/examples/js/objects/Water2.js +4 -7
- package/examples/js/postprocessing/GlitchPass.js +3 -1
- package/examples/js/postprocessing/SSAOPass.js +1 -0
- package/examples/js/shaders/ConvolutionShader.js +0 -1
- package/examples/js/shaders/FXAAShader.js +1 -1
- package/examples/js/shaders/FilmShader.js +1 -1
- package/examples/js/shaders/GammaCorrectionShader.js +1 -1
- package/examples/js/shaders/HorizontalBlurShader.js +1 -2
- package/examples/js/shaders/SSRShader.js +1 -1
- package/examples/js/shaders/SSRrShader.js +1 -1
- package/examples/js/shaders/VerticalBlurShader.js +1 -2
- package/examples/js/utils/GeometryUtils.js +1 -1
- package/examples/js/utils/RoughnessMipmapper.js +18 -29
- package/examples/jsm/animation/CCDIKSolver.js +0 -1
- package/examples/jsm/animation/MMDPhysics.js +0 -2
- package/examples/jsm/controls/ArcballControls.js +27 -56
- package/examples/jsm/controls/TransformControls.js +24 -1
- package/examples/jsm/curves/CurveExtras.js +0 -2
- package/examples/jsm/effects/AsciiEffect.js +2 -9
- package/examples/jsm/exporters/GLTFExporter.js +1 -1
- package/examples/jsm/geometries/TeapotGeometry.js +0 -1
- package/examples/jsm/interactive/SelectionBox.js +1 -0
- package/examples/jsm/interactive/SelectionHelper.js +19 -7
- package/examples/jsm/libs/flow.module.js +256 -136
- package/examples/jsm/lights/RectAreaLightUniformsLib.js +7 -0
- package/examples/jsm/loaders/AMFLoader.js +0 -2
- package/examples/jsm/loaders/ColladaLoader.js +1 -2
- package/examples/jsm/loaders/EXRLoader.js +184 -293
- package/examples/jsm/loaders/FBXLoader.js +3 -4
- package/examples/jsm/loaders/GLTFLoader.js +2 -2
- package/examples/jsm/loaders/HDRCubeTextureLoader.js +1 -14
- package/examples/jsm/loaders/KTX2Loader.js +13 -4
- package/examples/jsm/loaders/KTXLoader.js +1 -1
- package/examples/jsm/loaders/LDrawLoader.js +23 -24
- package/examples/jsm/loaders/LUT3dlLoader.js +2 -0
- package/examples/jsm/loaders/LUTCubeLoader.js +2 -0
- package/examples/jsm/loaders/MMDLoader.js +0 -1
- package/examples/jsm/loaders/NRRDLoader.js +10 -2
- package/examples/jsm/loaders/OBJLoader.js +0 -2
- package/examples/jsm/loaders/PLYLoader.js +1 -1
- package/examples/jsm/loaders/RGBELoader.js +0 -20
- package/examples/jsm/loaders/RGBMLoader.js +61 -7
- package/examples/jsm/loaders/SVGLoader.js +2 -2
- package/examples/jsm/loaders/TDSLoader.js +30 -9
- package/examples/jsm/loaders/VOXLoader.js +1 -0
- package/examples/jsm/loaders/VRMLLoader.js +2 -1
- package/examples/jsm/math/ImprovedNoise.js +1 -1
- package/examples/jsm/misc/GPUComputationRenderer.js +3 -1
- package/examples/jsm/node-editor/NodeEditor.js +23 -22
- package/examples/jsm/node-editor/examples/rim.json +1 -1
- package/examples/jsm/node-editor/materials/StandardMaterialEditor.js +48 -9
- package/examples/jsm/node-editor/utils/OscillatorEditor.js +1 -1
- package/examples/jsm/nodes/core/NodeBuilder.js +2 -2
- package/examples/jsm/nodes/materials/nodes/StandardNode.js +1 -0
- package/examples/jsm/nodes/math/MathNode.js +12 -0
- package/examples/jsm/nodes/misc/BumpMapNode.js +1 -1
- package/examples/jsm/nodes/misc/TextureCubeUVNode.js +1 -4
- package/examples/jsm/nodes/utils/ColorSpaceNode.js +1 -116
- package/examples/jsm/objects/Lensflare.js +3 -14
- package/examples/jsm/objects/Reflector.js +7 -0
- package/examples/jsm/objects/Refractor.js +7 -0
- package/examples/jsm/objects/Sky.js +1 -1
- package/examples/jsm/objects/Water.js +2 -2
- package/examples/jsm/objects/Water2.js +4 -8
- package/examples/jsm/postprocessing/GlitchPass.js +3 -1
- package/examples/jsm/postprocessing/SAOPass.js +1 -1
- package/examples/jsm/postprocessing/SSAOPass.js +1 -0
- package/examples/jsm/renderers/nodes/Nodes.js +1 -0
- package/examples/jsm/renderers/nodes/ShaderNode.js +7 -6
- package/examples/jsm/renderers/nodes/core/InputNode.js +1 -1
- package/examples/jsm/renderers/nodes/core/NodeBuilder.js +1 -1
- package/examples/jsm/renderers/nodes/display/ColorSpaceNode.js +26 -31
- package/examples/jsm/renderers/nodes/functions/BSDFs.js +2 -2
- package/examples/jsm/renderers/nodes/functions/PhysicalMaterialFunctions.js +27 -0
- package/examples/jsm/renderers/nodes/inputs/TextureNode.js +1 -1
- package/examples/jsm/renderers/nodes/math/MathNode.js +5 -3
- package/examples/jsm/renderers/nodes/math/OperatorNode.js +2 -2
- package/examples/jsm/renderers/nodes/utils/TimerNode.js +1 -1
- package/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.js +14 -14
- package/examples/jsm/renderers/webgpu/WebGPUBindings.js +7 -6
- package/examples/jsm/renderers/webgpu/WebGPURenderPipeline.js +1 -1
- package/examples/jsm/renderers/webgpu/WebGPURenderPipelines.js +42 -61
- package/examples/jsm/renderers/webgpu/WebGPURenderer.js +2 -2
- package/examples/jsm/renderers/webgpu/WebGPUTextureUtils.js +0 -1
- package/examples/jsm/renderers/webgpu/nodes/WebGPUNodeBuilder.js +30 -4
- package/examples/jsm/shaders/ConvolutionShader.js +0 -1
- package/examples/jsm/shaders/FXAAShader.js +1 -1
- package/examples/jsm/shaders/FilmShader.js +1 -1
- package/examples/jsm/shaders/GammaCorrectionShader.js +1 -1
- package/examples/jsm/shaders/HorizontalBlurShader.js +1 -2
- package/examples/jsm/shaders/SSRShader.js +1 -1
- package/examples/jsm/shaders/SSRrShader.js +1 -1
- package/examples/jsm/shaders/VerticalBlurShader.js +1 -2
- package/examples/jsm/utils/GeometryUtils.js +1 -1
- package/examples/jsm/utils/RoughnessMipmapper.js +19 -32
- package/examples/jsm/utils/WorkerPool.js +11 -11
- package/package.json +15 -9
- package/src/Three.Legacy.js +12 -0
- package/src/Three.js +1 -2
- package/src/constants.js +1 -7
- package/src/core/Object3D.js +1 -1
- package/src/extras/PMREMGenerator.js +19 -110
- package/src/extras/core/Interpolations.js +1 -1
- package/src/geometries/LatheGeometry.js +70 -47
- package/src/helpers/CameraHelper.js +1 -1
- package/src/loaders/FileLoader.js +23 -6
- package/src/math/Color.js +0 -38
- package/src/math/Ray.js +2 -2
- package/src/math/Sphere.js +10 -1
- package/src/objects/Skeleton.js +1 -0
- package/src/renderers/WebGLRenderer.js +23 -16
- package/src/renderers/shaders/ShaderChunk/bumpmap_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/cube_uv_reflection_fragment.glsl.js +2 -24
- package/src/renderers/shaders/ShaderChunk/encodings_pars_fragment.glsl.js +0 -47
- package/src/renderers/shaders/ShaderChunk/gradientmap_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +27 -1
- package/src/renderers/shaders/ShaderChunk/tonemapping_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +10 -0
- package/src/renderers/webgl/WebGLCapabilities.js +0 -2
- package/src/renderers/webgl/WebGLMorphtargets.js +1 -0
- package/src/renderers/webgl/WebGLProgram.js +2 -19
- package/src/renderers/webgl/WebGLPrograms.js +191 -35
- package/src/renderers/webgl/WebGLRenderLists.js +4 -14
- package/src/renderers/webgl/WebGLShaderCache.js +120 -0
- package/src/renderers/webgl/WebGLState.js +45 -0
- package/src/renderers/webgl/WebGLTextures.js +195 -26
- package/src/renderers/webxr/WebXRManager.js +10 -3
- package/src/scenes/Scene.js +1 -1
- package/src/textures/DataTexture.js +0 -2
- package/src/textures/DataTexture2DArray.js +0 -2
- package/src/textures/DataTexture3D.js +0 -2
- package/src/textures/FramebufferTexture.js +25 -0
- package/src/utils.js +1 -37
|
@@ -1086,7 +1086,6 @@
|
|
|
1086
1086
|
|
|
1087
1087
|
for ( let i = 0; i < 6; i ++ ) {
|
|
1088
1088
|
|
|
1089
|
-
// this parameter is from http://www20.atpages.jp/katwat/three.js_r58/examples/mytest37/mmd.three.js
|
|
1090
1089
|
constraint.setParam( 2, 0.475, i );
|
|
1091
1090
|
|
|
1092
1091
|
}
|
|
@@ -1221,8 +1220,7 @@
|
|
|
1221
1220
|
|
|
1222
1221
|
}
|
|
1223
1222
|
|
|
1224
|
-
}
|
|
1225
|
-
|
|
1223
|
+
}
|
|
1226
1224
|
|
|
1227
1225
|
function createCapsuleGeometry( radius, cylinderHeight, segmentsRadius, segmentsHeight ) {
|
|
1228
1226
|
|
|
@@ -44,6 +44,12 @@
|
|
|
44
44
|
const _raycaster = new THREE.Raycaster();
|
|
45
45
|
|
|
46
46
|
const _offset = new THREE.Vector3();
|
|
47
|
+
|
|
48
|
+
const _gizmoMatrixStateTemp = new THREE.Matrix4();
|
|
49
|
+
|
|
50
|
+
const _cameraMatrixStateTemp = new THREE.Matrix4();
|
|
51
|
+
|
|
52
|
+
const _scalePointTemp = new THREE.Vector3();
|
|
47
53
|
/**
|
|
48
54
|
*
|
|
49
55
|
* @param {Camera} camera Virtual camera used in the scene
|
|
@@ -567,28 +573,6 @@
|
|
|
567
573
|
|
|
568
574
|
};
|
|
569
575
|
|
|
570
|
-
this.onKeyDown = event => {
|
|
571
|
-
|
|
572
|
-
if ( event.key == 'c' ) {
|
|
573
|
-
|
|
574
|
-
if ( event.ctrlKey || event.metaKey ) {
|
|
575
|
-
|
|
576
|
-
this.copyState();
|
|
577
|
-
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
} else if ( event.key == 'v' ) {
|
|
581
|
-
|
|
582
|
-
if ( event.ctrlKey || event.metaKey ) {
|
|
583
|
-
|
|
584
|
-
this.pasteState();
|
|
585
|
-
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
};
|
|
591
|
-
|
|
592
576
|
this.onSinglePanStart = ( event, operation ) => {
|
|
593
577
|
|
|
594
578
|
if ( this.enabled ) {
|
|
@@ -1621,13 +1605,13 @@
|
|
|
1621
1605
|
|
|
1622
1606
|
this._translationMatrix.makeTranslation( _offset.x, _offset.y, _offset.z );
|
|
1623
1607
|
|
|
1624
|
-
|
|
1608
|
+
_gizmoMatrixStateTemp.copy( this._gizmoMatrixState );
|
|
1625
1609
|
|
|
1626
1610
|
this._gizmoMatrixState.premultiply( this._translationMatrix );
|
|
1627
1611
|
|
|
1628
1612
|
this._gizmoMatrixState.decompose( this._gizmos.position, this._gizmos.quaternion, this._gizmos.scale );
|
|
1629
1613
|
|
|
1630
|
-
|
|
1614
|
+
_cameraMatrixStateTemp.copy( this._cameraMatrixState );
|
|
1631
1615
|
|
|
1632
1616
|
this._cameraMatrixState.premultiply( this._translationMatrix );
|
|
1633
1617
|
|
|
@@ -1640,9 +1624,9 @@
|
|
|
1640
1624
|
|
|
1641
1625
|
}
|
|
1642
1626
|
|
|
1643
|
-
this._gizmoMatrixState.copy(
|
|
1627
|
+
this._gizmoMatrixState.copy( _gizmoMatrixStateTemp );
|
|
1644
1628
|
|
|
1645
|
-
this._cameraMatrixState.copy(
|
|
1629
|
+
this._cameraMatrixState.copy( _cameraMatrixStateTemp );
|
|
1646
1630
|
|
|
1647
1631
|
};
|
|
1648
1632
|
|
|
@@ -1710,7 +1694,6 @@
|
|
|
1710
1694
|
window.removeEventListener( 'pointermove', this.onPointerMove );
|
|
1711
1695
|
window.removeEventListener( 'pointerup', this.onPointerUp );
|
|
1712
1696
|
window.removeEventListener( 'resize', this.onWindowResize );
|
|
1713
|
-
window.removeEventListener( 'keydown', this.onKeyDown );
|
|
1714
1697
|
if ( this.scene !== null ) this.scene.remove( this._gizmos );
|
|
1715
1698
|
this.disposeGrid();
|
|
1716
1699
|
|
|
@@ -2163,7 +2146,8 @@
|
|
|
2163
2146
|
|
|
2164
2147
|
this.scale = ( size, point, scaleGizmos = true ) => {
|
|
2165
2148
|
|
|
2166
|
-
|
|
2149
|
+
_scalePointTemp.copy( point );
|
|
2150
|
+
|
|
2167
2151
|
let sizeInverse = 1 / size;
|
|
2168
2152
|
|
|
2169
2153
|
if ( this.camera.isOrthographicCamera ) {
|
|
@@ -2199,11 +2183,13 @@
|
|
|
2199
2183
|
this._m4_2.multiply( this._translationMatrix ); //move camera and gizmos to obtain pinch effect
|
|
2200
2184
|
|
|
2201
2185
|
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2186
|
+
_scalePointTemp.sub( this._v3_1 );
|
|
2187
|
+
|
|
2188
|
+
const amount = _scalePointTemp.clone().multiplyScalar( sizeInverse );
|
|
2189
|
+
|
|
2190
|
+
_scalePointTemp.sub( amount );
|
|
2205
2191
|
|
|
2206
|
-
this._m4_1.makeTranslation(
|
|
2192
|
+
this._m4_1.makeTranslation( _scalePointTemp.x, _scalePointTemp.y, _scalePointTemp.z );
|
|
2207
2193
|
|
|
2208
2194
|
this._m4_2.premultiply( this._m4_1 );
|
|
2209
2195
|
|
|
@@ -2217,7 +2203,7 @@
|
|
|
2217
2203
|
this._v3_2.setFromMatrixPosition( this._gizmoMatrixState ); //move camera
|
|
2218
2204
|
|
|
2219
2205
|
|
|
2220
|
-
let distance = this._v3_1.distanceTo(
|
|
2206
|
+
let distance = this._v3_1.distanceTo( _scalePointTemp );
|
|
2221
2207
|
|
|
2222
2208
|
let amount = distance - distance * sizeInverse; //check min and max distance
|
|
2223
2209
|
|
|
@@ -2235,7 +2221,7 @@
|
|
|
2235
2221
|
|
|
2236
2222
|
}
|
|
2237
2223
|
|
|
2238
|
-
_offset.copy(
|
|
2224
|
+
_offset.copy( _scalePointTemp ).sub( this._v3_1 ).normalize().multiplyScalar( amount );
|
|
2239
2225
|
|
|
2240
2226
|
this._m4_1.makeTranslation( _offset.x, _offset.y, _offset.z );
|
|
2241
2227
|
|
|
@@ -2243,10 +2229,10 @@
|
|
|
2243
2229
|
|
|
2244
2230
|
//scale gizmos so they appear in the same spot having the same dimension
|
|
2245
2231
|
const pos = this._v3_2;
|
|
2246
|
-
distance = pos.distanceTo(
|
|
2232
|
+
distance = pos.distanceTo( _scalePointTemp );
|
|
2247
2233
|
amount = distance - distance * sizeInverse;
|
|
2248
2234
|
|
|
2249
|
-
_offset.copy(
|
|
2235
|
+
_offset.copy( _scalePointTemp ).sub( this._v3_2 ).normalize().multiplyScalar( amount );
|
|
2250
2236
|
|
|
2251
2237
|
this._translationMatrix.makeTranslation( pos.x, pos.y, pos.z );
|
|
2252
2238
|
|
|
@@ -2285,19 +2271,6 @@
|
|
|
2285
2271
|
|
|
2286
2272
|
};
|
|
2287
2273
|
|
|
2288
|
-
this.setTarget = ( x, y, z ) => {
|
|
2289
|
-
|
|
2290
|
-
this.target.set( x, y, z );
|
|
2291
|
-
|
|
2292
|
-
this._gizmos.position.set( x, y, z ); //for correct radius calculation
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
this._tbRadius = this.calculateTbRadius( this.camera );
|
|
2296
|
-
this.makeGizmos( this.target, this._tbRadius );
|
|
2297
|
-
this.camera.lookAt( this.target );
|
|
2298
|
-
|
|
2299
|
-
};
|
|
2300
|
-
|
|
2301
2274
|
this.zRotate = ( point, angle ) => {
|
|
2302
2275
|
|
|
2303
2276
|
this._rotationMatrix.makeRotationAxis( this._rotationAxis, angle );
|
|
@@ -2579,7 +2552,20 @@
|
|
|
2579
2552
|
|
|
2580
2553
|
this.update = () => {
|
|
2581
2554
|
|
|
2582
|
-
const EPS = 0.000001;
|
|
2555
|
+
const EPS = 0.000001;
|
|
2556
|
+
|
|
2557
|
+
if ( this.target.equals( this._currentTarget ) === false ) {
|
|
2558
|
+
|
|
2559
|
+
this._gizmos.position.copy( this.target ); //for correct radius calculation
|
|
2560
|
+
|
|
2561
|
+
|
|
2562
|
+
this._tbRadius = this.calculateTbRadius( this.camera );
|
|
2563
|
+
this.makeGizmos( this.target, this._tbRadius );
|
|
2564
|
+
|
|
2565
|
+
this._currentTarget.copy( this.target );
|
|
2566
|
+
|
|
2567
|
+
} //check min/max parameters
|
|
2568
|
+
|
|
2583
2569
|
|
|
2584
2570
|
if ( this.camera.isOrthographicCamera ) {
|
|
2585
2571
|
|
|
@@ -2684,7 +2670,8 @@
|
|
|
2684
2670
|
this.camera = null;
|
|
2685
2671
|
this.domElement = domElement;
|
|
2686
2672
|
this.scene = scene;
|
|
2687
|
-
this.target = new THREE.Vector3(
|
|
2673
|
+
this.target = new THREE.Vector3();
|
|
2674
|
+
this._currentTarget = new THREE.Vector3();
|
|
2688
2675
|
this.radiusFactor = 0.67;
|
|
2689
2676
|
this.mouseActions = [];
|
|
2690
2677
|
this._mouseOp = null; //global vectors and matrices that are used in some operations to avoid creating new objects every time (e.g. every time cursor moves)
|
|
@@ -2827,7 +2814,6 @@
|
|
|
2827
2814
|
this.domElement.addEventListener( 'wheel', this.onWheel );
|
|
2828
2815
|
this.domElement.addEventListener( 'pointerdown', this.onPointerDown );
|
|
2829
2816
|
this.domElement.addEventListener( 'pointercancel', this.onPointerCancel );
|
|
2830
|
-
window.addEventListener( 'keydown', this.onKeyDown );
|
|
2831
2817
|
window.addEventListener( 'resize', this.onWindowResize );
|
|
2832
2818
|
|
|
2833
2819
|
} //listeners
|
|
@@ -532,6 +532,23 @@
|
|
|
532
532
|
|
|
533
533
|
}
|
|
534
534
|
|
|
535
|
+
reset() {
|
|
536
|
+
|
|
537
|
+
if ( ! this.enabled ) return;
|
|
538
|
+
|
|
539
|
+
if ( this.dragging ) {
|
|
540
|
+
|
|
541
|
+
this.object.position.copy( this._positionStart );
|
|
542
|
+
this.object.quaternion.copy( this._quaternionStart );
|
|
543
|
+
this.object.scale.copy( this._scaleStart );
|
|
544
|
+
this.dispatchEvent( _changeEvent );
|
|
545
|
+
this.dispatchEvent( _objectChangeEvent );
|
|
546
|
+
this.pointStart.copy( this.pointEnd );
|
|
547
|
+
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
}
|
|
551
|
+
|
|
535
552
|
getRaycaster() {
|
|
536
553
|
|
|
537
554
|
return _raycaster;
|
|
@@ -632,7 +649,13 @@
|
|
|
632
649
|
function onPointerDown( event ) {
|
|
633
650
|
|
|
634
651
|
if ( ! this.enabled ) return;
|
|
635
|
-
|
|
652
|
+
|
|
653
|
+
if ( ! document.pointerLockElement ) {
|
|
654
|
+
|
|
655
|
+
this.domElement.setPointerCapture( event.pointerId );
|
|
656
|
+
|
|
657
|
+
}
|
|
658
|
+
|
|
636
659
|
this.domElement.addEventListener( 'pointermove', this._onPointerMove );
|
|
637
660
|
this.pointerHover( this._getPointer( event ) );
|
|
638
661
|
this.pointerDown( this._getPointer( event ) );
|
|
@@ -5,9 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Formulas collected from various sources
|
|
7
7
|
* http://mathworld.wolfram.com/HeartCurve.html
|
|
8
|
-
* http://mathdl.maa.org/images/upload_library/23/stemkoski/knots/page6.html
|
|
9
8
|
* http://en.wikipedia.org/wiki/Viviani%27s_curve
|
|
10
|
-
* http://mathdl.maa.org/images/upload_library/23/stemkoski/knots/page4.html
|
|
11
9
|
* http://www.mi.sanu.ac.rs/vismath/taylorapril2011/Taylor.pdf
|
|
12
10
|
* https://prideout.net/blog/old/blog/index.html@p=44.html
|
|
13
11
|
*/
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
( function () {
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Ascii generation is based on
|
|
5
|
-
* Maybe more about this later with a blog post at http://lab4games.net/zz85/blog
|
|
4
|
+
* Ascii generation is based on https://github.com/hassadee/jsascii/blob/master/jsascii.js
|
|
6
5
|
*
|
|
7
6
|
* 16 April 2012 - @blurspline
|
|
8
7
|
*/
|
|
@@ -50,13 +49,7 @@
|
|
|
50
49
|
|
|
51
50
|
};
|
|
52
51
|
|
|
53
|
-
this.domElement = domElement; // Throw in ascii library from
|
|
54
|
-
|
|
55
|
-
/*
|
|
56
|
-
* jsAscii 0.1
|
|
57
|
-
* Copyright (c) 2008 Jacob Seidelin, jseidelin@nihilogic.dk, http://blog.nihilogic.dk/
|
|
58
|
-
* MIT License [http://www.nihilogic.dk/licenses/mit-license.txt]
|
|
59
|
-
*/
|
|
52
|
+
this.domElement = domElement; // Throw in ascii library from https://github.com/hassadee/jsascii/blob/master/jsascii.js (MIT License)
|
|
60
53
|
|
|
61
54
|
function initAsciiSize() {
|
|
62
55
|
|
|
@@ -2034,7 +2034,7 @@
|
|
|
2034
2034
|
/**
|
|
2035
2035
|
* Specular-Glossiness Extension
|
|
2036
2036
|
*
|
|
2037
|
-
* Specification: https://github.com/KhronosGroup/glTF/tree/
|
|
2037
|
+
* Specification: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Archived/KHR_materials_pbrSpecularGlossiness
|
|
2038
2038
|
*/
|
|
2039
2039
|
|
|
2040
2040
|
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
*
|
|
43
43
|
* Code converted from my ancient SPD software, http://tog.acm.org/resources/SPD/
|
|
44
44
|
* Created for the Udacity course "Interactive Rendering", http://bit.ly/ericity
|
|
45
|
-
* Lesson: https://www.udacity.com/course/viewer#!/c-cs291/l-68866048/m-106482448
|
|
46
45
|
* YouTube video on teapot history: https://www.youtube.com/watch?v=DxMfblPzFNc
|
|
47
46
|
*
|
|
48
47
|
* See https://en.wikipedia.org/wiki/Utah_teapot for the history of the teapot
|
|
@@ -12,13 +12,15 @@
|
|
|
12
12
|
this.pointTopLeft = new THREE.Vector2();
|
|
13
13
|
this.pointBottomRight = new THREE.Vector2();
|
|
14
14
|
this.isDown = false;
|
|
15
|
-
|
|
15
|
+
|
|
16
|
+
this.onPointerDown = function ( event ) {
|
|
16
17
|
|
|
17
18
|
this.isDown = true;
|
|
18
19
|
this.onSelectStart( event );
|
|
19
20
|
|
|
20
|
-
}.bind( this )
|
|
21
|
-
|
|
21
|
+
}.bind( this );
|
|
22
|
+
|
|
23
|
+
this.onPointerMove = function ( event ) {
|
|
22
24
|
|
|
23
25
|
if ( this.isDown ) {
|
|
24
26
|
|
|
@@ -26,13 +28,26 @@
|
|
|
26
28
|
|
|
27
29
|
}
|
|
28
30
|
|
|
29
|
-
}.bind( this )
|
|
30
|
-
|
|
31
|
+
}.bind( this );
|
|
32
|
+
|
|
33
|
+
this.onPointerUp = function () {
|
|
31
34
|
|
|
32
35
|
this.isDown = false;
|
|
33
|
-
this.onSelectOver(
|
|
36
|
+
this.onSelectOver();
|
|
37
|
+
|
|
38
|
+
}.bind( this );
|
|
39
|
+
|
|
40
|
+
this.renderer.domElement.addEventListener( 'pointerdown', this.onPointerDown );
|
|
41
|
+
this.renderer.domElement.addEventListener( 'pointermove', this.onPointerMove );
|
|
42
|
+
this.renderer.domElement.addEventListener( 'pointerup', this.onPointerUp );
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
dispose() {
|
|
34
47
|
|
|
35
|
-
|
|
48
|
+
this.renderer.domElement.removeEventListener( 'pointerdown', this.onPointerDown );
|
|
49
|
+
this.renderer.domElement.removeEventListener( 'pointermove', this.onPointerMove );
|
|
50
|
+
this.renderer.domElement.removeEventListener( 'pointerup', this.onPointerUp );
|
|
36
51
|
|
|
37
52
|
}
|
|
38
53
|
|
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
const ltc_float_2 = new Float32Array( LTC_MAT_2 );
|
|
29
29
|
THREE.UniformsLib.LTC_FLOAT_1 = new THREE.DataTexture( ltc_float_1, 64, 64, THREE.RGBAFormat, THREE.FloatType, THREE.UVMapping, THREE.ClampToEdgeWrapping, THREE.ClampToEdgeWrapping, THREE.LinearFilter, THREE.NearestFilter, 1 );
|
|
30
30
|
THREE.UniformsLib.LTC_FLOAT_2 = new THREE.DataTexture( ltc_float_2, 64, 64, THREE.RGBAFormat, THREE.FloatType, THREE.UVMapping, THREE.ClampToEdgeWrapping, THREE.ClampToEdgeWrapping, THREE.LinearFilter, THREE.NearestFilter, 1 );
|
|
31
|
+
THREE.UniformsLib.LTC_FLOAT_1.needsUpdate = true;
|
|
32
|
+
THREE.UniformsLib.LTC_FLOAT_2.needsUpdate = true;
|
|
31
33
|
const ltc_half_1 = new Uint16Array( LTC_MAT_1.length );
|
|
32
34
|
LTC_MAT_1.forEach( function ( x, index ) {
|
|
33
35
|
|
|
@@ -42,6 +44,8 @@
|
|
|
42
44
|
} );
|
|
43
45
|
THREE.UniformsLib.LTC_HALF_1 = new THREE.DataTexture( ltc_half_1, 64, 64, THREE.RGBAFormat, THREE.HalfFloatType, THREE.UVMapping, THREE.ClampToEdgeWrapping, THREE.ClampToEdgeWrapping, THREE.LinearFilter, THREE.NearestFilter, 1 );
|
|
44
46
|
THREE.UniformsLib.LTC_HALF_2 = new THREE.DataTexture( ltc_half_2, 64, 64, THREE.RGBAFormat, THREE.HalfFloatType, THREE.UVMapping, THREE.ClampToEdgeWrapping, THREE.ClampToEdgeWrapping, THREE.LinearFilter, THREE.NearestFilter, 1 );
|
|
47
|
+
THREE.UniformsLib.LTC_HALF_1.needsUpdate = true;
|
|
48
|
+
THREE.UniformsLib.LTC_HALF_2.needsUpdate = true;
|
|
45
49
|
|
|
46
50
|
}
|
|
47
51
|
|
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
* Description: Early release of an AMF THREE.Loader following the pattern of the
|
|
5
5
|
* example loaders in the three.js project.
|
|
6
6
|
*
|
|
7
|
-
* More information about the AMF format: http://amf.wikispaces.com
|
|
8
|
-
*
|
|
9
7
|
* Usage:
|
|
10
8
|
* const loader = new AMFLoader();
|
|
11
9
|
* loader.load('/path/to/project.amf', function(objecttree) {
|
|
@@ -1145,7 +1145,7 @@
|
|
|
1145
1145
|
|
|
1146
1146
|
case 'transparent':
|
|
1147
1147
|
data[ child.nodeName ] = {
|
|
1148
|
-
opaque: child.getAttribute( 'opaque' ),
|
|
1148
|
+
opaque: child.hasAttribute( 'opaque' ) ? child.getAttribute( 'opaque' ) : 'A_ONE',
|
|
1149
1149
|
data: parseEffectParameter( child )
|
|
1150
1150
|
};
|
|
1151
1151
|
break;
|
|
@@ -1597,7 +1597,6 @@
|
|
|
1597
1597
|
break;
|
|
1598
1598
|
|
|
1599
1599
|
default:
|
|
1600
|
-
material.opacity = 1 - transparency.float;
|
|
1601
1600
|
console.warn( 'THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.', transparent.opaque );
|
|
1602
1601
|
|
|
1603
1602
|
}
|