Changes
Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
@@ -51,10 +51,13 @@ const WristToggle = forwardRef<THREE.Group, { open: boolean; onToggle: () => voi
|
||||
export function XRHudInWorld(props: XRHudInWorldProps) {
|
||||
const { camera } = useThree();
|
||||
const leftCtrl = useXRInputSourceState('controller', 'left');
|
||||
const rightCtrl = useXRInputSourceState('controller', 'right');
|
||||
const [open, setOpen] = useState(true);
|
||||
const [tab, setTab] = useState<Tab>('scene');
|
||||
/** When pinned, the panel stays fixed in world space and does NOT follow the head. */
|
||||
const [pinned, setPinned] = useState(true);
|
||||
/** While true, the panel is glued to the right controller (drag mode). */
|
||||
const [dragging, setDragging] = useState(false);
|
||||
/** Forces re-anchor on next frame (used by "trazer" / unpin→pin). */
|
||||
const reanchorRequested = useRef(true);
|
||||
|
||||
@@ -63,6 +66,10 @@ export function XRHudInWorld(props: XRHudInWorldProps) {
|
||||
const targetPos = useRef(new THREE.Vector3());
|
||||
const targetQuat = useRef(new THREE.Quaternion());
|
||||
const lastABtn = useRef(false);
|
||||
/** Cached offset from controller to panel at drag start. */
|
||||
const dragOffsetPos = useRef(new THREE.Vector3());
|
||||
const dragOffsetQuat = useRef(new THREE.Quaternion());
|
||||
const dragInitialized = useRef(false);
|
||||
|
||||
useFrame(() => {
|
||||
// Toggle via left A button (Quest Touch buttons[4])
|
||||
|
||||
Reference in New Issue
Block a user