diff options
author | rodri <rgl@antares-labs.eu> | 2020-06-07 10:16:57 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2020-06-07 10:16:57 +0000 |
commit | 53e23f0987f1d3c606a05aef637afcd6f3ebee88 (patch) | |
tree | 63a1ec733f2dea8b4351327507a58ca3eb1746aa | |
parent | 5eaae194e1d1b7bfea43afcb03d3d40c2a75cad2 (diff) | |
download | pcardpt-53e23f0987f1d3c606a05aef637afcd6f3ebee88.tar.gz pcardpt-53e23f0987f1d3c606a05aef637afcd6f3ebee88.tar.bz2 pcardpt-53e23f0987f1d3c606a05aef637afcd6f3ebee88.zip |
-rw-r--r-- | pcardpt.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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), |