bimatter-viewer-react 0.8.5 → 0.9.0
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/lib/Camera/FirstPersonControls.d.ts +11 -0
- package/lib/api/ViewerApi.d.ts +4 -2
- package/lib/api/ViewerPlansApi.d.ts +10 -3
- package/lib/index.js +2837 -2217
- package/lib/types.d.ts +7 -0
- package/lib/utils/ClippingUtils/ClippingCaps.d.ts +3 -1
- package/lib/utils/ClippingUtils/ClippingEdges.d.ts +3 -0
- package/lib/utils/ClippingUtils/ClippingUtils.d.ts +7 -1
- package/package.json +1 -1
package/lib/types.d.ts
CHANGED
|
@@ -9,6 +9,13 @@ export type ViewerCameraRef = RefObject<Camera | null>;
|
|
|
9
9
|
export type ViewerControlsRef = RefObject<CameraControlsImpl | null>;
|
|
10
10
|
export type ViewerLightRef = RefObject<DirectionalLight | null>;
|
|
11
11
|
export type ViewerCameraProjection = "perspective" | "orthographic";
|
|
12
|
+
export type ViewerFirstPersonControlSettings = {
|
|
13
|
+
eyeHeight?: number;
|
|
14
|
+
groundCheckInterval?: number;
|
|
15
|
+
groundSnapDistanceRatio?: number;
|
|
16
|
+
lookSensitivity?: number;
|
|
17
|
+
speed?: number;
|
|
18
|
+
};
|
|
12
19
|
export type ViewerMaterialMode = "quality" | "performance";
|
|
13
20
|
export type ViewerPostproductionPassType = "N8AO" | "SSAO" | null;
|
|
14
21
|
export type ViewerUploadMode = "smooth" | "balanced" | "fast";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BufferGeometry, Mesh, Plane, Vector3 } from "three";
|
|
1
|
+
import { BufferGeometry, Group, Mesh, Plane, Vector3 } from "three";
|
|
2
2
|
import type { ClippingUtils } from "./ClippingUtils";
|
|
3
3
|
type CapPreselection = {
|
|
4
4
|
elementID: number;
|
|
@@ -21,6 +21,7 @@ export declare class ClippingCaps {
|
|
|
21
21
|
private readonly worldPoint;
|
|
22
22
|
private capClippingPlanesKey;
|
|
23
23
|
private capShader;
|
|
24
|
+
private readonly capShaders;
|
|
24
25
|
private closeGapTolerance;
|
|
25
26
|
private preselection;
|
|
26
27
|
private tolerance;
|
|
@@ -30,6 +31,7 @@ export declare class ClippingCaps {
|
|
|
30
31
|
setVisible(visible: boolean): void;
|
|
31
32
|
syncMeshes(): void;
|
|
32
33
|
getSelectableObject(): Mesh<BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>;
|
|
34
|
+
getObject(): Group<import("three").Object3DEventMap>;
|
|
33
35
|
getSnapPoints(point: Vector3, distance: number): Vector3[];
|
|
34
36
|
setPreselection(preselection: CapPreselection): void;
|
|
35
37
|
updateColors(): void;
|
|
@@ -24,13 +24,16 @@ export declare class ClippingEdges {
|
|
|
24
24
|
private readonly tempVector2;
|
|
25
25
|
private readonly tempVector3;
|
|
26
26
|
private readonly intersectionSegments;
|
|
27
|
+
private cameraMotionHidden;
|
|
27
28
|
constructor(context: ClippingUtils, plane: Plane);
|
|
28
29
|
create(): LineSegments<BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>[];
|
|
29
30
|
syncMeshes(): void;
|
|
30
31
|
dispose(): void;
|
|
31
32
|
setVisible(visible: boolean): void;
|
|
33
|
+
setCameraMotionHidden(hidden: boolean): void;
|
|
32
34
|
toggle(): void;
|
|
33
35
|
getIntersectionSegments(): ClippingIntersectionSegment[];
|
|
36
|
+
getObjects(includeCameraMotionHidden?: boolean): LineSegments<BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, import("three").Material<import("three").MaterialEventMap> | import("three").Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>[];
|
|
34
37
|
update(): void;
|
|
35
38
|
private getTriangleElementID;
|
|
36
39
|
}
|
|
@@ -12,6 +12,7 @@ type ClippingContext = {
|
|
|
12
12
|
controlRef: ViewerControlsRef;
|
|
13
13
|
domElement: HTMLCanvasElement;
|
|
14
14
|
modelRef: ViewerModelRef;
|
|
15
|
+
onVisualChange?: () => void;
|
|
15
16
|
raycaster: Raycaster;
|
|
16
17
|
renderer: WebGLRenderer;
|
|
17
18
|
scene: Scene;
|
|
@@ -61,6 +62,7 @@ export declare class ClippingUtils {
|
|
|
61
62
|
private capsColor;
|
|
62
63
|
private context;
|
|
63
64
|
private edgesActive;
|
|
65
|
+
private edgesCameraMotionActive;
|
|
64
66
|
private helperDragActive;
|
|
65
67
|
private helpersActive;
|
|
66
68
|
private helperHoverMoveState;
|
|
@@ -84,6 +86,7 @@ export declare class ClippingUtils {
|
|
|
84
86
|
getUseWebGPU(): boolean;
|
|
85
87
|
getControlRef(): ViewerControlsRef;
|
|
86
88
|
getMeshes(): Mesh<import("three").BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, Material<import("three").MaterialEventMap> | Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>[];
|
|
89
|
+
getPlanVisualObjects(): (import("three").Group<import("three").Object3DEventMap> | import("three").LineSegments<import("three").BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, Material<import("three").MaterialEventMap> | Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>)[];
|
|
87
90
|
getObjectModelID(object: Object3D): number;
|
|
88
91
|
getEdgeSegmentsForPlane(plane: Plane): readonly ClippingIntersectionSegment[] | null;
|
|
89
92
|
getSelectableObjects(): Mesh<import("three").BufferGeometry<import("three").NormalBufferAttributes, import("three").BufferGeometryEventMap>, Material<import("three").MaterialEventMap> | Material<import("three").MaterialEventMap>[], import("three").Object3DEventMap>[];
|
|
@@ -97,6 +100,7 @@ export declare class ClippingUtils {
|
|
|
97
100
|
getHelperDragActive(): boolean;
|
|
98
101
|
setHelperDragActive(active: boolean): void;
|
|
99
102
|
setCapsCameraMotionActive(active: boolean): void;
|
|
103
|
+
setEdgesCameraMotionActive(active: boolean): void;
|
|
100
104
|
setCapsDragActive(active: boolean): void;
|
|
101
105
|
requestCapsDragIdleUpdate(): void;
|
|
102
106
|
private clearCapsDragIdleTimeout;
|
|
@@ -130,10 +134,12 @@ export declare class ClippingUtils {
|
|
|
130
134
|
syncWithModel(): void;
|
|
131
135
|
dispose(): void;
|
|
132
136
|
}
|
|
133
|
-
export declare function useClippingUtils(modelRef: ViewerModelRef, controlRef: ViewerControlsRef, cameraUtils: CameraUtilsApi, useWebGPU?: boolean): ViewerClippingApi & {
|
|
137
|
+
export declare function useClippingUtils(modelRef: ViewerModelRef, controlRef: ViewerControlsRef, cameraUtils: CameraUtilsApi, useWebGPU?: boolean, onVisualChange?: () => void): ViewerClippingApi & {
|
|
134
138
|
getSelectableObjects: () => Object3D[];
|
|
135
139
|
getSnapPoints: (point: Vector3, distance: number) => Vector3[];
|
|
140
|
+
getPlanVisualObjects: () => Object3D[];
|
|
136
141
|
setCapsCameraMotionActive: (active: boolean) => void;
|
|
142
|
+
setEdgesCameraMotionActive: (active: boolean) => void;
|
|
137
143
|
setCapsPreselection: (preselection: ClippingPreselection) => void;
|
|
138
144
|
syncWithModel: () => void;
|
|
139
145
|
};
|