Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This contains a few changes to headset coordinate spaces. There are some interesting ideas here, but I'm not totally happy with everything and not sure it will get merged. Leaving it as a PR for a while to get visibility/feedback.
Changes
lovr.headset.get/setOffset
,lovr.headset.translate
, andlovr.headset.rotate
. This is a commonly-requested feature that lets you define a "base transform" for the origin that all the other headset poses (view poses, device poses, velocities, skeletal joint poses) will get composed with.lovr.recenter
event that is fired when the play area is recentered.t.headset.seated
andlovr.headset.isSeated
. In seated mode, y=0 will be at eye level. Otherwise, y=0 will be on the floor (with a 1.7m virtual floor offset added for headsets that can't track the floor). This replaceslovr.headset.getOriginType
andt.headset.offset
. The main difference here is that the LÖVR project is in control of whether it wants to arrange objects in a "seated" way or not, and either mode will work consistently on all headset types. Previously you were basically forced into authoring content in a roomscale way, and had no way of consistently setting up a "seated" coordinate space with y=0 at eye level.lovr.headset.getBoundsPose
(and getBoundsPosition/Orientation, names need work). This returns an offset to the middle of the play area. This can be different from the origin of the coordinate system due to recentering. This gives you a reliable way to position static content that aligns with the room and have it NOT move around during a recentering:The idea is that some apps will want to render this kind static environment, but also have more dynamic menus or objects that move around when the play area is recentered (think the Quest background environment vs. the Quest menus). Note that the bounds pose does not incorporate the headset offset, so that the above idiom works even if an offset is applied. That's not set in stone or anything, but seems more useful.
Issues
unbounded
tracking on AR headsets later without doing a breaking change.HeadsetOrigin
enum that is something likelocal
,local-floor
,stage
, andunbounded
, which you would set inconf.lua
. However, I felt that this was a little bit too low-level and unfriendly for LÖVR.lovr.headset.translate
take into account the offset's rotation or not? Currently it does, but if you don't want that then you can't use .translate and need to do setOffset manually.floor
device instead? SogetBoundsPose
would belovr.headset.getPose('floor')
. In that case the global headset offset would be applied to the pose, so you'd have to undo the offset, or dopass:origin
before applying the floor pose when drawing.