immortalx74 / lovr-ui Goto Github PK
View Code? Open in Web Editor NEWAn immediate mode VR GUI library for LÖVR
License: Creative Commons Zero v1.0 Universal
An immediate mode VR GUI library for LÖVR
License: Creative Commons Zero v1.0 Universal
Hello! I've tried your library and while it seems to work great, I think it falls a bit short when LOVR emulates a headset with mouse and keyboard. The "pointer" never goes out of focus after the initial right click is pressed and in combination with having to hold left click to rotate the camera it feels really awkward. I think the experience could easily be improved by adding a special case in UI.InputInfo
that captures data from the head instead of the dominant hand when the headset is emulated. Perhaps something along the lines of
if emulated_headset then
ray.pos = vec3(lovr.headset.getPosition("head"))
ray.ori = quat(lovr.headset.getOrientation("head"))
local m = mat4(vec3(0, 0, 0), ray.ori):rotate(0, 1, 0, 0)
ray.dir = quat(m):direction()
else
ray.pos = vec3(lovr.headset.getPosition(dominant_hand))
ray.ori = quat(lovr.headset.getOrientation(dominant_hand))
local m = mat4(vec3(0, 0, 0), ray.ori):rotate(-input.pointer_rotation, 1, 0, 0)
ray.dir = quat(m):direction()
end
instead of the current calculations. This reproduces behavior more similar to that of normal first person games, wherein the ray is cast in the view direction from the middle of the screen.
If that's something you think fits the design of the library, I can create a pull request (I've already got it working in my local fork), if not, close this issue please, it is more of a suggestion than a bug report ^-^
When re-using the same name for another widget some weird behavior comes up, like sliders affecting each other. I think this is common enough occurrence in general UIs that it should be supported (or documented as limitation).
I get:
Error:
utils/ui/ui.lua:827: Could not read Font from 'ui/DejaVuSansMono.ttf'
The path it should read from is 'utils/ui/DejaVuSansMono.ttf'
To me it seems like
local root = (...):match( '(.-)[^%./]+$' ):gsub( '%.', '/' )
is not working like expected in fuse mode.
Regards, Fabi
This can be done at least two ways:
_
, private
, etc., and loading widgets via extending UI table by UI.CustomWidget = function() ... end
UI = loadstring(lovr.filesystem.read("lovr-ui/ui/ui.lua") .. lovr.filesystem.read("customwidget.lua"))()
First option is better, because it allows to add widget at runtime, and give a meaningful debug info on stacktrace, but require more rework in lovr-ui core. Second option easier to implement, but UI table becomes a black box.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.