mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-29 18:08:29 +00:00
NFC: a/math: Make math_quat_from_swing prettier
This commit is contained in:
parent
778900cd3c
commit
386117c5ee
|
@ -401,11 +401,11 @@ math_quat_from_swing(const struct xrt_vec2 *swing, struct xrt_quat *result)
|
|||
result->z = 0.f;
|
||||
} else {
|
||||
// lim(x->0) (sin(x/2)/x) = 0.5, but sin(0)/0 is undefined, so we need to catch this with a conditional.
|
||||
const float k(0.5);
|
||||
result->w = float(1.0);
|
||||
const float k = 0.5f;
|
||||
result->w = 1.0f;
|
||||
result->x = *a0 * k;
|
||||
result->y = *a1 * k;
|
||||
result->z = float(0);
|
||||
result->z = 0.f;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue