Support composition layers anywhere in the tree#114324
Support composition layers anywhere in the tree#114324m4gr3d wants to merge 1 commit intogodotengine:masterfrom
Conversation
87fc625 to
6627795
Compare
|
|
||
| void OpenXRCompositionLayer::_remove_fallback_node() { | ||
| ERR_FAIL_COND(fallback != nullptr); | ||
| ERR_FAIL_COND(fallback == nullptr); |
There was a problem hiding this comment.
@dsnopek Looks like the cond check was inverted, or am I misreading this logic?
There was a problem hiding this comment.
Hm, at first glance, I think you're right! I wonder why we haven't had issues with this in the past, though
251cbdc to
599adb2
Compare
df0c7ec to
9726c97
Compare
9726c97 to
d7490a6
Compare
| if (ancestor_camera) { | ||
| xf = ancestor_camera->get_global_transform().affine_inverse() * get_global_transform(); | ||
| } else { | ||
| xf = XRServer::get_singleton()->get_world_origin().affine_inverse() * get_global_transform(); |
There was a problem hiding this comment.
Because this calculation includes XRServer::get_singleton()->get_world_origin().affine_inverse(), we need to run update_transform() any time the XROrigin3D is moved/rotated as well.
I did some testing, and all was fine if I started the app with the XROrigin3D moved away from the origin and rotated. However, if I moved/rotated the XROrigin3D at runtime (like, when teleporting or snap turning), the composition layers would end up in the wrong spot (which can look really weird with hole punching, because the "hole" will be in the right spot, but the composition layer will be in the wrong spot).
To solve this, I think we'll need either:
- A way to get the current
XROrigin3Dand then watch for it to move/rotate, or - A signal that's emitted every time
XRServer::get_singleton()->get_world_orgin()has a new value
There was a problem hiding this comment.
I went with the second approach and added a signal that's emitted when the world origin changes. This mirrors what we already do for the reference frame.
d7490a6 to
b389d58
Compare
|
I am looking forward for this! Great work |
No description provided.