diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-03-22 03:14:56 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-03-22 03:14:56 +0300 |
commit | 74b3336107294d961ba544d1a6557ac3602df1fb (patch) | |
tree | de0021a8b37d17975eab24d0c961ab21feacff57 /source/blender/blenlib/intern | |
parent | 4394217b96313613ea18e7a8830ebc07fedf29a5 (diff) |
rotate_m4 was using degrees rather then radians.
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r-- | source/blender/blenlib/intern/math_matrix.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c index b3dd5a09f71..dcf927f7c43 100644 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@ -943,20 +943,15 @@ void translate_m4(float mat[][4],float Tx, float Ty, float Tz) mat[3][2] += (Tx*mat[0][2] + Ty*mat[1][2] + Tz*mat[2][2]); } -void rotate_m4(float mat[][4], char axis,float angle) +void rotate_m4(float mat[][4], const char axis, const float angle) { int col; - float temp[4]; + float temp[4]= {0.0f, 0.0f, 0.0f, 0.0f}; float cosine, sine; - for(col=0; col<4 ; col++) /* init temp to zero matrix */ - temp[col] = 0; - - angle = (float)(angle*(3.1415926535/180.0)); cosine = (float)cos(angle); sine = (float)sin(angle); switch(axis){ - case 'x': case 'X': for(col=0 ; col<4 ; col++) temp[col] = cosine*mat[1][col] + sine*mat[2][col]; @@ -966,7 +961,6 @@ void rotate_m4(float mat[][4], char axis,float angle) } break; - case 'y': case 'Y': for(col=0 ; col<4 ; col++) temp[col] = cosine*mat[0][col] - sine*mat[2][col]; @@ -976,7 +970,6 @@ void rotate_m4(float mat[][4], char axis,float angle) } break; - case 'z': case 'Z': for(col=0 ; col<4 ; col++) temp[col] = cosine*mat[0][col] + sine*mat[1][col]; |