@needle-tools/three 0.146.3 → 0.146.5
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.cjs +32518 -32517
- package/build/three.js +32523 -32522
- package/build/three.min.js +7 -6
- package/build/three.module.js +832 -831
- package/examples/jsm/controls/OrbitControls.js +9 -4
- package/examples/jsm/loaders/GLTFLoader.js +7 -6
- package/package.json +1 -1
- package/src/animation/PropertyBinding.js +2 -2
- package/src/renderers/shaders/ShaderChunk/map_fragment.glsl.js +5 -1
- package/src/renderers/shaders/ShaderChunk/map_pars_fragment.glsl.js +4 -0
|
@@ -5,7 +5,8 @@ import {
|
|
|
5
5
|
Spherical,
|
|
6
6
|
TOUCH,
|
|
7
7
|
Vector2,
|
|
8
|
-
Vector3
|
|
8
|
+
Vector3,
|
|
9
|
+
MathUtils
|
|
9
10
|
} from 'three';
|
|
10
11
|
|
|
11
12
|
// This set of controls performs orbiting, dollying (zooming), and panning.
|
|
@@ -222,7 +223,9 @@ class OrbitControls extends EventDispatcher {
|
|
|
222
223
|
spherical.makeSafe();
|
|
223
224
|
|
|
224
225
|
|
|
225
|
-
|
|
226
|
+
currentScale = MathUtils.lerp(currentScale, scale, scope.dampingFactor);
|
|
227
|
+
|
|
228
|
+
spherical.radius *= currentScale;
|
|
226
229
|
|
|
227
230
|
// restrict radius to be between desired limits
|
|
228
231
|
spherical.radius = Math.max( scope.minDistance, Math.min( scope.maxDistance, spherical.radius ) );
|
|
@@ -338,6 +341,7 @@ class OrbitControls extends EventDispatcher {
|
|
|
338
341
|
const sphericalDelta = new Spherical();
|
|
339
342
|
|
|
340
343
|
let scale = 1;
|
|
344
|
+
let currentScale = 1;
|
|
341
345
|
const panOffset = new Vector3();
|
|
342
346
|
let zoomChanged = false;
|
|
343
347
|
|
|
@@ -836,7 +840,8 @@ class OrbitControls extends EventDispatcher {
|
|
|
836
840
|
|
|
837
841
|
if ( pointers.length === 0 ) {
|
|
838
842
|
|
|
839
|
-
|
|
843
|
+
// this causes pointer events to be captured
|
|
844
|
+
// scope.domElement.setPointerCapture( event.pointerId );
|
|
840
845
|
|
|
841
846
|
scope.domElement.addEventListener( 'pointermove', onPointerMove );
|
|
842
847
|
scope.domElement.addEventListener( 'pointerup', onPointerUp );
|
|
@@ -881,7 +886,7 @@ class OrbitControls extends EventDispatcher {
|
|
|
881
886
|
|
|
882
887
|
if ( pointers.length === 0 ) {
|
|
883
888
|
|
|
884
|
-
scope.domElement.releasePointerCapture( event.pointerId );
|
|
889
|
+
// scope.domElement.releasePointerCapture( event.pointerId );
|
|
885
890
|
|
|
886
891
|
scope.domElement.removeEventListener( 'pointermove', onPointerMove );
|
|
887
892
|
scope.domElement.removeEventListener( 'pointerup', onPointerUp );
|
|
@@ -154,7 +154,7 @@ class GLTFLoader extends Loader {
|
|
|
154
154
|
return new GLTFMeshGpuInstancing( parser );
|
|
155
155
|
|
|
156
156
|
} );
|
|
157
|
-
|
|
157
|
+
|
|
158
158
|
this.register( function ( parser ) {
|
|
159
159
|
|
|
160
160
|
return new GLTFAnimationPointerExtension( parser );
|
|
@@ -601,7 +601,7 @@ class GLTFLightsExtension {
|
|
|
601
601
|
|
|
602
602
|
}
|
|
603
603
|
|
|
604
|
-
getDependency( type, index ) {
|
|
604
|
+
getDependency( type, index ) {
|
|
605
605
|
|
|
606
606
|
if ( type !== 'light' ) return;
|
|
607
607
|
|
|
@@ -904,16 +904,17 @@ class GLTFAnimationPointerExtension {
|
|
|
904
904
|
const foundNode = node.getObjectByName( val );
|
|
905
905
|
if ( foundNode )
|
|
906
906
|
currentTarget = foundNode;
|
|
907
|
+
|
|
907
908
|
}
|
|
908
909
|
|
|
909
910
|
}
|
|
910
911
|
|
|
911
912
|
if ( ! currentTarget ) {
|
|
912
913
|
|
|
913
|
-
const originalFindResult = find
|
|
914
|
+
const originalFindResult = find( node, sections[ 2 ] );
|
|
914
915
|
|
|
915
916
|
if ( ! originalFindResult )
|
|
916
|
-
console.
|
|
917
|
+
console.warn( EXTENSIONS.KHR_ANIMATION_POINTER + ': Property binding not found', path, node, node.name, sections );
|
|
917
918
|
|
|
918
919
|
return originalFindResult;
|
|
919
920
|
|
|
@@ -1268,7 +1269,7 @@ class GLTFAnimationPointerExtension {
|
|
|
1268
1269
|
|
|
1269
1270
|
// convert fov values from radians to degrees
|
|
1270
1271
|
if ( animationPointerPropertyPath.endsWith( '.fov' ) ) {
|
|
1271
|
-
|
|
1272
|
+
|
|
1272
1273
|
outputArray = outputArray.map( value => value / Math.PI * 180 );
|
|
1273
1274
|
|
|
1274
1275
|
}
|
|
@@ -2869,7 +2870,7 @@ class GLTFParser {
|
|
|
2869
2870
|
|
|
2870
2871
|
// Use an ImageBitmapLoader if imageBitmaps are supported. Moves much of the
|
|
2871
2872
|
// expensive work of uploading a texture to the GPU off the main thread.
|
|
2872
|
-
|
|
2873
|
+
|
|
2873
2874
|
let isSafari = false;
|
|
2874
2875
|
let isFirefox = false;
|
|
2875
2876
|
let firefoxVersion = - 1;
|
package/package.json
CHANGED
|
@@ -107,7 +107,7 @@ class PropertyBinding {
|
|
|
107
107
|
this.path = path;
|
|
108
108
|
this.parsedPath = parsedPath || PropertyBinding.parseTrackName( path );
|
|
109
109
|
|
|
110
|
-
this.node = PropertyBinding.findNode( rootNode, this.parsedPath.nodeName )
|
|
110
|
+
this.node = PropertyBinding.findNode( rootNode, this.parsedPath.nodeName );
|
|
111
111
|
|
|
112
112
|
this.rootNode = rootNode;
|
|
113
113
|
|
|
@@ -423,7 +423,7 @@ class PropertyBinding {
|
|
|
423
423
|
|
|
424
424
|
if ( ! targetObject ) {
|
|
425
425
|
|
|
426
|
-
targetObject = PropertyBinding.findNode( this.rootNode, parsedPath.nodeName )
|
|
426
|
+
targetObject = PropertyBinding.findNode( this.rootNode, parsedPath.nodeName );
|
|
427
427
|
|
|
428
428
|
this.node = targetObject;
|
|
429
429
|
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
export default /* glsl */`
|
|
2
2
|
#ifdef USE_MAP
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
#ifdef USE_MIPMAP_BIAS
|
|
5
|
+
vec4 sampledDiffuseColor = texture2D( map, vUv, mipmapBias );
|
|
6
|
+
#else
|
|
7
|
+
vec4 sampledDiffuseColor = texture2D( map, vUv, -0.5 );
|
|
8
|
+
#endif
|
|
5
9
|
|
|
6
10
|
#ifdef DECODE_VIDEO_TEXTURE
|
|
7
11
|
|