summaryrefslogtreecommitdiff
path: root/src/modules/ray
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2017-05-27 14:18:37 -0700
committerVito Caputo <vcaputo@pengaru.com>2017-05-27 14:18:37 -0700
commit0a92d9d6a3b197d15e1b8bad819382b4ee4d544f (patch)
tree7af2128a9a3481430f8744c39716107cb0b10582 /src/modules/ray
parent1649853036e15e4c147d7913704663260425adc1 (diff)
ray: simplify ray_3f_normalize()
This is functionally identical.
Diffstat (limited to 'src/modules/ray')
-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