diff options
author | Tavian Barnes <tavianator@gmail.com> | 2009-10-06 16:01:26 +0000 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2009-10-06 16:01:26 +0000 |
commit | f17b05602b06c8a32af995cab48abea39f114f33 (patch) | |
tree | a6e56300af54c0c0eff37f2c85842df0a1ecf5c7 | |
parent | 739383d6fe6431821ea54687aedb329ba6abe036 (diff) | |
download | dimension-f17b05602b06c8a32af995cab48abea39f114f33.tar.xz |
Calculate bounding boxes for spheres and cubes.
-rw-r--r-- | libdimension/objects.c | 4 |
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; } |