Closed philsawicki closed 7 years ago
Thanks for the detailed repro and solution. extending VRInstance to support custom Controls is a great idea, will add to our list.
Great! Thanks for your time and consideration @amberroy!
(I'll close this Issue, as its main purpose was to bring this suggestion to your attention.)
Description
When attempting to customize the
vrControls
andnonVRControls
of a Project, I struggled to find a way to configure them at initialization.This originates from a need to support Touch inputs on both the
DeviceOrientationControls
and theMousePanControls
, in order to allow User to refocus the Scene in case of Device Drift when designing for sit-down experiences while also supporting Touch Screen laptops and tablets.I was able to override the
VRInstance
's instances ofvrControls
andnonVRControls
with custom ones, but the internal Device fingerprinting to select which Controls to use (i.e.DeviceOrientationControls.isSupported()
) is already executed (see Reproduction below).Expected behavior
The
init()
function of client.js allows Developers to specify whichvrControls
andnonVRControls
instances to use in theVRInstance()
Constructor, with a way of selecting which one to use (see Solution below).Actual behavior
The
VRInstance()
Constructor does not support passing custom Controls, and they must be overridden from thevr
instance returned.Reproduction
Simple vr/client.js used to workaround creation of custom Controls:
Solution
The
VRInstance()
Constructor could support additional (optional) parameters to specific which Controls to use and when:Thanks for your time!
Additional Information