summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/ray/ray_3f.h11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/modules/ray/ray_3f.h b/src/modules/ray/ray_3f.h
index e0e6dc3..8e852fa 100644
--- a/src/modules/ray/ray_3f.h
+++ b/src/modules/ray/ray_3f.h
@@ -103,16 +103,7 @@ static inline float ray_3f_length(ray_3f_t *v)
/* return the normalized form of the supplied vector */
static inline ray_3f_t ray_3f_normalize(ray_3f_t *v)
{
- ray_3f_t nv;
- float f;
-
- f = 1.0f / ray_3f_length(v);
-
- nv.x = f * v->x;
- nv.y = f * v->y;
- nv.z = f * v->z;
-
- return nv;
+ return ray_3f_mult_scalar(v, 1.0f / ray_3f_length(v));
}
© All Rights Reserved