@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.
- package/dist/viewer-three.js +8 -2
- package/dist/viewer-three.js.map +1 -1
- package/dist/viewer-three.min.js +1 -1
- package/dist/viewer-three.module.js +9 -3
- package/dist/viewer-three.module.js.map +1 -1
- package/lib/Viewer/draggers/OrbitDragger.d.ts +3 -0
- package/package.json +5 -5
- package/src/Viewer/components/HighlighterComponent.ts +5 -3
- package/src/Viewer/draggers/OrbitDragger.ts +6 -0
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
// acknowledge and accept the above terms.
|
|
22
22
|
///////////////////////////////////////////////////////////////////////////////
|
|
23
23
|
|
|
24
|
-
import { draggersRegistry, commandsRegistry, componentsRegistry, Loader, loadersRegistry,
|
|
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
|
|
2707
|
-
const {
|
|
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;
|