Change orientation unit to radian

This commit is contained in:
Anaël Seghezzi 2019-03-07 09:54:05 +01:00
parent 79ac263771
commit fa5882eb54
2 changed files with 6 additions and 6 deletions

View File

@ -1518,9 +1518,9 @@ typedef void (* GLFWjoystickfun)(int,int);
* @param[in] y pen position relative to the screen.
* @param[in] z pen position relative to the tablet.
* @param[in] pen pressure from 0.0 to 1.0.
* @param[in] pen pitch in degree.
* @param[in] pen yaw in degree.
* @param[in] pen roll in degree.
* @param[in] pen pitch in radian.
* @param[in] pen yaw in radian.
* @param[in] pen roll in radian.
*
* @sa @ref pen_tablet_data
* @sa @ref glfwSetPenTabletDataCallback

View File

@ -639,13 +639,13 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg,
x = ((double)(packet.x - contextInfo.lcInOrgX) / contextInfo.lcInExtX) * contextInfo.lcSysExtX + contextInfo.lcSysOrgX;
y = ((double)(packet.y - contextInfo.lcInOrgY) / contextInfo.lcInExtY) * contextInfo.lcSysExtY + contextInfo.lcSysOrgY;
z = ((double)(packet.z - contextInfo.lcOutOrgZ) / contextInfo.lcOutExtZ);
z = packet.z / 1024.0;
pressure = (double)(packet.normalPressure - pressureInfo.min) / (pressureInfo.max - pressureInfo.min);
if (aziInfo.resolution && altInfo.resolution) {
double alt = (double)(packet.orientation.altitude - altInfo.min) / (altInfo.max - altInfo.min);
double azi = (double)(packet.orientation.azimuth - aziInfo.min) / (aziInfo.max - aziInfo.min);
pitch = (0.5 - alt) * 180.0;
yaw = azi * 360.0;
pitch = alt * 3.14159265359;
yaw = azi * 6.28318530718;
}
if (rollInfo.resolution) { // roll seems to be mostly unsupported so this is untested
roll = (double)(packet.orientation.twist - rollInfo.min) / (rollInfo.max - rollInfo.min) * 360.0;