Skip to content

Commit

Permalink
Fix opposite-direction increments in ray-tracing.
Browse files Browse the repository at this point in the history
  • Loading branch information
asofold committed Feb 26, 2013
1 parent 7baac6b commit 4958913
Showing 1 changed file with 6 additions and 6 deletions.
Expand Up @@ -103,11 +103,11 @@ public void loop(){
blockX ++;
}
}
else if (oX >= 1){
else if (oX >= 1 && dX > 0.0){
oX -= 1;
blockX ++;
}
else if (oX < 0){
else if (oX < 0 && dX < 0.0){
oX += 1;
blockX --;
}
Expand All @@ -123,11 +123,11 @@ else if (oX < 0){
blockY ++;
}
}
else if (oY >= 1){
else if (oY >= 1 && dY > 0.0){
oY -= 1;
blockY ++;
}
else if (oY < 0){
else if (oY < 0 && dY < 0.0){
oY += 1;
blockY --;
}
Expand All @@ -143,11 +143,11 @@ else if (oY < 0){
blockZ ++;
}
}
else if (oZ >= 1){
else if (oZ >= 1 && dZ > 0.0){
oZ -= 1;
blockZ ++;
}
else if (oZ < 0){
else if (oZ < 0 && dZ < 0.0){
oZ += 1;
blockZ --;
}
Expand Down

0 comments on commit 4958913

Please sign in to comment.