🚀 Auto-deploy: melhoria no snap e medição AR em 30/05/2026 10:56:12
This commit is contained in:
@@ -422,7 +422,7 @@ function computeWorldPerPixel(
|
||||
worldPos: THREE.Vector3,
|
||||
): number {
|
||||
const ortho = camera as THREE.OrthographicCamera;
|
||||
if ((ortho as any).isOrthographicCamera) {
|
||||
if ('isOrthographicCamera' in ortho) {
|
||||
const visibleHeight = (ortho.top - ortho.bottom) / (ortho.zoom || 1);
|
||||
return visibleHeight / Math.max(1, size.height);
|
||||
}
|
||||
@@ -1176,7 +1176,7 @@ function SectionClippingApplier() {
|
||||
mat.needsUpdate = true;
|
||||
}
|
||||
};
|
||||
}, [enabled.x, enabled.y, enabled.z, invert.x, invert.y, invert.z, level.x, level.y, level.z, planes]);
|
||||
}, [enabled.x, enabled.y, enabled.z, invert, invert.x, invert.y, invert.z, level, level.x, level.y, level.z, planes]);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -1335,7 +1335,7 @@ function WalkControls() {
|
||||
const setWalkMode = useModelStore(s => s.setWalkMode);
|
||||
const gridY = useModelStore(s => s.gridY);
|
||||
const { camera } = useThree();
|
||||
const controlsRef = useRef<any>(null);
|
||||
const controlsRef = useRef<{ lock: () => void } | null>(null);
|
||||
const keys = useRef({ w: false, a: false, s: false, d: false, shift: false });
|
||||
const initialized = useRef(false);
|
||||
|
||||
@@ -1354,7 +1354,7 @@ function WalkControls() {
|
||||
if (walkMode) {
|
||||
// Small timeout to allow canvas to render and be clickable
|
||||
const timer = setTimeout(() => {
|
||||
try { controlsRef.current?.lock(); } catch (e) {}
|
||||
try { controlsRef.current?.lock(); } catch (e) { /* ignore */ }
|
||||
}, 100);
|
||||
return () => clearTimeout(timer);
|
||||
}
|
||||
@@ -1503,7 +1503,7 @@ export function ModelViewerCanvas({ url }: ModelViewerProps) {
|
||||
minZoom={5}
|
||||
maxZoom={5000}
|
||||
enabled={!positionMode && !walkMode}
|
||||
ref={(c: any) => {
|
||||
ref={(c: unknown) => {
|
||||
mainControlsRef.current = c;
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user