MCPcopy Index your code
hub / github.com/ColmapView/Colmapview.github.io / useCamerasNode

Function useCamerasNode

src/nodes/hooks/useCamerasNode.ts:5–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3import type { CamerasNode } from '../types';
4
5export function useCamerasNode(): CamerasNode {
6 const showCameras = useCameraStore((s) => s.showCameras);
7 const cameraDisplayMode = useCameraStore((s) => s.cameraDisplayMode);
8 const cameraScale = useCameraStore((s) => s.cameraScale);
9 const cameraScaleFactor = useCameraStore((s) => s.cameraScaleFactor);
10 const frustumColorMode = useCameraStore((s) => s.frustumColorMode);
11 const frustumSingleColor = useCameraStore((s) => s.frustumSingleColor);
12 const frustumStandbyOpacity = useCameraStore((s) => s.frustumStandbyOpacity);
13 const frustumLineWidth = useCameraStore((s) => s.frustumLineWidth);
14 const undistortionEnabled = useCameraStore((s) => s.undistortionEnabled);
15 const undistortionMode = useCameraStore((s) => s.undistortionMode);
16
17 return useMemo<CamerasNode>(
18 () => ({
19 nodeType: 'cameras',
20 visible: showCameras,
21 displayMode: cameraDisplayMode,
22 scale: cameraScale,
23 scaleFactor: cameraScaleFactor,
24 colorMode: frustumColorMode,
25 singleColor: frustumSingleColor,
26 standbyOpacity: frustumStandbyOpacity,
27 lineWidth: frustumLineWidth,
28 undistortionEnabled,
29 undistortionMode,
30 }),
31 [
32 showCameras,
33 cameraDisplayMode,
34 cameraScale,
35 cameraScaleFactor,
36 frustumColorMode,
37 frustumSingleColor,
38 frustumStandbyOpacity,
39 frustumLineWidth,
40 undistortionEnabled,
41 undistortionMode,
42 ]
43 );
44}

Callers 7

CameraMatchesFunction · 0.90
TrackballControlsFunction · 0.90
SceneContentFunction · 0.90
nodes.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected