mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-28 18:46:18 +00:00
st/oxr: Ensure velocities flags and values are zeroed
This commit is contained in:
parent
798932fbf2
commit
4fc02cf60e
|
@ -468,16 +468,24 @@ oxr_space_locate(
|
|||
|
||||
XrSpaceVelocity *vel = (XrSpaceVelocity *)location->next;
|
||||
if (vel) {
|
||||
vel->linearVelocity.x = result.linear_velocity.x;
|
||||
vel->linearVelocity.y = result.linear_velocity.y;
|
||||
vel->linearVelocity.z = result.linear_velocity.z;
|
||||
vel->velocityFlags = 0;
|
||||
if ((result.relation_flags & XRT_SPACE_RELATION_LINEAR_VELOCITY_VALID_BIT) != 0) {
|
||||
vel->linearVelocity.x = result.linear_velocity.x;
|
||||
vel->linearVelocity.y = result.linear_velocity.y;
|
||||
vel->linearVelocity.z = result.linear_velocity.z;
|
||||
vel->velocityFlags |= XR_SPACE_VELOCITY_LINEAR_VALID_BIT;
|
||||
} else {
|
||||
U_ZERO(&vel->linearVelocity);
|
||||
}
|
||||
|
||||
vel->angularVelocity.x = result.angular_velocity.x;
|
||||
vel->angularVelocity.y = result.angular_velocity.y;
|
||||
vel->angularVelocity.z = result.angular_velocity.z;
|
||||
|
||||
vel->velocityFlags |= (location->locationFlags & XR_SPACE_VELOCITY_LINEAR_VALID_BIT);
|
||||
vel->velocityFlags |= (location->locationFlags & XR_SPACE_VELOCITY_ANGULAR_VALID_BIT);
|
||||
if ((result.relation_flags & XRT_SPACE_RELATION_ANGULAR_VELOCITY_VALID_BIT) != 0) {
|
||||
vel->angularVelocity.x = result.angular_velocity.x;
|
||||
vel->angularVelocity.y = result.angular_velocity.y;
|
||||
vel->angularVelocity.z = result.angular_velocity.z;
|
||||
vel->velocityFlags |= XR_SPACE_VELOCITY_ANGULAR_VALID_BIT;
|
||||
} else {
|
||||
U_ZERO(&vel->angularVelocity);
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
|
Loading…
Reference in a new issue