1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 04:12:02 +08:00
This commit is contained in:
Kevin Levron 2021-04-04 23:08:17 +02:00
parent 42cdb9fb53
commit abcc930246

View File

@ -1,5 +1,4 @@
import { defineComponent, h } from 'vue';
import { VRButton } from 'three/examples/jsm/webxr/VRButton.js';
import useThree from './useThree';
export default defineComponent({
@ -47,10 +46,7 @@ export default defineComponent({
this.renderer = this.three.renderer;
this.renderer.shadowMap.enabled = this.shadow;
this.pointer = this.three.pointer;
if (this.xr) {
this.renderer.domElement.parentNode.appendChild(VRButton.createButton(this.renderer));
this.renderer.xr.enabled = true;
if (this.three.composer) this.renderer.setAnimationLoop(this.animateXRC);
else this.renderer.setAnimationLoop(this.animateXR);