#include <math_angles.h>
|
|
Definition at line 85 of file math_angles.h. 00085 {}
|
|
||||||||||||||||
|
Definition at line 87 of file math_angles.h. 00087 {
00088 this->pitch = pitch;
00089 this->yaw = yaw;
00090 this->roll = roll;
00091 }
|
|
|
Definition at line 93 of file math_angles.h. References pitch, roll, idVec3_t::x, idVec3_t::y, yaw, and idVec3_t::z.
|
|
|
|
|
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
Definition at line 135 of file math_angles.cpp. References Normalize360(), pitch, roll, and yaw. 00135 {
00136 Normalize360();
00137
00138 if ( pitch > 180.0 ) {
00139 pitch -= 360.0;
00140 }
00141
00142 if ( yaw > 180.0 ) {
00143 yaw -= 360.0;
00144 }
00145
00146 if ( roll > 180.0 ) {
00147 roll -= 360.0;
00148 }
00149 return *this;
00150 }
|
Here is the call graph for this function:

|
|
|
|
|
Definition at line 119 of file math_angles.cpp. References pitch, roll, and yaw. Referenced by Normalize180(). 00119 {
00120 pitch = (360.0 / 65536) * ( ( int )( pitch * ( 65536 / 360.0 ) ) & 65535 );
00121 yaw = (360.0 / 65536) * ( ( int )( yaw * ( 65536 / 360.0 ) ) & 65535 );
00122 roll = (360.0 / 65536) * ( ( int )( roll * ( 65536 / 360.0 ) ) & 65535 );
00123
00124 return *this;
00125 }
|
|
|
|
|
|
Definition at line 171 of file math_angles.h. References pitch, roll, and yaw.
|
|
|
|
|
|
Definition at line 109 of file math_angles.h. 00109 {
00110 return *( idVec3_t * )&pitch;
00111 }
|
|
|
|
|
|
|
|
|
Definition at line 143 of file math_angles.h. References a, pitch, roll, idVec3_t::x, idVec3_t::y, yaw, and idVec3_t::z.
|
|
|
Definition at line 135 of file math_angles.h. References a, pitch, roll, and yaw. 00135 {
00136 pitch += a.pitch;
00137 yaw += a.yaw;
00138 roll += a.roll;
00139
00140 return *this;
00141 }
|
|
|
|
|
|
Definition at line 155 of file math_angles.h. References a, pitch, roll, and yaw. 00155 {
00156 pitch -= a.pitch;
00157 yaw -= a.yaw;
00158 roll -= a.roll;
00159
00160 return *this;
00161 }
|
|
|
|
|
|
|
|
|
Definition at line 125 of file math_angles.h. References a, pitch, roll, and yaw.
|
|
|
Definition at line 119 of file math_angles.h. References a, pitch, roll, and yaw.
|
|
|
|
|
|
|
|
|
Definition at line 104 of file math_angles.h. References assert. 00104 {
00105 assert( ( index >= 0 ) && ( index < 3 ) );
00106 return ( &pitch )[ index ];
00107 }
|
|
|
Definition at line 99 of file math_angles.h. References assert. 00099 {
00100 assert( ( index >= 0 ) && ( index < 3 ) );
00101 return ( &pitch )[ index ];
00102 }
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
Definition at line 113 of file math_angles.h. 00113 {
00114 this->pitch = pitch;
00115 this->yaw = yaw;
00116 this->roll = roll;
00117 }
|
|
|
|
|
|
Definition at line 97 of file math_angles.cpp. References cos(), cp, M_PI, pitch, sin(), and yaw. 00097 {
00098 float angle;
00099 static float sp, sy, cp, cy; // static to help MS compiler fp bugs
00100
00101 angle = yaw * ( M_PI * 2 / 360 );
00102 sy = sin( angle );
00103 cy = cos( angle );
00104
00105 angle = pitch * ( M_PI * 2 / 360 );
00106 sp = sin( angle );
00107 cp = cos( angle );
00108
00109 return idVec3_t( cp * cy, cp * sy, -sp );
00110 }
|
Here is the call graph for this function:

