feat move debug cube with remote hand tracking

This commit is contained in:
Tom Boullay
2026-04-27 16:07:54 +02:00
parent fa8bc229c3
commit 9c602cdc63
10 changed files with 430 additions and 5 deletions
@@ -0,0 +1,26 @@
import type { ReactNode } from "react";
import { useSceneMode } from "@/hooks/debug/useSceneMode";
import {
HAND_TRACKING_IDLE_SNAPSHOT,
HandTrackingContext,
} from "@/hooks/useHandTrackingSnapshot";
import { useRemoteHandTracking } from "@/hooks/useRemoteHandTracking";
import { isDebugEnabled } from "@/utils/debug/isDebugEnabled";
export function HandTrackingProvider({
children,
}: {
children: ReactNode;
}): React.JSX.Element {
const sceneMode = useSceneMode();
const enabled = isDebugEnabled() && sceneMode === "physics";
const snapshot = useRemoteHandTracking({ enabled });
return (
<HandTrackingContext
value={enabled ? snapshot : HAND_TRACKING_IDLE_SNAPSHOT}
>
{children}
</HandTrackingContext>
);
}