summaryrefslogtreecommitdiffstats
path: root/libdimension/cone.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2013-06-09 12:13:13 -0400
committerTavian Barnes <tavianator@tavianator.com>2013-06-09 12:14:17 -0400
commit2820d029004ad603157cf819b5cfd17870cae86e (patch)
tree1742b1f66e8f876aaffe109ba9a07cd10021d96a /libdimension/cone.c
parent62fac6e15e51422a544de01ce6cb01b0921a6706 (diff)
downloaddimension-2820d029004ad603157cf819b5cfd17870cae86e.tar.xz
Don't normalize normal vectors unnecessarily.
Diffstat (limited to 'libdimension/cone.c')
-rw-r--r--libdimension/cone.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libdimension/cone.c b/libdimension/cone.c
index ec230a6..f1536e2 100644
--- a/libdimension/cone.c
+++ b/libdimension/cone.c
@@ -1,5 +1,5 @@
/*************************************************************************
- * Copyright (C) 2009-2011 Tavian Barnes <tavianator@tavianator.com> *
+ * Copyright (C) 2009-2013 Tavian Barnes <tavianator@tavianator.com> *
* *
* This file is part of The Dimension Library. *
* *
@@ -67,9 +67,7 @@ dmnsn_cone_intersection_fn(const dmnsn_object *cone, dmnsn_line l,
if (t >= 0.0 && p.y >= -1.0 && p.y <= 1.0) {
double r = ((r2 - r1)*p.y + r1 + r2)/2.0;
- dmnsn_vector norm = dmnsn_vector_normalized(
- dmnsn_new_vector(p.x, -r*(r2 - r1)/2.0, p.z)
- );
+ dmnsn_vector norm = dmnsn_new_vector(p.x, -r*(r2 - r1)/2.0, p.z);
intersection->t = t;
intersection->normal = norm;
return true;