-
-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow custom optional features for VRButton #67
Comments
I am 100% an idiot, but how in the actual hell did you actually import VRButton?
when I try: import { VRCanvas, VRButton} from 'https://cdn.skypack.dev/@react-three/xr' I've also tried stuff like
and none of that works either. ... actually... is there a page somewhere that lists where to import everything from everything? I've crawled all over this rep and the docs website and I'm lost. |
@andrew-luhring, it's imported privately (and later bundled without export) in // Configures layers with R3F (see https://threejs.org/examples/#webxr_vr_layers)
<VRCanvas sessionInit={{ optionalFeatures: [ 'local-floor', 'bounded-floor', 'hand-tracking', 'layers' ] }} /> I don't believe it's intended to be exported separately (as this is a react-focused lib), but you can try changing the path there to import { VRButton } from '@react-three/xr/src/webxr/VRButton.js' Exports would be: @react-three/xr
├── ARCanvas
├── DefaultXRControllers
├── Hands
├── InteractionManager
├── InteractionsContext
├── Interactive
├── RayGrab
├── VRCanvas
├── XR
├── XRController
├── useController
├── useHitTest
├── useInteraction
├── useXR
├── useXREvent
└── useXRFrame |
Turns out if you use VRCanvas or ARCanvas, they automatically add buttons for you- BUT if you are using react router or something similar and navigate away from the page, the button gets recreated each time you navigate back; i opened a pull request that should fix that behavior but yeah... kinda annoying that you can't at least specify where/how it looks |
VRButton
does not allow any customization of the session likeARButton
does withsessionInit
.Since
VRButton
'soption
parameter has been removed, I propose allowing users to specifysessionInit
in theVRButton
as well or optional features, with the addition of layers support in three.The text was updated successfully, but these errors were encountered: