#include "q_shared.h"
#include <float.h>
Include dependency graph for math_angles.cpp:

Go to the source code of this file.
Functions | |
| void | toAngles (idVec3_t &src, angles_t &dst) |
| void | toAngles (quat_t &src, angles_t &dst) |
| void | toAngles (mat3_t &src, angles_t &dst) |
Variables | |
| angles_t | ang_zero (0.0f, 0.0f, 0.0f) |
|
||||||||||||
|
Definition at line 62 of file math_angles.cpp. References angles_t::pitch, angles_t::roll, src, and angles_t::yaw. Referenced by toAngles().
|
|
||||||||||||
|
Definition at line 55 of file math_angles.cpp. References src, toAngles(), and toMatrix().
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 27 of file math_angles.cpp. References asin(), atan2(), cos(), cp, angles_t::pitch, angles_t::roll, src, and angles_t::yaw. 00027 {
00028 double theta;
00029 double cp;
00030 double sp;
00031
00032 sp = src[ 0 ][ 2 ];
00033
00034 // cap off our sin value so that we don't get any NANs
00035 if ( sp > 1.0 ) {
00036 sp = 1.0;
00037 } else if ( sp < -1.0 ) {
00038 sp = -1.0;
00039 }
00040
00041 theta = -asin( sp );
00042 cp = cos( theta );
00043
00044 if ( cp > 8192 * FLT_EPSILON ) {
00045 dst.pitch = theta * 180 / M_PI;
00046 dst.yaw = atan2( src[ 0 ][ 1 ], src[ 0 ][ 0 ] ) * 180 / M_PI;
00047 dst.roll = atan2( src[ 1 ][ 2 ], src[ 2 ][ 2 ] ) * 180 / M_PI;
00048 } else {
00049 dst.pitch = theta * 180 / M_PI;
00050 dst.yaw = -atan2( src[ 1 ][ 0 ], src[ 1 ][ 1 ] ) * 180 / M_PI;
00051 dst.roll = 0;
00052 }
00053 }
|
Here is the call graph for this function:

|
|
|
1.3.9.1