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.
@@ -0,0 +1,11 @@
1
+ import { type MutableRefObject } from "react";
2
+ import type { ViewerControlsRef, ViewerFirstPersonControlSettings, ViewerModelRef } from "../types";
3
+ type FirstPersonControlsProps = {
4
+ active: boolean;
5
+ activeRef: MutableRefObject<boolean>;
6
+ controlRef: ViewerControlsRef;
7
+ modelRef: ViewerModelRef;
8
+ settings: ViewerFirstPersonControlSettings;
9
+ };
10
+ export default function FirstPersonControls({ active, activeRef, controlRef, modelRef, settings, }: FirstPersonControlsProps): null;
11
+ export {};
@@ -1,6 +1,6 @@
1
1
  import type { ColorRepresentation, Group } from "three";
2
2
  import type { SelectedStore, UserDevice, ViewerGridAxesVisibility, ViewerGridAxisSide, ViewerLightingSettings, ViewerLightingSettingsUpdate, ViewerPostproductionActivePassFilter, ViewerStoreApi } from "../store/ViewerStore";
3
- import type { ViewerCameraProjection, ViewerPostproductionPassType } from "../types";
3
+ import type { ViewerCameraProjection, ViewerFirstPersonControlSettings, ViewerPostproductionPassType } from "../types";
4
4
  import { type ViewerPropertiesApi } from "./ViewerPropertiesApi";
5
5
  import type { ViewerClippingApi } from "../utils/ClippingUtils";
6
6
  import type { ViewerColorConfigByModel, ViewerModelColorConfig } from "../utils/ColorsUtils/useElementColors";
@@ -15,7 +15,7 @@ export type { ViewerClippingApi, ViewerClippingVector3Input, } from "../utils/Cl
15
15
  export type { ViewerColorConfigByModel, ViewerModelColorConfig, } from "../utils/ColorsUtils/useElementColors";
16
16
  export type { ViewerDimensionsApi } from "../utils/DimentionsUtils";
17
17
  export type { ViewerCameraGetIntersection } from "../Camera/useCameraUtils";
18
- export type { ViewerCameraProjection } from "../types";
18
+ export type { ViewerCameraProjection, ViewerFirstPersonControlSettings, } from "../types";
19
19
  export type { ViewerPlanHandle, ViewerPlansApi, ViewerPlanVector3Input, } from "./ViewerPlansApi";
20
20
  export type ViewerSelection = Record<number, number[]>;
21
21
  export type ViewerGeometryUtilsApi = {
@@ -110,6 +110,8 @@ export type ViewerCameraApi = {
110
110
  fitCamera: () => void;
111
111
  getIntersection: ViewerCameraGetIntersection;
112
112
  getProjection: () => ViewerCameraProjection;
113
+ setFirstPersonControlActive: (active: boolean) => void;
114
+ setFirstPersonControlSettings: (settings: ViewerFirstPersonControlSettings) => void;
113
115
  setProjection: (projection: ViewerCameraProjection) => void;
114
116
  toggleProjection: () => ViewerCameraProjection;
115
117
  };
@@ -11,12 +11,19 @@ export type ViewerPlanHandle = {
11
11
  plane: Plane;
12
12
  viewer?: ViewerApi | null;
13
13
  };
14
+ export type ViewerPlanCreateOptions = {
15
+ createClippingPlane?: boolean;
16
+ };
14
17
  export type ViewerPlansSceneApi = {
15
- createPlan: (plane: Plane) => ViewerPlanHandle | null;
18
+ createPlan: (plane: Plane, viewNormal?: Vector3, options?: ViewerPlanCreateOptions) => ViewerPlanHandle | null;
19
+ };
20
+ export type ViewerPlanLocalPlaneSource = {
21
+ normal: Vector3;
22
+ pointOrZ: ViewerPlanVector3Input | number;
16
23
  };
17
- export type ViewerPlansContainerFactory = (plane: Plane, container: HTMLElement) => ViewerPlanHandle | null;
24
+ export type ViewerPlansContainerFactory = (plane: Plane, container: HTMLElement, viewNormal?: Vector3, localPlaneSource?: ViewerPlanLocalPlaneSource) => ViewerPlanHandle | null;
18
25
  export type ViewerPlansApi = {
19
- createPlan: ((plane: Plane, container?: HTMLElement) => ViewerPlanHandle | null) & ((point: ViewerPlanVector3Input, normal: ViewerPlanVector3Input, container?: HTMLElement) => ViewerPlanHandle | null) & ((zCord: number, normal: ViewerPlanVector3Input, container?: HTMLElement) => ViewerPlanHandle | null);
26
+ createPlan: ((plane: Plane, container?: HTMLElement) => ViewerPlanHandle | null) & ((plane: Plane, normal: ViewerPlanVector3Input, container?: HTMLElement) => ViewerPlanHandle | null) & ((point: ViewerPlanVector3Input, normal: ViewerPlanVector3Input, container?: HTMLElement) => ViewerPlanHandle | null) & ((point: ViewerPlanVector3Input, container?: HTMLElement) => ViewerPlanHandle | null) & ((zCord: number, normal: ViewerPlanVector3Input, container?: HTMLElement) => ViewerPlanHandle | null) & ((zCord: number, container?: HTMLElement) => ViewerPlanHandle | null);
20
27
  };
21
28
  export declare function createViewerPlanPlane(plane: Plane): Plane;
22
29
  export declare function createViewerPlanPlane(point: ViewerPlanVector3Input, normal: ViewerPlanVector3Input): Plane;