|
||||||||||||||||
|
|
|
||||||||||||||||
|
Definition at line 68 of file math_angles.cpp. References cos(), cp, M_PI, pitch, right, roll, idVec3_t::set(), sin(), up, and yaw. 00068 {
00069 float angle;
00070 static float sr, sp, sy, cr, cp, cy; // static to help MS compiler fp bugs
00071
00072 angle = yaw * ( M_PI * 2 / 360 );
00073 sy = sin( angle );
00074 cy = cos( angle );
00075
00076 angle = pitch * ( M_PI * 2 / 360 );
00077 sp = sin( angle );
00078 cp = cos( angle );
00079
00080 angle = roll * ( M_PI * 2 / 360 );
00081 sr = sin( angle );
00082 cr = cos( angle );
00083
00084 if ( forward ) {
00085 forward->set( cp * cy, cp * sy, -sp );
00086 }
00087
00088 if ( right ) {
00089 right->set( -sr * sp * cy + cr * sy, -sr * sp * sy + -cr * cy, -sr * cp );
00090 }
00091
00092 if ( up ) {
00093 up->set( cr * sp * cy + -sr * -sy, cr * sp * sy + -sr * cy, cr * cp );
00094 }
00095 }
|
Here is the call graph for this function:

|
|
|
|
|
Definition at line 187 of file math_angles.h. References pitch, roll, and yaw.
|
|
||||||||||||
|
Definition at line 167 of file math_angles.h.
|
|
||||||||||||
|
Definition at line 163 of file math_angles.h.
|
|
||||||||||||
|
Definition at line 167 of file math_angles.h.
|
|
||||||||||||
|
Definition at line 163 of file math_angles.h.
|
|
||||||||||||
|
Definition at line 183 of file math_angles.h. 00183 {
00184 return ( ( a.pitch != b.pitch ) || ( a.yaw != b.yaw ) || ( a.roll != b.roll ) );
00185 }
|
|
||||||||||||
|
Definition at line 183 of file math_angles.h. 00183 {
00184 return ( ( a.pitch != b.pitch ) || ( a.yaw != b.yaw ) || ( a.roll != b.roll ) );
00185 }
|
|
||||||||||||
|
Definition at line 131 of file math_angles.h.
|
|
||||||||||||
|
Definition at line 131 of file math_angles.h.
|
|
||||||||||||
|
Definition at line 151 of file math_angles.h.
|
|
||||||||||||
|
Definition at line 151 of file math_angles.h.
|
|
||||||||||||
|
Definition at line 179 of file math_angles.h. 00179 {
00180 return ( ( a.pitch == b.pitch ) && ( a.yaw == b.yaw ) && ( a.roll == b.roll ) );
00181 }
|
|
||||||||||||
|
Definition at line 179 of file math_angles.h. 00179 {
00180 return ( ( a.pitch == b.pitch ) && ( a.yaw == b.yaw ) && ( a.roll == b.roll ) );
00181 }
|
|
||||||||||||
|
Definition at line 27 of file math_angles.cpp. 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 }
|
|
||||||||||||
|
Definition at line 55 of file math_angles.cpp.
|
|
||||||||||||
|
Definition at line 62 of file math_angles.cpp.
|
|
||||||||||||
|
Definition at line 27 of file math_angles.cpp. 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 }
|
|
||||||||||||
|
Definition at line 55 of file math_angles.cpp.
|
|
||||||||||||
|
Definition at line 62 of file math_angles.cpp.
|
|
|
Definition at line 37 of file math_angles.h. Referenced by angles_t(), Normalize180(), Normalize360(), operator *(), operator *=(), operator!=(), operator+(), operator+=(), operator-(), operator-=(), operator=(), operator==(), toAngles(), toForward(), toVectors(), and Zero(). |
|
|
Definition at line 39 of file math_angles.h. Referenced by angles_t(), Normalize180(), Normalize360(), operator *(), operator *=(), operator!=(), operator+(), operator+=(), operator-(), operator-=(), operator=(), operator==(), toAngles(), toVectors(), and Zero(). |
|
|
Definition at line 38 of file math_angles.h. Referenced by angles_t(), Normalize180(), Normalize360(), operator *(), operator *=(), operator!=(), operator+(), operator+=(), operator-(), operator-=(), operator=(), operator==(), toAngles(), toForward(), toVectors(), and Zero(). |
1.3.9.1