@threlte/xr
Version:
Tools to more easily create VR and AR experiences with Threlte
12 lines (11 loc) • 300 B
JavaScript
class XROriginState {
current = $state.raw();
}
const origin = new XROriginState();
/**
* Returns XR-scoped origin state for the current `<XR>` tree. `current` is the
* mounted `<XROrigin>` group when present, otherwise `undefined`.
*/
export const useXROrigin = () => {
return origin;
};