summaryrefslogtreecommitdiffstats
path: root/libdimension/objects.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-10-06 16:01:26 +0000
committerTavian Barnes <tavianator@gmail.com>2009-10-06 16:01:26 +0000
commitf17b05602b06c8a32af995cab48abea39f114f33 (patch)
treea6e56300af54c0c0eff37f2c85842df0a1ecf5c7 /libdimension/objects.c
parent739383d6fe6431821ea54687aedb329ba6abe036 (diff)
downloaddimension-f17b05602b06c8a32af995cab48abea39f114f33.tar.xz
Calculate bounding boxes for spheres and cubes.
Diffstat (limited to 'libdimension/objects.c')
-rw-r--r--libdimension/objects.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libdimension/objects.c b/libdimension/objects.c
index bb5a16a..721d04d 100644
--- a/libdimension/objects.c
+++ b/libdimension/objects.c
@@ -42,6 +42,8 @@ dmnsn_new_sphere()
if (sphere) {
sphere->intersection_fn = &dmnsn_sphere_intersection_fn;
sphere->inside_fn = &dmnsn_sphere_inside_fn;
+ sphere->min = dmnsn_vector_construct(-1.0, -1.0, -1.0);
+ sphere->max = dmnsn_vector_construct(1.0, 1.0, 1.0);
}
return sphere;
}
@@ -101,6 +103,8 @@ dmnsn_new_cube()
if (cube) {
cube->intersection_fn = &dmnsn_cube_intersection_fn;
cube->inside_fn = &dmnsn_cube_inside_fn;
+ cube->min = dmnsn_vector_construct(-1.0, -1.0, -1.0);
+ cube->max = dmnsn_vector_construct(1.0, 1.0, 1.0);
}
return cube;
}