Open bferguson3 opened 4 years ago
What would the "lovr-layer callbacks" be? I also want the fake headset controls to be moved up into Lua where they can be more customizable, but I haven't been able to come up with a good way to do it
Imo lovr-keyboard should be integrated into the base code as a built-in library, and the headset controls should simply be remapped to use them, i.e. lovr.keyboard.isDown("w") { headsetOffset.z [...]
This way users can override them if they wish but they are still fully functional and hidden by default.
Progress on this has been made: There are lovr.keypressed
and lovr.keyreleased
callbacks. Moving the desktop headset driver controls into Lua is still a bit tricky though. Ideas I'm going to explore are:
lovr.headset.updateSimulatedTransform
could take inputs and return a simulated head transform. This could be used with lovr.graphics.setViewPose
to simulate a camera, or be combined with the Space idea above so that lovr.headset.getPose
still works.Tricky, still kinda fuzzy, but getting closer!
The keys WASDQE, Arrow keys, mouse movement and mouse click are presently bound hard-coded in GL input to what APPEARS to be a headset offset value, but I can't tell for sure.
Input should never be hard-coded. These also don't generate keyboard callbacks, so they can't be overridden by lovr.keyboard.
Suggested: Merge lovr.keyboard as a base library and implement these controls as lovr-layer callbacks instead
Repro steps:
Further testing: Tying wasd or arrows to a transform offset creates all sorts of lighting glitches when changing position and rotation of the viewpoint.