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

vertical rotation on mobile, landscape orientation #642

Open ghost opened 5 years ago

ghost commented 5 years ago

Description

Is this a Bug or a Feature Request? Bug

Expected behavior

On mobile when in landscape orientation, vertical swiping rotates camera up and down, as it does in portrait orientation.

Actual behavior

Vertical swiping rotates camera left and right.

Reproduction

Generate a new react-360 project, view it on mobile in landscape orientation, and try rotating the camera vertically by swiping up or down.

Solution

Haven't dug deep enough into source code yet, but at first glance looks like DeviceOrientationCameraController accounts for screen orientation when calculating camera rotation while MousePanCameraController does not. That being said, I see methods for touch events in both controllers, and I'm not sure which controller is actually in play in this scenario.

Additional Information

JackPu commented 5 years ago

@dludwick I met the problem. Any solution?

ghost commented 5 years ago

Sorry for the late response - I spent a few hours looking into the camera controllers but wasn't able to come up with a solution. I'm surprised more people haven't run into this issue