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

Function SceneContent

src/components/viewer3d/Scene3D.tsx:96–262  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

94}
95
96function SceneContent() {
97 const {
98 data: {
99 reconstruction,
100 wasmReconstruction,
101 splatFile,
102 isIdle,
103 autoHideElements,
104 showAutoHideEditor,
105 viewResetTrigger,
106 viewDirection,
107 viewTrigger,
108 transform,
109 splatTransform,
110 requestedSplatBackend,
111 splatBackendAvailability,
112 splatBackendResolution,
113 splatsVisible,
114 urlProgress,
115 },
116 actions: {
117 setSparkBackendAvailable,
118 },
119 } = useSceneContentStoreFacade();
120 // Use shared alignment mode (includes point picking AND floor detection)
121 const isAlignmentMode = useIsAlignmentMode();
122
123 const bounds = useMemo(() => {
124 return buildSceneBounds(reconstruction, wasmReconstruction);
125 }, [reconstruction, wasmReconstruction]);
126
127 const cameras = useCamerasNode();
128 const axes = useAxesNode();
129 const grid = useGridNode();
130 const gizmo = useGizmoNode();
131 const webGpuSplatCanvasMounted = shouldMountWebGpuSplatCanvas(
132 requestedSplatBackend,
133 splatBackendAvailability,
134 splatFile
135 );
136 const sparkSplatLayerNeeded = splatFile
137 && shouldPreloadSparkSplatRuntime(requestedSplatBackend, splatBackendAvailability);
138
139 // Compute transforms for visual preview. The active transform wraps COLMAP
140 // content, while the splat transform is persisted after Apply because raw
141 // splat geometry cannot be baked into the source file.
142 const {
143 transformMatrix,
144 splatTransformMatrix,
145 webGpuSplatModelMatrix,
146 transformedCenter,
147 } = useMemo(() => {
148 const sim3d = isIdentityEuler(transform) ? null : createSim3dFromEuler(transform);
149 const splatSim3d = isIdentityEuler(splatTransform) ? null : createSim3dFromEuler(splatTransform);
150 const matrix = sim3d ? sim3dToMatrix4(sim3d) : null;
151 const splatMatrix = splatSim3d ? sim3dToMatrix4(splatSim3d) : null;
152 const webGpuMatrix = sim3d && splatSim3d
153 ? sim3dToMatrix4(composeSim3d(sim3d, splatSim3d))

Callers

nothing calls this directly

Calls 15

useIsAlignmentModeFunction · 0.90
buildSceneBoundsFunction · 0.90
useCamerasNodeFunction · 0.90
useAxesNodeFunction · 0.90
useGridNodeFunction · 0.90
useGizmoNodeFunction · 0.90
isIdentityEulerFunction · 0.90
createSim3dFromEulerFunction · 0.90
sim3dToMatrix4Function · 0.90

Tested by

no test coverage detected