diff options
author | Hallam Roberts <MysteryPancake> | 2022-03-11 18:14:05 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-03-11 20:27:58 +0300 |
commit | 3da84d8b086bd2d09beb5bdb89ba6beddf1e1dd6 (patch) | |
tree | 698e6793ba776716a256abf10ed4b1623ade15eb /intern/ghost | |
parent | 62a0984d7290cbd6fd3acfa79d53765f97f93b0a (diff) |
Cleanup: use M_PI_2 and M_PI_4 where possible
The constant M_PI_4 is added to GLSL to ensure it works there too.
Differential Revision: https://developer.blender.org/D14288
Diffstat (limited to 'intern/ghost')
-rw-r--r-- | intern/ghost/intern/GHOST_Wintab.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/intern/ghost/intern/GHOST_Wintab.cpp b/intern/ghost/intern/GHOST_Wintab.cpp index aaf9503b294..2547a38c0d1 100644 --- a/intern/ghost/intern/GHOST_Wintab.cpp +++ b/intern/ghost/intern/GHOST_Wintab.cpp @@ -326,7 +326,7 @@ void GHOST_Wintab::getInput(std::vector<GHOST_WintabInfoWin32> &outWintabInfo) ORIENTATION ort = pkt.pkOrientation; /* Convert raw fixed point data to radians. */ - float altRad = (float)((fabs((float)ort.orAltitude) / (float)m_maxAltitude) * M_PI / 2.0); + float altRad = (float)((fabs((float)ort.orAltitude) / (float)m_maxAltitude) * M_PI_2); float azmRad = (float)(((float)ort.orAzimuth / (float)m_maxAzimuth) * M_PI * 2.0); /* Find length of the stylus' projected vector on the XY plane. */ @@ -334,7 +334,7 @@ void GHOST_Wintab::getInput(std::vector<GHOST_WintabInfoWin32> &outWintabInfo) /* From there calculate X and Y components based on azimuth. */ out.tabletData.Xtilt = sin(azmRad) * vecLen; - out.tabletData.Ytilt = (float)(sin(M_PI / 2.0 - azmRad) * vecLen); + out.tabletData.Ytilt = (float)(sin(M_PI_2 - azmRad) * vecLen); } out.time = pkt.pkTime; |