summaryrefslogtreecommitdiffstats
path: root/libdimension/raytrace.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-05-30 17:00:07 -0600
committerTavian Barnes <tavianator@gmail.com>2010-05-30 17:01:58 -0600
commit1b2a77ba356407268b078062fa9ab4ff9853d348 (patch)
tree2414df5baac242b1c1024867db63b05572895519 /libdimension/raytrace.c
parenteb020a7251cdd1671218448f9456a6a6f30e59d5 (diff)
downloaddimension-1b2a77ba356407268b078062fa9ab4ff9853d348.tar.xz
Precompute objects in dmnsn_raytrace_scene() rather than dmnsn_new_prtree().
Diffstat (limited to 'libdimension/raytrace.c')
-rw-r--r--libdimension/raytrace.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libdimension/raytrace.c b/libdimension/raytrace.c
index 2c389dc..8adde41 100644
--- a/libdimension/raytrace.c
+++ b/libdimension/raytrace.c
@@ -75,6 +75,12 @@ static int
dmnsn_raytrace_scene_thread(void *ptr)
{
dmnsn_raytrace_payload *payload = ptr;
+
+ /* Pre-calculate bounding box transformations, etc. */
+ DMNSN_ARRAY_FOREACH (dmnsn_object **, object, payload->scene->objects) {
+ dmnsn_object_precompute(*object);
+ }
+
payload->prtree = dmnsn_new_prtree(payload->scene->objects);
dmnsn_raytrace_payload *payloads;