summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/ray/ray_3f.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/modules/ray/ray_3f.h b/src/modules/ray/ray_3f.h
index 8408abb..e0e6dc3 100644
--- a/src/modules/ray/ray_3f.h
+++ b/src/modules/ray/ray_3f.h
@@ -119,7 +119,9 @@ static inline ray_3f_t ray_3f_normalize(ray_3f_t *v)
/* return the distance between two arbitrary points */
static inline float ray_3f_distance(ray_3f_t *a, ray_3f_t *b)
{
- return sqrtf(powf(a->x - b->x, 2) + powf(a->y - b->y, 2) + powf(a->z - b->z, 2));
+ ray_3f_t delta = ray_3f_sub(a, b);
+
+ return ray_3f_length(&delta);
}
© All Rights Reserved