forked from bartvdbraak/blender
rotate_m4 was using degrees rather then radians.
This commit is contained in:
parent
4394217b96
commit
74b3336107
@ -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];
|
||||
|
@ -1130,7 +1130,6 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *arg_unuse
|
||||
char version_buf[128];
|
||||
char revision_buf[128];
|
||||
extern char build_rev[];
|
||||
char *cp;
|
||||
|
||||
version_str = &version_buf[0];
|
||||
revision_str = &revision_buf[0];
|
||||
|
Loading…
Reference in New Issue
Block a user