[Bf-blender-cvs] [d30988b] master: Code cleanup: avoid sin/cos calls when drawing sun lamp

Campbell Barton noreply at git.blender.org
Tue Apr 29 18:18:01 CEST 2014


Commit: d30988bbf14e8f418f429798e7097a96e3a7e8b9
Author: Campbell Barton
Date:   Wed Apr 30 02:12:11 2014 +1000
https://developer.blender.org/rBd30988bbf14e8f418f429798e7097a96e3a7e8b9

Code cleanup: avoid sin/cos calls when drawing sun lamp

===================================================================

M	source/blender/editors/space_view3d/drawobject.c

===================================================================

diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 6e8e1ff..86383ba 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -1218,7 +1218,7 @@ static void drawlamp(View3D *v3d, RegionView3D *rv3d, Base *base,
 		short axis;
 		
 		/* setup a 45 degree rotation matrix */
-		axis_angle_normalized_to_mat3(mat, imat[2], (float)M_PI / 4.0f);
+		axis_angle_normalized_to_mat3_ex(mat, imat[2], M_SQRT1_2, M_SQRT1_2);
 
 		/* vectors */
 		mul_v3_v3fl(v1, imat[0], circrad * 1.2f);




More information about the Bf-blender-cvs mailing list