aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2020-06-07 10:16:57 +0000
committerrodri <rgl@antares-labs.eu>2020-06-07 10:16:57 +0000
commit53e23f0987f1d3c606a05aef637afcd6f3ebee88 (patch)
tree63a1ec733f2dea8b4351327507a58ca3eb1746aa
parent5eaae194e1d1b7bfea43afcb03d3d40c2a75cad2 (diff)
downloadpcardpt-53e23f0987f1d3c606a05aef637afcd6f3ebee88.tar.gz
pcardpt-53e23f0987f1d3c606a05aef637afcd6f3ebee88.tar.bz2
pcardpt-53e23f0987f1d3c606a05aef637afcd6f3ebee88.zip
get rid of denormalized number errors. still not working.HEADmaster
-rw-r--r--pcardpt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pcardpt.c b/pcardpt.c
index d74fe39..873479b 100644
--- a/pcardpt.c
+++ b/pcardpt.c
@@ -89,7 +89,7 @@ QueryDatabase(Vec position, int *hitType)
Vec o;
o = vadd(f, vmul(curves[i], -1));
- distance = min(distance, o.x > 0? abs(sqrt(vdot(o, o)) - 2): (o.y += o.y > 0? -2: 2, sqrt(vdot(o, o))));
+ distance = min(distance, o.x > 0? fabs(sqrt(vdot(o, o)) - 2): (o.y += o.y > 0? -2: 2, sqrt(vdot(o, o))));
}
distance = pow(pow(distance, 8) + pow(position.z, 8), 0.125) - 0.5;
*hitType = HIT_LETTER;
@@ -105,7 +105,7 @@ QueryDatabase(Vec position, int *hitType)
BoxTest(position, V(-25,17,-25), V(25,20,25))
),
BoxTest(/* Ceiling "planks" spaced 8 units apart. */
- V(fmod(abs(position.x), 8),
+ V(fmod(fabs(position.x), 8),
position.y,
position.z),
V(1.5,18.5,-25),