diff options
author | Tavian Barnes <tavianator@gmail.com> | 2009-07-16 18:25:02 +0000 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2009-07-16 18:25:02 +0000 |
commit | 7e7ec10dea751540eda7898cf83f8471185aa063 (patch) | |
tree | f931c67a40318dc85faa48fa7655d6d29cd567e8 /libdimension/objects.c | |
parent | 90564274757e489429daf8bcdb92009563fd2efd (diff) | |
download | dimension-7e7ec10dea751540eda7898cf83f8471185aa063.tar.xz |
Add support for default textures.
Diffstat (limited to 'libdimension/objects.c')
-rw-r--r-- | libdimension/objects.c | 18 |
1 files changed, 12 insertions, 6 deletions
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; } } |