Open klevron opened 3 years ago
I've added the xr prop to the renderer but still get an error when starting a VR session. Any ideas?
VRButton.vue:55 Uncaught (in promise) TypeError: this.renderer.xr.setSession is not a function
Sorry I didn't have time to improve this and add example.
You should set a ref on the button :
<VRButton ref="vrbutton" />
And call init()
in mounted()
: this.$refs.vrbutton.init(this.$refs.renderer.renderer)
Added a simple vr support : https://github.com/troisjs/trois/blob/0.3.0-beta.0/src/core/Renderer.ts#L195 https://github.com/troisjs/trois/blob/0.3.0-beta.0/src/components/misc/VRButton.vue
Will add example later