aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Michael Smith <mikesmiffy128@gmail.com> 2024-09-25 18:27:10 +0100
committerGravatar Michael Smith <mikesmiffy128@gmail.com> 2024-09-25 18:28:38 +0100
commita62d7366a6061c1873b87ead944e2521f589b0c7 (patch)
tree4c3f79c9e1df070f2b1b4cf6207020bc2d63d68b
parentffa498d89f66c815b28134fe1af5ddac4408875a (diff)
downloadsst-a62d7366a6061c1873b87ead944e2521f589b0c7.tar.gz
sst-a62d7366a6061c1873b87ead944e2521f589b0c7.zip
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.
-rw-r--r--src/l4dwarp.c6
1 files 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
};
}