@needle-tools/three 0.146.4 → 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.
@@ -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
- spherical.radius *= scale;
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/three",
3
- "version": "0.146.4",
3
+ "version": "0.146.5",
4
4
  "description": "JavaScript 3D library",
5
5
  "type": "module",
6
6
  "main": "./build/three.js",
@@ -1,7 +1,11 @@
1
1
  export default /* glsl */`
2
2
  #ifdef USE_MAP
3
3
 
4
- vec4 sampledDiffuseColor = texture2D( map, vUv );
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
 
@@ -2,6 +2,10 @@ export default /* glsl */`
2
2
  #ifdef USE_MAP
3
3
 
4
4
  uniform sampler2D map;
5
+
6
+ #ifdef USE_MIPMAP_BIAS
7
+ uniform float mipmapBias;
8
+ #endif
5
9
 
6
10
  #endif
7
11
  `;