Changeset 336 in flair-src for trunk/lib/FlairCore/src/Euler.cpp


Ignore:
Timestamp:
10/08/19 16:41:35 (5 years ago)
Author:
Sanahuja Guillaume
Message:

use float

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/Euler.cpp

    r157 r336  
    8181*/
    8282void 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);
    8585
    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);
    8888
    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);
    9191
    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);
    9494}
    9595
Note: See TracChangeset for help on using the changeset viewer.