summaryrefslogtreecommitdiffstats
path: root/libdimension
diff options
context:
space:
mode:
Diffstat (limited to 'libdimension')
-rw-r--r--libdimension/kD_splay_tree.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libdimension/kD_splay_tree.c b/libdimension/kD_splay_tree.c
index ca31b86..b6be801 100644
--- a/libdimension/kD_splay_tree.c
+++ b/libdimension/kD_splay_tree.c
@@ -359,9 +359,15 @@ dmnsn_kD_splay_search_recursive(dmnsn_kD_splay_node *node, dmnsn_line ray,
/* 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
+ dmnsn_vector_sub(
+ dmnsn_matrix_vector_mul(
+ node->object->trans,
+ result.intersection->normal
+ ),
+ dmnsn_matrix_vector_mul(
+ node->object->trans,
+ dmnsn_zero
+ )
)
);
} else {