-angles_t idVec3::toAngles( void ) {
- float forward;
- float yaw;
- float pitch;
-
- if ( ( x == 0 ) && ( y == 0 ) ) {
- yaw = 0;
- if ( z > 0 ) {
- pitch = 90;
- } else {
- pitch = 270;
- }
- } else {
- yaw = atan2( y, x ) * 180 / M_PI;
- if ( yaw < 0 ) {
- yaw += 360;
- }
-
- forward = ( float )idSqrt( x * x + y * y );
- pitch = atan2( z, forward ) * 180 / M_PI;
- if ( pitch < 0 ) {
- pitch += 360;
- }
- }
-
- return angles_t( -pitch, yaw, 0 );
-}
-*/
+ angles_t idVec3::toAngles( void ) {
+ float forward;
+ float yaw;
+ float pitch;
+
+ if ( ( x == 0 ) && ( y == 0 ) ) {
+ yaw = 0;
+ if ( z > 0 ) {
+ pitch = 90;
+ } else {
+ pitch = 270;
+ }
+ } else {
+ yaw = atan2( y, x ) * 180 / M_PI;
+ if ( yaw < 0 ) {
+ yaw += 360;
+ }
+
+ forward = ( float )idSqrt( x * x + y * y );
+ pitch = atan2( z, forward ) * 180 / M_PI;
+ if ( pitch < 0 ) {
+ pitch += 360;
+ }
+ }
+
+ return angles_t( -pitch, yaw, 0 );
+ }
+ */