@inweb/viewer-three 26.10.5 → 26.10.6

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.
@@ -21,7 +21,7 @@
21
21
  // acknowledge and accept the above terms.
22
22
  ///////////////////////////////////////////////////////////////////////////////
23
23
 
24
- import { draggersRegistry, commandsRegistry, componentsRegistry, Loader, loadersRegistry, Options, CANVAS_EVENTS } from '@inweb/viewer-core';
24
+ import { draggersRegistry, commandsRegistry, Options, componentsRegistry, Loader, loadersRegistry, CANVAS_EVENTS } from '@inweb/viewer-core';
25
25
  export * from '@inweb/viewer-core';
26
26
  import { Line, Vector3, BufferGeometry, Float32BufferAttribute, LineBasicMaterial, Mesh, MeshBasicMaterial, DoubleSide, EventDispatcher, MOUSE, TOUCH, Spherical, Quaternion, Vector2, Plane, Object3D, Line3, Matrix4, Vector4, MathUtils, Raycaster, EdgesGeometry, Controls, Clock, Sphere, Box3, Color, PerspectiveCamera, OrthographicCamera, AmbientLight, DirectionalLight, HemisphereLight, MeshPhongMaterial, WebGLRenderTarget, UnsignedByteType, RGBAFormat, CylinderGeometry, Sprite, CanvasTexture, SRGBColorSpace, SpriteMaterial, LoadingManager, LoaderUtils, TextureLoader, BufferAttribute, PointsMaterial, Points, TriangleStripDrawMode, TriangleFanDrawMode, LineSegments, LineLoop, Group, NormalBlending, UniformsUtils, ShaderMaterial, AdditiveBlending, HalfFloatType, Scene, WebGLRenderer, LinearSRGBColorSpace } from 'three';
27
27
  import { TransformControls } from 'three/examples/jsm/controls/TransformControls.js';
@@ -752,6 +752,9 @@ class OrbitDragger {
752
752
  this.orbit.object = this.viewer.camera;
753
753
  this.orbit.update();
754
754
  };
755
+ this.optionsChange = ({ data: options }) => {
756
+ this.orbit.zoomSpeed = Math.abs(this.orbit.zoomSpeed) * (options.reverseZoomWheel ? -1 : 1);
757
+ };
755
758
  this.controlsStart = () => {
756
759
  this.changed = false;
757
760
  };
@@ -807,6 +810,7 @@ class OrbitDragger {
807
810
  this.viewer.addEventListener("zoom", this.updateControls);
808
811
  this.viewer.addEventListener("drawviewpoint", this.updateControls);
809
812
  this.viewer.addEventListener("changecameramode", this.updateControlsCamera);
813
+ this.viewer.addEventListener("optionschange", this.optionsChange);
810
814
  this.viewer.addEventListener("contextmenu", this.stopContextMenu);
811
815
  this.updateControls();
812
816
  }
@@ -817,6 +821,7 @@ class OrbitDragger {
817
821
  this.viewer.removeEventListener("zoom", this.updateControls);
818
822
  this.viewer.removeEventListener("drawviewpoint", this.updateControls);
819
823
  this.viewer.removeEventListener("changecameramode", this.updateControlsCamera);
824
+ this.viewer.removeEventListener("optionschange", this.optionsChange);
820
825
  this.viewer.removeEventListener("contextmenu", this.stopContextMenu);
821
826
  this.orbit.removeEventListener("start", this.controlsStart);
822
827
  this.orbit.removeEventListener("change", this.controlsChange);
@@ -2703,8 +2708,9 @@ class HighlighterComponent {
2703
2708
  });
2704
2709
  }
2705
2710
  syncHighlightColors() {
2706
- const { facesColor, facesTransparancy, facesOverlap } = this.viewer.options;
2707
- const { edgesColor, edgesVisibility, edgesOverlap } = this.viewer.options;
2711
+ const options = this.viewer.options.enableCustomHighlight ? this.viewer.options : Options.defaults();
2712
+ const { facesColor, facesTransparancy, facesOverlap } = options;
2713
+ const { edgesColor, edgesVisibility, edgesOverlap } = options;
2708
2714
  this.facesMaterial.color.setRGB(facesColor.r / 255, facesColor.g / 255, facesColor.b / 255);
2709
2715
  this.facesMaterial.opacity = (255 - facesTransparancy) / 255;
2710
2716
  this.facesMaterial.depthTest = !facesOverlap;