summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libdimension/cone.c6
-rw-r--r--libdimension/torus.c4
2 files changed, 4 insertions, 6 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;
diff --git a/libdimension/torus.c b/libdimension/torus.c
index b3ccf9f..0ef8e92 100644
--- a/libdimension/torus.c
+++ b/libdimension/torus.c
@@ -1,5 +1,5 @@
/*************************************************************************
- * Copyright (C) 2010-2011 Tavian Barnes <tavianator@tavianator.com> *
+ * Copyright (C) 2010-2013 Tavian Barnes <tavianator@tavianator.com> *
* *
* This file is part of The Dimension Library. *
* *
@@ -122,7 +122,7 @@ dmnsn_torus_intersection_fn(const dmnsn_object *torus, dmnsn_line l,
payload->major,
dmnsn_vector_normalized(dmnsn_new_vector(p.x, 0.0, p.z))
);
- dmnsn_vector normal = dmnsn_vector_normalized(dmnsn_vector_sub(p, center));
+ dmnsn_vector normal = dmnsn_vector_sub(p, center);
intersection->t = t;
intersection->normal = normal;