From 0a92d9d6a3b197d15e1b8bad819382b4ee4d544f Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sat, 27 May 2017 14:18:37 -0700 Subject: ray: simplify ray_3f_normalize() This is functionally identical. --- src/modules/ray/ray_3f.h | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src') 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)); } -- cgit v1.2.3