Revision: 30979
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30979
Author:   jwilkins
Date:     2010-08-02 15:19:31 +0200 (Mon, 02 Aug 2010)

Log Message:
-----------
* Fix: random rotation wasn't working in wrapped texture mapping mode

Modified Paths:
--------------
    branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/sculpt.c

Modified: 
branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/sculpt.c     
2010-08-02 13:09:50 UTC (rev 30978)
+++ branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/sculpt.c     
2010-08-02 13:19:31 UTC (rev 30979)
@@ -894,12 +894,9 @@
                   the texture is not rotated by skipping the calls to
                   atan2, sqrtf, sin, and cos. */
                if (rotation > 0.001 || rotation < -0.001) {
-                       float angle    = atan2(y, x) + rotation;
+                       const float angle    = atan2(y, x) + rotation;
                        const float flen     = sqrtf(x*x + y*y);
 
-                       if (br->flag & BRUSH_RANDOM_ROTATION)
-                               angle += ss->cache->special_rotation;
-
                        x = flen * cos(angle);
                        y = flen * sin(angle);
                }
@@ -932,6 +929,9 @@
                x = point_2d[0];
                y = point_2d[1];
 
+               if (br->flag & BRUSH_RANDOM_ROTATION)
+                       rotation += ss->cache->special_rotation;
+
                /* it is probably worth optimizing for those cases where 
                   the texture is not rotated by skipping the calls to
                   atan2, sqrtf, sin, and cos. */


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

Reply via email to