@needle-tools/three 0.146.8 → 0.146.10

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.
@@ -221,9 +221,15 @@ class OrbitControls extends EventDispatcher {
221
221
  spherical.phi = Math.max( scope.minPolarAngle, Math.min( scope.maxPolarAngle, spherical.phi ) );
222
222
 
223
223
  spherical.makeSafe();
224
+ if ( scope.enableDamping ) {
224
225
 
226
+ currentScale = MathUtils.lerp(currentScale, scale, scope.dampingFactor);
225
227
 
226
- currentScale = MathUtils.lerp(currentScale, scale, scope.dampingFactor);
228
+ } else {
229
+
230
+ currentScale = scale;
231
+
232
+ }
227
233
 
228
234
  spherical.radius *= currentScale;
229
235
 
@@ -812,6 +812,11 @@ class GLTFMaterialsClearcoatExtension {
812
812
  * Draft Specification: https://github.com/ux3d/glTF/tree/extensions/KHR_animation_pointer/extensions/2.0/Khronos/KHR_animation_pointer
813
813
  */
814
814
 
815
+
816
+ // HACK monkey patching findNode to ensure we can map to other types required by KHR_animation_pointer.
817
+ const find = PropertyBinding.findNode;
818
+ const _animationPointerDebug = false;
819
+
815
820
  class GLTFAnimationPointerExtension {
816
821
 
817
822
  ANIMATION_TARGET_TYPE = {
@@ -828,23 +833,19 @@ class GLTFAnimationPointerExtension {
828
833
 
829
834
  }
830
835
 
831
- _animationPointerDebug = false;
832
836
  _havePatchedPropertyBindings = false;
833
837
  _patchPropertyBindingFindNode() {
834
838
 
835
839
  if ( this._havePatchedPropertyBindings ) return;
836
840
  this._havePatchedPropertyBindings = true;
837
841
 
838
- // HACK monkey patching findNode to ensure we can map to other types required by KHR_animation_pointer.
839
- const find = PropertyBinding.findNode;
840
-
841
842
  // "node" is the Animator component in our case
842
843
  // "path" is the animated property path, just with translated material names.
843
- PropertyBinding.findNode = ( node, path ) => {
844
+ PropertyBinding.findNode = function ( node, path ) {
844
845
 
845
846
  if ( path.startsWith( '.materials.' ) ) {
846
847
 
847
- if ( this._animationPointerDebug ) console.log( 'FIND', path );
848
+ if ( _animationPointerDebug ) console.log( 'FIND', path );
848
849
 
849
850
  const remainingPath = path.substring( '.materials.'.length ).substring( path.indexOf( '.' ) );
850
851
  const nextIndex = remainingPath.indexOf( '.' );
@@ -856,7 +857,7 @@ class GLTFAnimationPointerExtension {
856
857
  if ( x[ 'material' ]?.uuid === uuid || x[ 'material' ]?.name === uuid ) {
857
858
 
858
859
  res = x[ 'material' ];
859
- if ( this._animationPointerDebug ) console.log( res, remainingPath );
860
+ if ( _animationPointerDebug ) console.log( res, remainingPath );
860
861
  if ( res !== null ) {
861
862
 
862
863
  if ( remainingPath.endsWith( '.map' ) )
@@ -895,7 +896,7 @@ class GLTFAnimationPointerExtension {
895
896
  let key = val;
896
897
  if ( index >= 0 ) key = index;
897
898
  currentTarget = currentTarget[ key ];
898
- if ( this._animationPointerDebug )
899
+ if ( _animationPointerDebug )
899
900
  console.log( currentTarget );
900
901
 
901
902
  } else {
@@ -920,7 +921,7 @@ class GLTFAnimationPointerExtension {
920
921
 
921
922
  }
922
923
 
923
- if ( this._animationPointerDebug )
924
+ if ( _animationPointerDebug )
924
925
  console.log( 'NODE', path, currentTarget );
925
926
 
926
927
  return currentTarget;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/three",
3
- "version": "0.146.8",
3
+ "version": "0.146.10",
4
4
  "description": "JavaScript 3D library",
5
5
  "type": "module",
6
6
  "main": "./build/three.js",