Changeset 336 in flair-src for trunk/lib/FlairCore/src/Euler.cpp
- Timestamp:
- Oct 8, 2019, 4:41:35 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore/src/Euler.cpp
r157 r336 81 81 */ 82 82 void Euler::ToQuaternion(Quaternion &quaternion) const { 83 quaternion.q0 = cos (yaw / 2) * cos(pitch / 2) * cos(roll / 2) +84 sin (yaw / 2) * sin(pitch / 2) * sin(roll / 2);83 quaternion.q0 = cosf(yaw / 2.0f) * cosf(pitch / 2.0f) * cosf(roll / 2.0f) + 84 sinf(yaw / 2.0f) * sinf(pitch / 2.0f) * sinf(roll / 2.0f); 85 85 86 quaternion.q1 = cos (yaw / 2) * cos(pitch / 2) * sin(roll / 2) -87 sin (yaw / 2) * sin(pitch / 2) * cos(roll / 2);86 quaternion.q1 = cosf(yaw / 2.0f) * cosf(pitch / 2.0f) * sinf(roll / 2.0f) - 87 sinf(yaw / 2.0f) * sinf(pitch / 2.0f) * cosf(roll / 2.0f); 88 88 89 quaternion.q2 = cos (yaw / 2) * sin(pitch / 2) * cos(roll / 2) +90 sin (yaw / 2) * cos(pitch / 2) * sin(roll / 2);89 quaternion.q2 = cosf(yaw / 2.0f) * sinf(pitch / 2.0f) * cosf(roll / 2.0f) + 90 sinf(yaw / 2.0f) * cosf(pitch / 2.0f) * sinf(roll / 2.0f); 91 91 92 quaternion.q3 = sin (yaw / 2) * cos(pitch / 2) * cos(roll / 2) -93 cos (yaw / 2) * sin(pitch / 2) * sin(roll / 2);92 quaternion.q3 = sinf(yaw / 2.0f) * cosf(pitch / 2.0f) * cosf(roll / 2.0f) - 93 cosf(yaw / 2.0f) * sinf(pitch / 2.0f) * sinf(roll / 2.0f); 94 94 } 95 95
Note:
See TracChangeset
for help on using the changeset viewer.