mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-29 11:06:18 +00:00
st/oxr: Set position to identity and zero velocities if the spaces are locatable
This commit is contained in:
parent
291e795728
commit
798932fbf2
|
@ -429,6 +429,21 @@ oxr_space_locate(
|
||||||
bool has_pure_relation = get_pure_space_relation(log, spc, baseSpc, time, &pure);
|
bool has_pure_relation = get_pure_space_relation(log, spc, baseSpc, time, &pure);
|
||||||
if (!has_pure_relation) {
|
if (!has_pure_relation) {
|
||||||
location->locationFlags = 0;
|
location->locationFlags = 0;
|
||||||
|
|
||||||
|
// Copy
|
||||||
|
union {
|
||||||
|
struct xrt_pose xrt;
|
||||||
|
XrPosef oxr;
|
||||||
|
} safe_copy = {XRT_POSE_IDENTITY};
|
||||||
|
location->pose = safe_copy.oxr;
|
||||||
|
|
||||||
|
XrSpaceVelocity *vel = (XrSpaceVelocity *)location->next;
|
||||||
|
if (vel) {
|
||||||
|
vel->velocityFlags = 0;
|
||||||
|
U_ZERO(&vel->linearVelocity);
|
||||||
|
U_ZERO(&vel->angularVelocity);
|
||||||
|
}
|
||||||
|
|
||||||
return XR_SUCCESS;
|
return XR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue