The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

st/oxr: Translate relation_flags in oxr_space_locate()

+28 -1
+28 -1
src/xrt/state_trackers/oxr/oxr_space.c
··· 317 317 print_pose(spc->sess, "", &spc->pose); 318 318 } 319 319 320 + static XrSpaceLocationFlags 321 + get_xr_space_location_flags(enum xrt_space_relation_flags relation_flags) 322 + { 323 + // clang-format off 324 + bool valid_ori = (relation_flags & XRT_SPACE_RELATION_ORIENTATION_VALID_BIT) != 0; 325 + bool tracked_ori = (relation_flags & XRT_SPACE_RELATION_ORIENTATION_TRACKED_BIT) != 0; 326 + bool valid_pos = (relation_flags & XRT_SPACE_RELATION_POSITION_VALID_BIT) != 0; 327 + bool tracked_pos = (relation_flags & XRT_SPACE_RELATION_POSITION_TRACKED_BIT) != 0; 328 + // clang-format on 329 + 330 + XrSpaceLocationFlags location_flags = (XrSpaceLocationFlags)0; 331 + if (valid_ori) { 332 + location_flags |= XR_SPACE_LOCATION_ORIENTATION_VALID_BIT; 333 + } 334 + if (tracked_ori) { 335 + location_flags |= XR_SPACE_LOCATION_ORIENTATION_TRACKED_BIT; 336 + } 337 + if (valid_pos) { 338 + location_flags |= XR_SPACE_LOCATION_POSITION_VALID_BIT; 339 + } 340 + if (tracked_pos) { 341 + location_flags |= XR_SPACE_LOCATION_POSITION_TRACKED_BIT; 342 + } 343 + return location_flags; 344 + } 345 + 320 346 XrResult 321 347 oxr_space_locate(struct oxr_logger *log, 322 348 struct oxr_space *spc, ··· 352 378 safe_copy.xrt = result.pose; 353 379 354 380 location->pose = safe_copy.oxr; 355 - location->locationFlags = result.relation_flags; 381 + location->locationFlags = 382 + get_xr_space_location_flags(result.relation_flags); 356 383 357 384 #if 0 358 385 location->linearVelocity = *(XrVector3f *)&result.linear_velocity;