facebookarchive / react-360

Create amazing 360 and VR content using React
https://facebook.github.io/react-360
Other
8.73k stars 1.23k forks source link

[Question] Prevent camera from moving? #305

Closed matthamil closed 7 years ago

matthamil commented 7 years ago

Is there a way to prevent the camera from changing direction when the user clicks and holds and moves the cursor around (or looks around in a headset/rotates a phone)? I don't want to lock the camera indefinitely, but I'm curious if there's a way to toggle the look-around ability on and off.

andrewimm commented 7 years ago

Sure, from client.js you should be able to set vr.player.controls.nonVRControls.enabled = false And setting it to true should re-enable it. You can configure a NativeModule to trigger this from React too, if required.

matthamil commented 7 years ago

Awesome! Thanks @andrewimm, and thank you for supporting this library :) I have been really enjoying playing around with WebVR using ReactVR. Keep up the awesome work :tada: