]> git.tdb.fi Git - r2c2.git/commitdiff
Make sure the shadow volume does not have zero size
authorMikko Rasa <tdb@tdb.fi>
Mon, 2 Feb 2015 17:51:42 +0000 (19:51 +0200)
committerMikko Rasa <tdb@tdb.fi>
Mon, 2 Feb 2015 17:51:42 +0000 (19:51 +0200)
source/3d/view.cpp

index 2050f587ec08eebc143bfe6eae38204bb1cfe13c..9fd5684f6ab50851f82c42c8ba10a25da16b3abc 100644 (file)
@@ -99,7 +99,7 @@ void View3D::update_shadow_area()
 {
        Vector minp, maxp;
        compute_bounds(minp, maxp);
-       shadow.set_target((minp+maxp)/2.0f, (maxp-minp).norm()/2.0f);
+       shadow.set_target((minp+maxp)/2.0f, max((maxp-minp).norm()/2.0f, 0.1f));
 }
 
 } // namespace R2C2