@threlte/xr
Version:
Tools to more easily create VR and AR experiences with Threlte
14 lines (13 loc) • 534 B
JavaScript
import { isPresenting, isHandTracking, session, xr } from '../internal/state.svelte.js';
import { runeToCurrentReadable } from './currentReadable.svelte.js';
/**
* Provides access to context related to `<XR />`.
*/
export const useXR = () => {
return {
isPresenting: runeToCurrentReadable(() => isPresenting.current),
isHandTracking: runeToCurrentReadable(() => isHandTracking.current),
session: runeToCurrentReadable(() => session.current),
xr: runeToCurrentReadable(() => xr.current)
};
};