summaryrefslogtreecommitdiffstats
path: root/libdimension/raytrace.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-10-07 18:05:50 +0000
committerTavian Barnes <tavianator@gmail.com>2009-10-07 18:05:50 +0000
commit98571f18529c4f746b5beb02f5d83848af1759c4 (patch)
tree95b6be724b2800b5c56600a7800672ff6b6fce72 /libdimension/raytrace.c
parent4317faa8365b5c08d9111ddd1f0a622ed9e99b52 (diff)
downloaddimension-98571f18529c4f746b5beb02f5d83848af1759c4.tar.xz
Implement search for kD splay trees.
Diffstat (limited to 'libdimension/raytrace.c')
-rw-r--r--libdimension/raytrace.c72
1 files changed, 0 insertions, 72 deletions
diff --git a/libdimension/raytrace.c b/libdimension/raytrace.c
index 21ad1e8..df61d6b 100644
--- a/libdimension/raytrace.c
+++ b/libdimension/raytrace.c
@@ -229,9 +229,6 @@ dmnsn_raytrace_scene_impl(dmnsn_progress *progress, dmnsn_scene *scene,
return 0;
}
-static double dmnsn_ray_bounding_box(dmnsn_line ray,
- dmnsn_vector min, dmnsn_vector max);
-
/* Shoot a ray, and calculate the color, using `color' as the background */
static dmnsn_color
dmnsn_raytrace_shoot(dmnsn_scene *scene, dmnsn_color color, dmnsn_line ray)
@@ -289,72 +286,3 @@ dmnsn_raytrace_shoot(dmnsn_scene *scene, dmnsn_color color, dmnsn_line ray)
return color;
}
-
-static double
-dmnsn_ray_bounding_box(dmnsn_line ray, dmnsn_vector min, dmnsn_vector max)
-{
- double t = -1.0, t_temp;
- dmnsn_vector p;
-
- if (line.n.x != 0.0) {
- /* x == min.x */
- t_temp = (min.x - line.x0.x)/line.n.x;
- p = dmnsn_line_point(line, t_temp);
- if (p.y >= min.y && p.y <= max.y && p.z >= min.z && p.z <= max.z
- && t_temp >= 0.0 && (t < 0.0 || t_temp < t))
- {
- t = t_temp;
- }
-
- /* x == max.x */
- t_temp = (max.x - line.x0.x)/line.n.x;
- p = dmnsn_line_point(line, t_temp);
- if (p.y >= min.y && p.y <= max.y && p.z >= min.z && p.z <= max.z
- && t_temp >= 0.0 && (t < 0.0 || t_temp < t))
- {
- t = t_temp;
- }
- }
-
- if (line.n.y != 0.0) {
- /* y == -1.0 */
- t_temp = (-1.0 - line.x0.y)/line.n.y;
- p = dmnsn_line_point(line, t_temp);
- if (p.x >= min.x && p.x <= max.x && p.z >= min.z && p.z <= max.z
- && t_temp >= 0.0 && (t < 0.0 || t_temp < t))
- {
- t = t_temp;
- }
-
- /* y == 1.0 */
- t_temp = (1.0 - line.x0.y)/line.n.y;
- p = dmnsn_line_point(line, t_temp);
- if (p.x >= min.x && p.x <= max.x && p.z >= min.z && p.z <= max.z
- && t_temp >= 0.0 && (t < 0.0 || t_temp < t))
- {
- t = t_temp;
- }
- }
-
- if (line.n.z != 0.0) {
- /* z == -1.0 */
- t_temp = (-1.0 - line.x0.z)/line.n.z;
- p = dmnsn_line_point(line, t_temp);
- if (p.x >= min.x && p.x <= max.x && p.y >= min.y && p.y <= max.y
- && t_temp >= 0.0 && (t < 0.0 || t_temp < t))
- {
- t = t_temp;
- }
-
- /* z == 1.0 */
- t_temp = (1.0 - line.x0.z)/line.n.z;
- p = dmnsn_line_point(line, t_temp);
- if (p.x >= min.x && p.x <= max.x && p.y >= min.y && p.y <= max.y
- && t_temp >= 0.0 && (t < 0.0 || t_temp < t))
- {
- t = t_temp;
- }
- }
-
- return t;
-}