summaryrefslogtreecommitdiffstats
path: root/libdimension/objects.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-07-16 18:25:02 +0000
committerTavian Barnes <tavianator@gmail.com>2009-07-16 18:25:02 +0000
commit7e7ec10dea751540eda7898cf83f8471185aa063 (patch)
treef931c67a40318dc85faa48fa7655d6d29cd567e8 /libdimension/objects.c
parent90564274757e489429daf8bcdb92009563fd2efd (diff)
downloaddimension-7e7ec10dea751540eda7898cf83f8471185aa063.tar.xz
Add support for default textures.
Diffstat (limited to 'libdimension/objects.c')
-rw-r--r--libdimension/objects.c18
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;
}
}