Revision: 14377
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14377
Author:   blendix
Date:     2008-04-10 14:52:48 +0200 (Thu, 10 Apr 2008)

Log Message:
-----------

Fix for bug #8898: QMC AO not working correct on objects pointing
directly at the camera in some cases.

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/intern/arithb.c

Modified: trunk/blender/source/blender/blenlib/intern/arithb.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/arithb.c        2008-04-10 
11:39:20 UTC (rev 14376)
+++ trunk/blender/source/blender/blenlib/intern/arithb.c        2008-04-10 
12:52:48 UTC (rev 14377)
@@ -2116,8 +2116,9 @@
 
 void VecOrthoBasisf(float *v, float *v1, float *v2)
 {
-       if (v[0] == 0.0f && v[1] == 0.0f)
-       {
+       float f = sqrt(v[0]*v[0] + v[1]*v[1]);
+
+       if (f < 1e-35f) {
                // degenerate case
                v1[0] = 0.0f; v1[1] = 1.0f; v1[2] = 0.0f;
                if (v[2] > 0.0f) {
@@ -2127,9 +2128,8 @@
                        v2[0] = -1.0f; v2[1] = v2[2] = 0.0f;
                }
        }
-       else 
-       {
-               float f = 1.0f/sqrt(v[0]*v[0] + v[1]*v[1]);
+       else  {
+               f = 1.0f/f;
                v1[0] = v[1]*f;
                v1[1] = -v[0]*f;
                v1[2] = 0.0f;


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to