From a62d7366a6061c1873b87ead944e2521f589b0c7 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 25 Sep 2024 18:27:10 +0100 Subject: Use single-precision trig functions in testwarp There was never a need to calculate more precision and then throw it away again. This was just an oversight. --- src/l4dwarp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/l4dwarp.c b/src/l4dwarp.c index f508460..d5f124b 100644 --- a/src/l4dwarp.c +++ b/src/l4dwarp.c @@ -86,10 +86,10 @@ static struct vec3f warptarget(void *ent) { const struct vec3f *ang = mem_offset(ent, off_eyeang); // L4D idle warps go up to 10 units behind yaw, lessening based on pitch. float pitch = ang->x * M_PI / 180, yaw = ang->y * M_PI / 180; - float shift = -10 * cos(pitch); + float shift = -10 * cosf(pitch); return (struct vec3f){ - org->x + shift * cos(yaw), - org->y + shift * sin(yaw), + org->x + shift * cosf(yaw), + org->y + shift * sinf(yaw), org->z }; } -- cgit v1.2.3-54-g00ecf