From 53e23f0987f1d3c606a05aef637afcd6f3ebee88 Mon Sep 17 00:00:00 2001 From: rodri Date: Sun, 7 Jun 2020 10:16:57 +0000 Subject: get rid of denormalized number errors. still not working. --- pcardpt.c | 4 ++-- 1 file 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), -- cgit v1.2.3