From 7e7ec10dea751540eda7898cf83f8471185aa063 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 16 Jul 2009 18:25:02 +0000 Subject: Add support for default textures. --- libdimension/objects.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'libdimension/objects.c') diff --git a/libdimension/objects.c b/libdimension/objects.c index 3c772d1..bb5a16a 100644 --- a/libdimension/objects.c +++ b/libdimension/objects.c @@ -120,7 +120,8 @@ dmnsn_cube_intersection_fn(const dmnsn_object *cube, dmnsn_line line) t_temp = (-1.0 - line.x0.x)/line.n.x; p = dmnsn_line_point(line, t_temp); if (p.y >= -1.0 && p.y <= 1.0 && p.z >= -1.0 && p.z <= 1.0 - && t_temp >= 0.0 && (t < 0.0 || t_temp < t)) { + && t_temp >= 0.0 && (t < 0.0 || t_temp < t)) + { t = t_temp; } @@ -128,7 +129,8 @@ dmnsn_cube_intersection_fn(const dmnsn_object *cube, dmnsn_line line) t_temp = (1.0 - line.x0.x)/line.n.x; p = dmnsn_line_point(line, t_temp); if (p.y >= -1.0 && p.y <= 1.0 && p.z >= -1.0 && p.z <= 1.0 - && t_temp >= 0.0 && (t < 0.0 || t_temp < t)) { + && t_temp >= 0.0 && (t < 0.0 || t_temp < t)) + { t = t_temp; } } @@ -138,7 +140,8 @@ dmnsn_cube_intersection_fn(const dmnsn_object *cube, dmnsn_line line) t_temp = (-1.0 - line.x0.y)/line.n.y; p = dmnsn_line_point(line, t_temp); if (p.x >= -1.0 && p.x <= 1.0 && p.z >= -1.0 && p.z <= 1.0 - && t_temp >= 0.0 && (t < 0.0 || t_temp < t)) { + && t_temp >= 0.0 && (t < 0.0 || t_temp < t)) + { t = t_temp; } @@ -146,7 +149,8 @@ dmnsn_cube_intersection_fn(const dmnsn_object *cube, dmnsn_line line) t_temp = (1.0 - line.x0.y)/line.n.y; p = dmnsn_line_point(line, t_temp); if (p.x >= -1.0 && p.x <= 1.0 && p.z >= -1.0 && p.z <= 1.0 - && t_temp >= 0.0 && (t < 0.0 || t_temp < t)) { + && t_temp >= 0.0 && (t < 0.0 || t_temp < t)) + { t = t_temp; } } @@ -156,7 +160,8 @@ dmnsn_cube_intersection_fn(const dmnsn_object *cube, dmnsn_line line) t_temp = (-1.0 - line.x0.z)/line.n.z; p = dmnsn_line_point(line, t_temp); if (p.x >= -1.0 && p.x <= 1.0 && p.y >= -1.0 && p.y <= 1.0 - && t_temp >= 0.0 && (t < 0.0 || t_temp < t)) { + && t_temp >= 0.0 && (t < 0.0 || t_temp < t)) + { t = t_temp; } @@ -164,7 +169,8 @@ dmnsn_cube_intersection_fn(const dmnsn_object *cube, dmnsn_line line) t_temp = (1.0 - line.x0.z)/line.n.z; p = dmnsn_line_point(line, t_temp); if (p.x >= -1.0 && p.x <= 1.0 && p.y >= -1.0 && p.y <= 1.0 - && t_temp >= 0.0 && (t < 0.0 || t_temp < t)) { + && t_temp >= 0.0 && (t < 0.0 || t_temp < t)) + { t = t_temp; } } -- cgit v1.2.3