summaryrefslogtreecommitdiffstats
path: root/libdimension/kD_splay_tree.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-11-09 16:17:19 -0500
committerTavian Barnes <tavianator@gmail.com>2009-11-09 16:17:19 -0500
commita432d0ec1a03d7821e40f2499bea08f65ee71e6f (patch)
tree198f5c565a78964e692968a346305fc1c1787272 /libdimension/kD_splay_tree.c
parent5138e55d3eb41255b1436d40ceba134876c3c5cd (diff)
downloaddimension-a432d0ec1a03d7821e40f2499bea08f65ee71e6f.tar.xz
Use finishes.
Diffstat (limited to 'libdimension/kD_splay_tree.c')
-rw-r--r--libdimension/kD_splay_tree.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libdimension/kD_splay_tree.c b/libdimension/kD_splay_tree.c
index 77e57dd..924d3a9 100644
--- a/libdimension/kD_splay_tree.c
+++ b/libdimension/kD_splay_tree.c
@@ -356,10 +356,13 @@ dmnsn_kD_splay_search_recursive(dmnsn_kD_splay_node *node, dmnsn_line ray,
result.intersection = result_temp.intersection;
t = result.intersection->t;
- /* Transform the normal vector back to the observer's view */
- result.intersection->normal = dmnsn_matrix_vector_mul(
- node->object->trans,
- result.intersection->normal
+ /* Transform the intersection back to the observer's view */
+ result.intersection->ray = ray;
+ result.intersection->normal = dmnsn_vector_normalize(
+ dmnsn_matrix_vector_mul(
+ node->object->trans,
+ result.intersection->normal
+ )
);
} else {
dmnsn_delete_intersection(result_temp.intersection);