mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-21 22:21:44 +00:00
d/survive: Remove useless loop
We already have a SurviveSimpleObject, no need to look for it through iteration
This commit is contained in:
parent
d3b90e9548
commit
25bafd71c8
|
@ -176,33 +176,28 @@ _get_survive_pose(const SurviveSimpleObject *survive_object,
|
||||||
|
|
||||||
out_relation->relation_flags = 0;
|
out_relation->relation_flags = 0;
|
||||||
|
|
||||||
for (const SurviveSimpleObject *it =
|
if (survive_simple_object_get_type(survive_object) !=
|
||||||
survive_simple_get_first_object(ctx);
|
|
||||||
it != 0; it = survive_simple_get_next_object(ctx, it)) {
|
|
||||||
// const char *codename = survive_simple_object_name(it);
|
|
||||||
|
|
||||||
if (survive_simple_object_get_type(it) !=
|
|
||||||
SurviveSimpleObject_OBJECT &&
|
SurviveSimpleObject_OBJECT &&
|
||||||
survive_simple_object_get_type(it) !=
|
survive_simple_object_get_type(survive_object) !=
|
||||||
SurviveSimpleObject_HMD) {
|
SurviveSimpleObject_HMD) {
|
||||||
continue;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (it != survive_object)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
SurvivePose pose;
|
SurvivePose pose;
|
||||||
|
|
||||||
uint32_t timecode =
|
uint32_t timecode =
|
||||||
survive_simple_object_get_latest_pose(it, &pose);
|
survive_simple_object_get_latest_pose(survive_object, &pose);
|
||||||
|
|
||||||
(void)timecode;
|
(void)timecode;
|
||||||
|
|
||||||
struct xrt_quat out_rot = {.x = pose.Rot[1],
|
struct xrt_quat out_rot = {.x = pose.Rot[1],
|
||||||
.y = pose.Rot[2],
|
.y = pose.Rot[2],
|
||||||
.z = pose.Rot[3],
|
.z = pose.Rot[3],
|
||||||
.w = pose.Rot[0]};
|
.w = pose.Rot[0]};
|
||||||
// printf ("quat %f %f %f %f\n", out_rot.x, out_rot.y,
|
/*
|
||||||
// out_rot.z, out_rot.w);
|
printf("quat %f %f %f %f\n", out_rot.x, out_rot.y, out_rot.z,
|
||||||
|
out_rot.w);
|
||||||
|
*/
|
||||||
|
|
||||||
/* libsurvive looks down when it should be looking forward, so
|
/* libsurvive looks down when it should be looking forward, so
|
||||||
* rotate the quat.
|
* rotate the quat.
|
||||||
|
@ -235,7 +230,6 @@ _get_survive_pose(const SurviveSimpleObject *survive_object,
|
||||||
XRT_SPACE_RELATION_POSITION_VALID_BIT |
|
XRT_SPACE_RELATION_POSITION_VALID_BIT |
|
||||||
XRT_SPACE_RELATION_POSITION_TRACKED_BIT;
|
XRT_SPACE_RELATION_POSITION_TRACKED_BIT;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
_try_update_codenames(struct survive_system *sys)
|
_try_update_codenames(struct survive_system *sys)
|
||||||
|
|
Loading…
Reference in a new issue