Hi everyone,
I’m using the CameraController extensions in Speckle, and I need the orbit control functionality. While it works, I’ve noticed an issue when clicking and zooming—it always sets the orbit center at the closest intersection point, even if that point belongs to a hidden object. This is problematic because my scene contains hidden geometries that interfere with navigation.
Desired Behavior:
I’d like the orbit center to be determined by the first intersection with a visible object, ignoring hidden ones. Is there a way to control this?
I’ve tried disabling orbitAroundCursor, but this results in an awkward orbiting experience where the cursor position is ignored entirely. I know that double-clicking a visible object correctly sets it as the orbit center, but as soon as I drag, the logic resets and picks the first intersection again—including hidden objects.
async function initialiseViewer() {
if (!container.current) return;
/** Configure the viewer params */
const params = DefaultViewerParams;
params.showStats = false;
params.verbose = true;
/** Create Viewer instance */
const viewer = new Viewer(container.current, params);
await viewer.init();
const cameraController = viewer.createExtension(CameraController);
}
Additionally, I’m facing another issue: after hiding geometries, the shadows cast onto the invisible base plane don’t seem to refresh properly. Is there a way to force a shadow update?
useEffect(() => {
if (!speckleViewer) return;
const renderer = speckleViewer.getRenderer();
if (isolatedObjects.length == 0) hideUncheckedGeometries();
renderer.shadowMapNeedsUpdate = true;
renderer.updateShadowCatcher();
speckleViewer.requestRender(UpdateFlags.RENDER_RESET | UpdateFlags.SHADOWS);
}, [geometryGroups, isolatedObjects]);
Would appreciate any insights—thanks in advance!