diff options
author | Ton Roosendaal <ton@blender.org> | 2003-12-24 14:44:57 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2003-12-24 14:44:57 +0300 |
commit | b3911687eef461bbdb2b25f88bb166a2ae119a19 (patch) | |
tree | ef1348dd114c5a50a45be8dfb58a324008fceb71 /source/blender/blenlib | |
parent | 8fbff1a3b7c2c85591681f2682b0343b70dc1853 (diff) |
- only cosmetic stuff; result of going over the output of mipspro cc
compile round. Wrong prototypes, unused variables, zealot const usage,
and in action.c fixed insane & unreadable function call syntax.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_arithb.h | 12 | ||||
-rw-r--r-- | source/blender/blenlib/intern/arithb.c | 53 |
2 files changed, 4 insertions, 61 deletions
diff --git a/source/blender/blenlib/BLI_arithb.h b/source/blender/blenlib/BLI_arithb.h index eeb64d789ca..78f662ce67c 100644 --- a/source/blender/blenlib/BLI_arithb.h +++ b/source/blender/blenlib/BLI_arithb.h @@ -118,7 +118,7 @@ Crossf( void Projf( - float *c, const float *v1, const float *v2 + float *c, float *v1, float *v2 ); /** @@ -628,16 +628,6 @@ QuatToMat4( float m[][4] ); void -QuatToSpher( - float *quat, - float *sph -); - void -Mat3ToSpher( - float *mat, - float *sph -); - void Mat3ToQuat_is_ok( float wmat[][3], float *q diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index 715917d047f..70f24219249 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -120,7 +120,7 @@ float Inpf( float *v1, float *v2) } /* Project v1 on v2 */ -void Projf(float *c, const float *v1, const float *v2) +void Projf(float *c, float *v1, float *v2) { float mul; mul = Inpf(v1, v2) / Inpf(v2, v2); @@ -1937,8 +1937,8 @@ void EulToMat4( float *eul,float mat[][4]) } -void Mat3ToEul(float tmat[][3], float *eul -){ +void Mat3ToEul(float tmat[][3], float *eul) +{ float cy, quat[4], mat[3][3]; Mat3ToQuat(tmat, quat); @@ -1994,53 +1994,6 @@ void QuatToEul( float *quat, float *eul) Mat3ToEul(mat, eul); } -void QuatToSpher( float *quat, float *sph) -/* Not working 100% yet I don't think... */ -{ - float tx, ty, tz; - float qw, qx, qy, qz; - float cos_theta; - float sin_theta; - - qx = quat[0]; - qy = quat[1]; - qz = quat[2]; - qw = quat[3]; - - cos_theta = qw; - sin_theta = (float)sqrt(1.0 - cos_theta * cos_theta); - - if (fabs(sin_theta) < 0.0005) - sin_theta = 1.0; - - tx = qx / sin_theta; - ty = qy / sin_theta; - tz = qz / sin_theta; - - /* Lattitude */ - sph[0] = -(float)asin(ty); - - /* Longitude */ - if (tx*tx + tz*tz <0.0005) - sph[1] = 0.0; - else - sph[1] = (float)atan2(tx, tz); - - if (sph[1] < 0.0) - sph[1] +=(float)(M_PI*2); - - /* Roll */ - sph[2] = (float)(acos(cos_theta) * 2.0) ; -} - -void Mat3ToSpher ( float *mat3, float *sph) -{ - float quat[4]; - - Mat3ToQuat(mat3, quat); - QuatToSpher(quat, sph); -} - void EulToQuat( float *eul, float *quat) { |