-
-
Notifications
You must be signed in to change notification settings - Fork 23.9k
Support composition layers anywhere in the tree #114324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Support composition layers anywhere in the tree #114324
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dsnopek Looks like the cond check was inverted, or am I misreading this logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, at first glance, I think you're right! I wonder why we haven't had issues with this in the past, though
| if (Object::cast_to<XROrigin3D>(get_parent()) != nullptr) { | ||
| xf = get_transform(); | ||
| } else { | ||
| xf = get_global_transform(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this still work when the XROrigin3D is moved away from (0, 0, 0) and/or rotated?
I would have expected this to need something like (untested):
| xf = get_global_transform(); | |
| xf = XRServer::get_singleton()->get_world_origin().affine_inverse() * get_global_transform(); |
| case NOTIFICATION_LOCAL_TRANSFORM_CHANGED: { | ||
| case NOTIFICATION_TRANSFORM_CHANGED: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we still use NOTIFICATION_LOCAL_TRANSFORM_CHANGED when XROrigin3D is the parent, and only use NOTIFICATION_TRANSFORM_CHANGED when putting it elsewhere? NOTIFICATION_TRANSFORM_CHANGED can happen way more frequently than NOTIFICATION_LOCAL_TRANSFORM_CHANGED
| warnings.push_back(RTR("OpenXR composition layers must have an XROrigin3D node as their parent.")); | ||
| warnings.push_back(RTR("OpenXR composition layers must have an XROrigin3D node as their ancestor.")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, I thought the idea was that you could put it anywhere? Why does it still need to have XROrigin3D as an ancestor?
No description provided.