prefer radians over degrees
Showing the changes to interface/src/Application.cpp (1 of 51 files). Show all
Unified · Split
| @@ -506,7 +506,7 @@ void Application::paintGL() { · 505 unmodified lines | |||
| 506 | float headHeight = _myAvatar->getHead()->calculateAverageEyePosition().y - _myAvatar->getPosition().y; | 506 | float headHeight = _myAvatar->getHead()->calculateAverageEyePosition().y - _myAvatar->getPosition().y; |
| 507 | _myCamera.setDistance(MIRROR_FULLSCREEN_DISTANCE * _myAvatar->getScale()); | 507 | _myCamera.setDistance(MIRROR_FULLSCREEN_DISTANCE * _myAvatar->getScale()); |
| 508 | _myCamera.setTargetPosition(_myAvatar->getPosition() + glm::vec3(0, headHeight, 0)); | 508 | _myCamera.setTargetPosition(_myAvatar->getPosition() + glm::vec3(0, headHeight, 0)); |
| 509 | _myCamera.setTargetRotation(_myAvatar->getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PIf, 0.0f))); | 509 | _myCamera.setTargetRotation(_myAvatar->getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PI, 0.0f))); |
| 510 | } | 510 | } |
| 511 | 511 | ||
| 512 | // Update camera position | 512 | // Update camera position |
| @@ -728,7 +728,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 215 unmodified lines | |||
| 728 | if (!_myAvatar->getDriveKeys(UP)) { | 728 | if (!_myAvatar->getDriveKeys(UP)) { |
| 729 | _myAvatar->jump(); | 729 | _myAvatar->jump(); |
| 730 | } | 730 | } |
| 731 | _myAvatar->setDriveKeys(UP, 1); | 731 | _myAvatar->setDriveKeys(UP, 1.f); |
| 732 | break; | 732 | break; |
| 733 | 733 | ||
| 734 | case Qt::Key_Asterisk: | 734 | case Qt::Key_Asterisk: |
| @@ -736,11 +736,11 @@ void Application::keyPressEvent(QKeyEvent* event) { · 1 unmodified line | |||
| 736 | break; | 736 | break; |
| 737 | 737 | ||
| 738 | case Qt::Key_C: | 738 | case Qt::Key_C: |
| 739 | _myAvatar->setDriveKeys(DOWN, 1); | 739 | _myAvatar->setDriveKeys(DOWN, 1.f); |
| 740 | break; | 740 | break; |
| 741 | 741 | ||
| 742 | case Qt::Key_W: | 742 | case Qt::Key_W: |
| 743 | _myAvatar->setDriveKeys(FWD, 1); | 743 | _myAvatar->setDriveKeys(FWD, 1.f); |
| 744 | break; | 744 | break; |
| 745 | 745 | ||
| 746 | case Qt::Key_S: | 746 | case Qt::Key_S: |
| @@ -749,7 +749,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 2 unmodified lines | |||
| 749 | } else if (!isShifted && isMeta) { | 749 | } else if (!isShifted && isMeta) { |
| 750 | takeSnapshot(); | 750 | takeSnapshot(); |
| 751 | } else { | 751 | } else { |
| 752 | _myAvatar->setDriveKeys(BACK, 1); | 752 | _myAvatar->setDriveKeys(BACK, 1.f); |
| 753 | } | 753 | } |
| 754 | break; | 754 | break; |
| 755 | 755 | ||
| @@ -767,12 +767,12 @@ void Application::keyPressEvent(QKeyEvent* event) { · 11 unmodified lines | |||
| 767 | if (isShifted) { | 767 | if (isShifted) { |
| 768 | Menu::getInstance()->triggerOption(MenuOption::Atmosphere); | 768 | Menu::getInstance()->triggerOption(MenuOption::Atmosphere); |
| 769 | } else { | 769 | } else { |
| 770 | _myAvatar->setDriveKeys(ROT_LEFT, 1); | 770 | _myAvatar->setDriveKeys(ROT_LEFT, 1.f); |
| 771 | } | 771 | } |
| 772 | break; | 772 | break; |
| 773 | 773 | ||
| 774 | case Qt::Key_D: | 774 | case Qt::Key_D: |
| 775 | _myAvatar->setDriveKeys(ROT_RIGHT, 1); | 775 | _myAvatar->setDriveKeys(ROT_RIGHT, 1.f); |
| 776 | break; | 776 | break; |
| 777 | 777 | ||
| 778 | case Qt::Key_Return: | 778 | case Qt::Key_Return: |
| @@ -781,19 +781,19 @@ void Application::keyPressEvent(QKeyEvent* event) { · 2 unmodified lines | |||
| 781 | break; | 781 | break; |
| 782 | 782 | ||
| 783 | case Qt::Key_Up: | 783 | case Qt::Key_Up: |
| 784 | _myAvatar->setDriveKeys(isShifted ? UP : FWD, 1); | 784 | _myAvatar->setDriveKeys(isShifted ? UP : FWD, 1.f); |
| 785 | break; | 785 | break; |
| 786 | 786 | ||
| 787 | case Qt::Key_Down: | 787 | case Qt::Key_Down: |
| 788 | _myAvatar->setDriveKeys(isShifted ? DOWN : BACK, 1); | 788 | _myAvatar->setDriveKeys(isShifted ? DOWN : BACK, 1.f); |
| 789 | break; | 789 | break; |
| 790 | 790 | ||
| 791 | case Qt::Key_Left: | 791 | case Qt::Key_Left: |
| 792 | _myAvatar->setDriveKeys(isShifted ? LEFT : ROT_LEFT, 1); | 792 | _myAvatar->setDriveKeys(isShifted ? LEFT : ROT_LEFT, 1.f); |
| 793 | break; | 793 | break; |
| 794 | 794 | ||
| 795 | case Qt::Key_Right: | 795 | case Qt::Key_Right: |
| 796 | _myAvatar->setDriveKeys(isShifted ? RIGHT : ROT_RIGHT, 1); | 796 | _myAvatar->setDriveKeys(isShifted ? RIGHT : ROT_RIGHT, 1.f); |
| 797 | break; | 797 | break; |
| 798 | 798 | ||
| 799 | case Qt::Key_I: | 799 | case Qt::Key_I: |
| @@ -922,47 +922,47 @@ void Application::keyReleaseEvent(QKeyEvent* event) { · 122 unmodified lines | |||
| 922 | if (activeWindow() == _window) { | 922 | if (activeWindow() == _window) { |
| 923 | switch (event->key()) { | 923 | switch (event->key()) { |
| 924 | case Qt::Key_E: | 924 | case Qt::Key_E: |
| 925 | _myAvatar->setDriveKeys(UP, 0); | 925 | _myAvatar->setDriveKeys(UP, 0.f); |
| 926 | break; | 926 | break; |
| 927 | 927 | ||
| 928 | case Qt::Key_C: | 928 | case Qt::Key_C: |
| 929 | _myAvatar->setDriveKeys(DOWN, 0); | 929 | _myAvatar->setDriveKeys(DOWN, 0.f); |
| 930 | break; | 930 | break; |
| 931 | 931 | ||
| 932 | case Qt::Key_W: | 932 | case Qt::Key_W: |
| 933 | _myAvatar->setDriveKeys(FWD, 0); | 933 | _myAvatar->setDriveKeys(FWD, 0.f); |
| 934 | break; | 934 | break; |
| 935 | 935 | ||
| 936 | case Qt::Key_S: | 936 | case Qt::Key_S: |
| 937 | _myAvatar->setDriveKeys(BACK, 0); | 937 | _myAvatar->setDriveKeys(BACK, 0.f); |
| 938 | break; | 938 | break; |
| 939 | 939 | ||
| 940 | case Qt::Key_A: | 940 | case Qt::Key_A: |
| 941 | _myAvatar->setDriveKeys(ROT_LEFT, 0); | 941 | _myAvatar->setDriveKeys(ROT_LEFT, 0.f); |
| 942 | break; | 942 | break; |
| 943 | 943 | ||
| 944 | case Qt::Key_D: | 944 | case Qt::Key_D: |
| 945 | _myAvatar->setDriveKeys(ROT_RIGHT, 0); | 945 | _myAvatar->setDriveKeys(ROT_RIGHT, 0.f); |
| 946 | break; | 946 | break; |
| 947 | 947 | ||
| 948 | case Qt::Key_Up: | 948 | case Qt::Key_Up: |
| 949 | _myAvatar->setDriveKeys(FWD, 0); | 949 | _myAvatar->setDriveKeys(FWD, 0.f); |
| 950 | _myAvatar->setDriveKeys(UP, 0); | 950 | _myAvatar->setDriveKeys(UP, 0.f); |
| 951 | break; | 951 | break; |
| 952 | 952 | ||
| 953 | case Qt::Key_Down: | 953 | case Qt::Key_Down: |
| 954 | _myAvatar->setDriveKeys(BACK, 0); | 954 | _myAvatar->setDriveKeys(BACK, 0.f); |
| 955 | _myAvatar->setDriveKeys(DOWN, 0); | 955 | _myAvatar->setDriveKeys(DOWN, 0.f); |
| 956 | break; | 956 | break; |
| 957 | 957 | ||
| 958 | case Qt::Key_Left: | 958 | case Qt::Key_Left: |
| 959 | _myAvatar->setDriveKeys(LEFT, 0); | 959 | _myAvatar->setDriveKeys(LEFT, 0.f); |
| 960 | _myAvatar->setDriveKeys(ROT_LEFT, 0); | 960 | _myAvatar->setDriveKeys(ROT_LEFT, 0.f); |
| 961 | break; | 961 | break; |
| 962 | 962 | ||
| 963 | case Qt::Key_Right: | 963 | case Qt::Key_Right: |
| 964 | _myAvatar->setDriveKeys(RIGHT, 0); | 964 | _myAvatar->setDriveKeys(RIGHT, 0.f); |
| 965 | _myAvatar->setDriveKeys(ROT_RIGHT, 0); | 965 | _myAvatar->setDriveKeys(ROT_RIGHT, 0.f); |
| 966 | break; | 966 | break; |
| 967 | 967 | ||
| 968 | default: | 968 | default: |
| @@ -1464,7 +1464,7 @@ void Application::init() { · 495 unmodified lines | |||
| 1464 | 3.0f * TREE_SCALE / 2.0f)); | 1464 | 3.0f * TREE_SCALE / 2.0f)); |
| 1465 | _sharedVoxelSystemViewFrustum.setNearClip(TREE_SCALE / 2.0f); | 1465 | _sharedVoxelSystemViewFrustum.setNearClip(TREE_SCALE / 2.0f); |
| 1466 | _sharedVoxelSystemViewFrustum.setFarClip(3.0f * TREE_SCALE / 2.0f); | 1466 | _sharedVoxelSystemViewFrustum.setFarClip(3.0f * TREE_SCALE / 2.0f); |
| 1467 | _sharedVoxelSystemViewFrustum.setFieldOfView(90); | 1467 | _sharedVoxelSystemViewFrustum.setFieldOfView(90.f); |
| 1468 | _sharedVoxelSystemViewFrustum.setOrientation(glm::quat()); | 1468 | _sharedVoxelSystemViewFrustum.setOrientation(glm::quat()); |
| 1469 | _sharedVoxelSystemViewFrustum.calculate(); | 1469 | _sharedVoxelSystemViewFrustum.calculate(); |
| 1470 | _sharedVoxelSystem.setViewFrustum(&_sharedVoxelSystemViewFrustum); | 1470 | _sharedVoxelSystem.setViewFrustum(&_sharedVoxelSystemViewFrustum); |
| @@ -2094,7 +2094,7 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node · 623 unmodified lines | |||
| 2094 | void Application::loadViewFrustum(Camera& camera, ViewFrustum& viewFrustum) { | 2094 | void Application::loadViewFrustum(Camera& camera, ViewFrustum& viewFrustum) { |
| 2095 | // We will use these below, from either the camera or head vectors calculated above | 2095 | // We will use these below, from either the camera or head vectors calculated above |
| 2096 | glm::vec3 position(camera.getPosition()); | 2096 | glm::vec3 position(camera.getPosition()); |
| 2097 | float fov = camera.getFieldOfView(); | 2097 | float fov = camera.getFieldOfView(); // degrees |
| 2098 | float nearClip = camera.getNearClip(); | 2098 | float nearClip = camera.getNearClip(); |
| 2099 | float farClip = camera.getFarClip(); | 2099 | float farClip = camera.getFarClip(); |
| 2100 | float aspectRatio = camera.getAspectRatio(); | 2100 | float aspectRatio = camera.getAspectRatio(); |
| @@ -2107,7 +2107,7 @@ void Application::loadViewFrustum(Camera& camera, ViewFrustum& viewFrustum) { · 6 unmodified lines | |||
| 2107 | 2107 | ||
| 2108 | // Also make sure it's got the correct lens details from the camera | 2108 | // Also make sure it's got the correct lens details from the camera |
| 2109 | viewFrustum.setAspectRatio(aspectRatio); | 2109 | viewFrustum.setAspectRatio(aspectRatio); |
| 2110 | viewFrustum.setFieldOfView(fov); | 2110 | viewFrustum.setFieldOfView(fov); // degrees |
| 2111 | viewFrustum.setNearClip(nearClip); | 2111 | viewFrustum.setNearClip(nearClip); |
| 2112 | viewFrustum.setFarClip(farClip); | 2112 | viewFrustum.setFarClip(farClip); |
| 2113 | viewFrustum.setEyeOffsetPosition(camera.getEyeOffsetPosition()); | 2113 | viewFrustum.setEyeOffsetPosition(camera.getEyeOffsetPosition()); |
| @@ -2169,7 +2169,7 @@ void Application::updateShadowMap() { · 55 unmodified lines | |||
| 2169 | glPushMatrix(); | 2169 | glPushMatrix(); |
| 2170 | glLoadIdentity(); | 2170 | glLoadIdentity(); |
| 2171 | glm::vec3 axis = glm::axis(rotation); | 2171 | glm::vec3 axis = glm::axis(rotation); |
| 2172 | glRotatef(glm::angle(rotation), axis.x, axis.y, axis.z); | 2172 | glRotatef(glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z); |
| 2173 | 2173 | ||
| 2174 | // store view matrix without translation, which we'll use for precision-sensitive objects | 2174 | // store view matrix without translation, which we'll use for precision-sensitive objects |
| 2175 | glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat*)&_untranslatedViewMatrix); | 2175 | glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat*)&_untranslatedViewMatrix); |
| @@ -2248,7 +2248,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 72 unmodified lines | |||
| 2248 | glm::vec3 eyeOffsetPos = whichCamera.getEyeOffsetPosition(); | 2248 | glm::vec3 eyeOffsetPos = whichCamera.getEyeOffsetPosition(); |
| 2249 | glm::quat eyeOffsetOrient = whichCamera.getEyeOffsetOrientation(); | 2249 | glm::quat eyeOffsetOrient = whichCamera.getEyeOffsetOrientation(); |
| 2250 | glm::vec3 eyeOffsetAxis = glm::axis(eyeOffsetOrient); | 2250 | glm::vec3 eyeOffsetAxis = glm::axis(eyeOffsetOrient); |
| 2251 | glRotatef(-glm::angle(eyeOffsetOrient), eyeOffsetAxis.x, eyeOffsetAxis.y, eyeOffsetAxis.z); | 2251 | glRotatef(-glm::degrees(glm::angle(eyeOffsetOrient)), eyeOffsetAxis.x, eyeOffsetAxis.y, eyeOffsetAxis.z); |
| 2252 | glTranslatef(-eyeOffsetPos.x, -eyeOffsetPos.y, -eyeOffsetPos.z); | 2252 | glTranslatef(-eyeOffsetPos.x, -eyeOffsetPos.y, -eyeOffsetPos.z); |
| 2253 | 2253 | ||
| 2254 | // transform view according to whichCamera | 2254 | // transform view according to whichCamera |
| @@ -2257,7 +2257,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 2 unmodified lines | |||
| 2257 | 2257 | ||
| 2258 | glm::quat rotation = whichCamera.getRotation(); | 2258 | glm::quat rotation = whichCamera.getRotation(); |
| 2259 | glm::vec3 axis = glm::axis(rotation); | 2259 | glm::vec3 axis = glm::axis(rotation); |
| 2260 | glRotatef(-glm::angle(rotation), axis.x, axis.y, axis.z); | 2260 | glRotatef(-glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z); |
| 2261 | 2261 | ||
| 2262 | // store view matrix without translation, which we'll use for precision-sensitive objects | 2262 | // store view matrix without translation, which we'll use for precision-sensitive objects |
| 2263 | glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat*)&_untranslatedViewMatrix); | 2263 | glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat*)&_untranslatedViewMatrix); |
| @@ -2470,7 +2470,7 @@ void Application::displayOverlay() { · 206 unmodified lines | |||
| 2470 | (Menu::getInstance()->isOptionChecked(MenuOption::Stats) && | 2470 | (Menu::getInstance()->isOptionChecked(MenuOption::Stats) && |
| 2471 | Menu::getInstance()->isOptionChecked(MenuOption::Bandwidth)) | 2471 | Menu::getInstance()->isOptionChecked(MenuOption::Bandwidth)) |
| 2472 | ? 80 : 20; | 2472 | ? 80 : 20; |
| 2473 | drawText(_glWidget->width() - 100, _glWidget->height() - timerBottom, 0.30f, 1.0f, 0, frameTimer, WHITE_TEXT); | 2473 | drawText(_glWidget->width() - 100, _glWidget->height() - timerBottom, 0.30f, 1.0f, 0.f, frameTimer, WHITE_TEXT); |
| 2474 | } | 2474 | } |
| 2475 | 2475 | ||
| 2476 | _overlays.render2D(); | 2476 | _overlays.render2D(); |
| @@ -2525,11 +2525,11 @@ void Application::displayStats() { · 48 unmodified lines | |||
| 2525 | sprintf(framesPerSecond, "Framerate: %3.0f FPS", _fps); | 2525 | sprintf(framesPerSecond, "Framerate: %3.0f FPS", _fps); |
| 2526 | 2526 | ||
| 2527 | verticalOffset += STATS_PELS_PER_LINE; | 2527 | verticalOffset += STATS_PELS_PER_LINE; |
| 2528 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, serverNodes, WHITE_TEXT); | 2528 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, serverNodes, WHITE_TEXT); |
| 2529 | verticalOffset += STATS_PELS_PER_LINE; | 2529 | verticalOffset += STATS_PELS_PER_LINE; |
| 2530 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, avatarNodes, WHITE_TEXT); | 2530 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, avatarNodes, WHITE_TEXT); |
| 2531 | verticalOffset += STATS_PELS_PER_LINE; | 2531 | verticalOffset += STATS_PELS_PER_LINE; |
| 2532 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, framesPerSecond, WHITE_TEXT); | 2532 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, framesPerSecond, WHITE_TEXT); |
| 2533 | 2533 | ||
| 2534 | if (_statsExpanded) { | 2534 | if (_statsExpanded) { |
| 2535 | char packetsPerSecond[30]; | 2535 | char packetsPerSecond[30]; |
| @@ -2538,9 +2538,9 @@ void Application::displayStats() { · 2 unmodified lines | |||
| 2538 | sprintf(averageMegabitsPerSecond, "Mbps: %3.2f", (float)_bytesPerSecond * 8.f / 1000000.f); | 2538 | sprintf(averageMegabitsPerSecond, "Mbps: %3.2f", (float)_bytesPerSecond * 8.f / 1000000.f); |
| 2539 | 2539 | ||
| 2540 | verticalOffset += STATS_PELS_PER_LINE; | 2540 | verticalOffset += STATS_PELS_PER_LINE; |
| 2541 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, packetsPerSecond, WHITE_TEXT); | 2541 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, packetsPerSecond, WHITE_TEXT); |
| 2542 | verticalOffset += STATS_PELS_PER_LINE; | 2542 | verticalOffset += STATS_PELS_PER_LINE; |
| 2543 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, averageMegabitsPerSecond, WHITE_TEXT); | 2543 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, averageMegabitsPerSecond, WHITE_TEXT); |
| 2544 | } | 2544 | } |
| 2545 | 2545 | ||
| 2546 | verticalOffset = 0; | 2546 | verticalOffset = 0; |
| @@ -2583,7 +2583,7 @@ void Application::displayStats() { · 36 unmodified lines | |||
| 2583 | "Buffer msecs %.1f", | 2583 | "Buffer msecs %.1f", |
| 2584 | (float) (_audio.getNetworkBufferLengthSamplesPerChannel() + (float) _audio.getJitterBufferSamples()) / | 2584 | (float) (_audio.getNetworkBufferLengthSamplesPerChannel() + (float) _audio.getJitterBufferSamples()) / |
| 2585 | (float)_audio.getNetworkSampleRate() * 1000.f); | 2585 | (float)_audio.getNetworkSampleRate() * 1000.f); |
| 2586 | drawText(30, _glWidget->height() - 22, 0.10f, 0, 2, audioJitter, WHITE_TEXT); | 2586 | drawText(30, _glWidget->height() - 22, 0.10f, 0.f, 2.f, audioJitter, WHITE_TEXT); |
| 2587 | 2587 | ||
| 2588 | 2588 | ||
| 2589 | char audioPing[30]; | 2589 | char audioPing[30]; |
| @@ -2596,18 +2596,18 @@ void Application::displayStats() { · 6 unmodified lines | |||
| 2596 | sprintf(voxelAvgPing, "Voxel avg ping: %d", pingVoxel); | 2596 | sprintf(voxelAvgPing, "Voxel avg ping: %d", pingVoxel); |
| 2597 | 2597 | ||
| 2598 | verticalOffset += STATS_PELS_PER_LINE; | 2598 | verticalOffset += STATS_PELS_PER_LINE; |
| 2599 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, audioPing, WHITE_TEXT); | 2599 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, audioPing, WHITE_TEXT); |
| 2600 | verticalOffset += STATS_PELS_PER_LINE; | 2600 | verticalOffset += STATS_PELS_PER_LINE; |
| 2601 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, avatarPing, WHITE_TEXT); | 2601 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, avatarPing, WHITE_TEXT); |
| 2602 | verticalOffset += STATS_PELS_PER_LINE; | 2602 | verticalOffset += STATS_PELS_PER_LINE; |
| 2603 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, voxelAvgPing, WHITE_TEXT); | 2603 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, voxelAvgPing, WHITE_TEXT); |
| 2604 | 2604 | ||
| 2605 | if (_statsExpanded) { | 2605 | if (_statsExpanded) { |
| 2606 | char voxelMaxPing[30]; | 2606 | char voxelMaxPing[30]; |
| 2607 | sprintf(voxelMaxPing, "Voxel max ping: %d", pingVoxelMax); | 2607 | sprintf(voxelMaxPing, "Voxel max ping: %d", pingVoxelMax); |
| 2608 | 2608 | ||
| 2609 | verticalOffset += STATS_PELS_PER_LINE; | 2609 | verticalOffset += STATS_PELS_PER_LINE; |
| 2610 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, voxelMaxPing, WHITE_TEXT); | 2610 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, voxelMaxPing, WHITE_TEXT); |
| 2611 | } | 2611 | } |
| 2612 | 2612 | ||
| 2613 | verticalOffset = 0; | 2613 | verticalOffset = 0; |
| @@ -2635,11 +2635,11 @@ void Application::displayStats() { · 21 unmodified lines | |||
| 2635 | char avatarMixerStats[200]; | 2635 | char avatarMixerStats[200]; |
| 2636 | 2636 | ||
| 2637 | verticalOffset += STATS_PELS_PER_LINE; | 2637 | verticalOffset += STATS_PELS_PER_LINE; |
| 2638 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, avatarPosition, WHITE_TEXT); | 2638 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, avatarPosition, WHITE_TEXT); |
| 2639 | verticalOffset += STATS_PELS_PER_LINE; | 2639 | verticalOffset += STATS_PELS_PER_LINE; |
| 2640 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, avatarVelocity, WHITE_TEXT); | 2640 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, avatarVelocity, WHITE_TEXT); |
| 2641 | verticalOffset += STATS_PELS_PER_LINE; | 2641 | verticalOffset += STATS_PELS_PER_LINE; |
| 2642 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, avatarBodyYaw, WHITE_TEXT); | 2642 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, avatarBodyYaw, WHITE_TEXT); |
| 2643 | 2643 | ||
| 2644 | if (_statsExpanded) { | 2644 | if (_statsExpanded) { |
| 2645 | SharedNodePointer avatarMixer = NodeList::getInstance()->soloNodeOfType(NodeType::AvatarMixer); | 2645 | SharedNodePointer avatarMixer = NodeList::getInstance()->soloNodeOfType(NodeType::AvatarMixer); |
| @@ -2652,7 +2652,7 @@ void Application::displayStats() { · 6 unmodified lines | |||
| 2652 | } | 2652 | } |
| 2653 | 2653 | ||
| 2654 | verticalOffset += STATS_PELS_PER_LINE; | 2654 | verticalOffset += STATS_PELS_PER_LINE; |
| 2655 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, avatarMixerStats, WHITE_TEXT); | 2655 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, avatarMixerStats, WHITE_TEXT); |
| 2656 | } | 2656 | } |
| 2657 | 2657 | ||
| 2658 | verticalOffset = 0; | 2658 | verticalOffset = 0; |
| @@ -2667,7 +2667,7 @@ void Application::displayStats() { · 8 unmodified lines | |||
| 2667 | voxelStats.str(""); | 2667 | voxelStats.str(""); |
| 2668 | voxelStats << "Voxels Memory Nodes: " << VoxelTreeElement::getTotalMemoryUsage() / 1000000.f << "MB"; | 2668 | voxelStats << "Voxels Memory Nodes: " << VoxelTreeElement::getTotalMemoryUsage() / 1000000.f << "MB"; |
| 2669 | verticalOffset += STATS_PELS_PER_LINE; | 2669 | verticalOffset += STATS_PELS_PER_LINE; |
| 2670 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | 2670 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); |
| 2671 | 2671 | ||
| 2672 | voxelStats.str(""); | 2672 | voxelStats.str(""); |
| 2673 | voxelStats << | 2673 | voxelStats << |
| @@ -2677,14 +2677,14 @@ void Application::displayStats() { · 3 unmodified lines | |||
| 2677 | voxelStats << " / GPU: " << _voxels.getVoxelMemoryUsageGPU() / 1000000.f << "MB"; | 2677 | voxelStats << " / GPU: " << _voxels.getVoxelMemoryUsageGPU() / 1000000.f << "MB"; |
| 2678 | } | 2678 | } |
| 2679 | verticalOffset += STATS_PELS_PER_LINE; | 2679 | verticalOffset += STATS_PELS_PER_LINE; |
| 2680 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | 2680 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); |
| 2681 | 2681 | ||
| 2682 | // Voxel Rendering | 2682 | // Voxel Rendering |
| 2683 | voxelStats.str(""); | 2683 | voxelStats.str(""); |
| 2684 | voxelStats.precision(4); | 2684 | voxelStats.precision(4); |
| 2685 | voxelStats << "Voxel Rendering Slots Max: " << _voxels.getMaxVoxels() / 1000.f << "K"; | 2685 | voxelStats << "Voxel Rendering Slots Max: " << _voxels.getMaxVoxels() / 1000.f << "K"; |
| 2686 | verticalOffset += STATS_PELS_PER_LINE; | 2686 | verticalOffset += STATS_PELS_PER_LINE; |
| 2687 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | 2687 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); |
| 2688 | } | 2688 | } |
| 2689 | 2689 | ||
| 2690 | voxelStats.str(""); | 2690 | voxelStats.str(""); |
| @@ -2692,7 +2692,7 @@ void Application::displayStats() { · 1 unmodified line | |||
| 2692 | voxelStats << "Drawn: " << _voxels.getVoxelsWritten() / 1000.f << "K " << | 2692 | voxelStats << "Drawn: " << _voxels.getVoxelsWritten() / 1000.f << "K " << |
| 2693 | "Abandoned: " << _voxels.getAbandonedVoxels() / 1000.f << "K "; | 2693 | "Abandoned: " << _voxels.getAbandonedVoxels() / 1000.f << "K "; |
| 2694 | verticalOffset += STATS_PELS_PER_LINE; | 2694 | verticalOffset += STATS_PELS_PER_LINE; |
| 2695 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | 2695 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); |
| 2696 | 2696 | ||
| 2697 | // iterate all the current voxel stats, and list their sending modes, and total voxel counts | 2697 | // iterate all the current voxel stats, and list their sending modes, and total voxel counts |
| 2698 | std::stringstream sendingMode(""); | 2698 | std::stringstream sendingMode(""); |
| @@ -2736,7 +2736,7 @@ void Application::displayStats() { · 37 unmodified lines | |||
| 2736 | sendingMode << " <SCENE STABLE>"; | 2736 | sendingMode << " <SCENE STABLE>"; |
| 2737 | } | 2737 | } |
| 2738 | verticalOffset += STATS_PELS_PER_LINE; | 2738 | verticalOffset += STATS_PELS_PER_LINE; |
| 2739 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)sendingMode.str().c_str(), WHITE_TEXT); | 2739 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)sendingMode.str().c_str(), WHITE_TEXT); |
| 2740 | } | 2740 | } |
| 2741 | 2741 | ||
| 2742 | // Incoming packets | 2742 | // Incoming packets |
| @@ -2748,7 +2748,7 @@ void Application::displayStats() { · 5 unmodified lines | |||
| 2748 | voxelStats << "Voxel Packets to Process: " << packetsString.toLocal8Bit().constData() | 2748 | voxelStats << "Voxel Packets to Process: " << packetsString.toLocal8Bit().constData() |
| 2749 | << " [Recent Max: " << maxString.toLocal8Bit().constData() << "]"; | 2749 | << " [Recent Max: " << maxString.toLocal8Bit().constData() << "]"; |
| 2750 | verticalOffset += STATS_PELS_PER_LINE; | 2750 | verticalOffset += STATS_PELS_PER_LINE; |
| 2751 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | 2751 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); |
| 2752 | } | 2752 | } |
| 2753 | 2753 | ||
| 2754 | if (_resetRecentMaxPacketsSoon && voxelPacketsToProcess > 0) { | 2754 | if (_resetRecentMaxPacketsSoon && voxelPacketsToProcess > 0) { |
| @@ -2771,7 +2771,7 @@ void Application::displayStats() { · 16 unmodified lines | |||
| 2771 | voxelStats.str(""); | 2771 | voxelStats.str(""); |
| 2772 | voxelStats << "Server voxels: " << serversTotalString.toLocal8Bit().constData(); | 2772 | voxelStats << "Server voxels: " << serversTotalString.toLocal8Bit().constData(); |
| 2773 | verticalOffset += STATS_PELS_PER_LINE; | 2773 | verticalOffset += STATS_PELS_PER_LINE; |
| 2774 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | 2774 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); |
| 2775 | 2775 | ||
| 2776 | if (_statsExpanded) { | 2776 | if (_statsExpanded) { |
| 2777 | QString serversInternalString = locale.toString((uint)totalInternal); | 2777 | QString serversInternalString = locale.toString((uint)totalInternal); |
| @@ -2782,7 +2782,7 @@ void Application::displayStats() { · 4 unmodified lines | |||
| 2782 | "Internal: " << serversInternalString.toLocal8Bit().constData() << " " << | 2782 | "Internal: " << serversInternalString.toLocal8Bit().constData() << " " << |
| 2783 | "Leaves: " << serversLeavesString.toLocal8Bit().constData() << ""; | 2783 | "Leaves: " << serversLeavesString.toLocal8Bit().constData() << ""; |
| 2784 | verticalOffset += STATS_PELS_PER_LINE; | 2784 | verticalOffset += STATS_PELS_PER_LINE; |
| 2785 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | 2785 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); |
| 2786 | } | 2786 | } |
| 2787 | 2787 | ||
| 2788 | unsigned long localTotal = VoxelTreeElement::getNodeCount(); | 2788 | unsigned long localTotal = VoxelTreeElement::getNodeCount(); |
| @@ -2792,7 +2792,7 @@ void Application::displayStats() { · 3 unmodified lines | |||
| 2792 | voxelStats.str(""); | 2792 | voxelStats.str(""); |
| 2793 | voxelStats << "Local voxels: " << localTotalString.toLocal8Bit().constData(); | 2793 | voxelStats << "Local voxels: " << localTotalString.toLocal8Bit().constData(); |
| 2794 | verticalOffset += STATS_PELS_PER_LINE; | 2794 | verticalOffset += STATS_PELS_PER_LINE; |
| 2795 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | 2795 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); |
| 2796 | 2796 | ||
| 2797 | if (_statsExpanded) { | 2797 | if (_statsExpanded) { |
| 2798 | unsigned long localInternal = VoxelTreeElement::getInternalNodeCount(); | 2798 | unsigned long localInternal = VoxelTreeElement::getInternalNodeCount(); |
| @@ -2805,7 +2805,7 @@ void Application::displayStats() { · 6 unmodified lines | |||
| 2805 | "Internal: " << localInternalString.toLocal8Bit().constData() << " " << | 2805 | "Internal: " << localInternalString.toLocal8Bit().constData() << " " << |
| 2806 | "Leaves: " << localLeavesString.toLocal8Bit().constData() << ""; | 2806 | "Leaves: " << localLeavesString.toLocal8Bit().constData() << ""; |
| 2807 | verticalOffset += STATS_PELS_PER_LINE; | 2807 | verticalOffset += STATS_PELS_PER_LINE; |
| 2808 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | 2808 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); |
| 2809 | } | 2809 | } |
| 2810 | } | 2810 | } |
| 2811 | 2811 | ||
| @@ -2896,17 +2896,17 @@ glm::vec2 Application::getScaledScreenPoint(glm::vec2 projectedPoint) { · 84 unmodified lines | |||
| 2896 | void Application::renderRearViewMirror(const QRect& region, bool billboard) { | 2896 | void Application::renderRearViewMirror(const QRect& region, bool billboard) { |
| 2897 | bool eyeRelativeCamera = false; | 2897 | bool eyeRelativeCamera = false; |
| 2898 | if (billboard) { | 2898 | if (billboard) { |
| 2899 | _mirrorCamera.setFieldOfView(BILLBOARD_FIELD_OF_VIEW); | 2899 | _mirrorCamera.setFieldOfView(BILLBOARD_FIELD_OF_VIEW); // degees |
| 2900 | _mirrorCamera.setDistance(BILLBOARD_DISTANCE * _myAvatar->getScale()); | 2900 | _mirrorCamera.setDistance(BILLBOARD_DISTANCE * _myAvatar->getScale()); |
| 2901 | _mirrorCamera.setTargetPosition(_myAvatar->getPosition()); | 2901 | _mirrorCamera.setTargetPosition(_myAvatar->getPosition()); |
| 2902 | 2902 | ||
| 2903 | } else if (_rearMirrorTools->getZoomLevel() == BODY) { | 2903 | } else if (_rearMirrorTools->getZoomLevel() == BODY) { |
| 2904 | _mirrorCamera.setFieldOfView(MIRROR_FIELD_OF_VIEW); | 2904 | _mirrorCamera.setFieldOfView(MIRROR_FIELD_OF_VIEW); // degrees |
| 2905 | _mirrorCamera.setDistance(MIRROR_REARVIEW_BODY_DISTANCE * _myAvatar->getScale()); | 2905 | _mirrorCamera.setDistance(MIRROR_REARVIEW_BODY_DISTANCE * _myAvatar->getScale()); |
| 2906 | _mirrorCamera.setTargetPosition(_myAvatar->getChestPosition()); | 2906 | _mirrorCamera.setTargetPosition(_myAvatar->getChestPosition()); |
| 2907 | 2907 | ||
| 2908 | } else { // HEAD zoom level | 2908 | } else { // HEAD zoom level |
| 2909 | _mirrorCamera.setFieldOfView(MIRROR_FIELD_OF_VIEW); | 2909 | _mirrorCamera.setFieldOfView(MIRROR_FIELD_OF_VIEW); // degrees |
| 2910 | _mirrorCamera.setDistance(MIRROR_REARVIEW_DISTANCE * _myAvatar->getScale()); | 2910 | _mirrorCamera.setDistance(MIRROR_REARVIEW_DISTANCE * _myAvatar->getScale()); |
| 2911 | if (_myAvatar->getSkeletonModel().isActive() && _myAvatar->getHead()->getFaceModel().isActive()) { | 2911 | if (_myAvatar->getSkeletonModel().isActive() && _myAvatar->getHead()->getFaceModel().isActive()) { |
| 2912 | // as a hack until we have a better way of dealing with coordinate precision issues, reposition the | 2912 | // as a hack until we have a better way of dealing with coordinate precision issues, reposition the |
| @@ -2920,7 +2920,7 @@ void Application::renderRearViewMirror(const QRect& region, bool billboard) { · 7 unmodified lines | |||
| 2920 | } | 2920 | } |
| 2921 | _mirrorCamera.setAspectRatio((float)region.width() / region.height()); | 2921 | _mirrorCamera.setAspectRatio((float)region.width() / region.height()); |
| 2922 | 2922 | ||
| 2923 | _mirrorCamera.setTargetRotation(_myAvatar->getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PIf, 0.0f))); | 2923 | _mirrorCamera.setTargetRotation(_myAvatar->getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PI, 0.0f))); |
| 2924 | _mirrorCamera.update(1.0f/_fps); | 2924 | _mirrorCamera.update(1.0f/_fps); |
| 2925 | 2925 | ||
| 2926 | // set the bounds of rear mirror view | 2926 | // set the bounds of rear mirror view |