Coder Social home page Coder Social logo

lovr-ui's People

Contributors

bjornbytes avatar brainrom avatar calandiel avatar immortalx74 avatar jmiskovic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

lovr-ui's Issues

Consider adding a special case for headset emulation with mouse and keyboard

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 ^-^

Duplicate widget name not allowd within a frame

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).

lovr-ui in fuse mode

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

Support for third-party widgets

This can be done at least two ways:

  1. Placing local fields of UI in special private field, _, private, etc., and loading widgets via extending UI table by UI.CustomWidget = function() ... end
  2. Inlining lovr-ui with custom widget 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.