Showing the changes to interface/src/Application.cpp (1 of 85 files). Show all
Unified · Split
| @@ -154,7 +154,6 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 153 unmodified lines | ||
| 154 | 154 | _touchAvgY(0.0f), |
| 155 | 155 | _isTouchPressed(false), |
| 156 | 156 | _mousePressed(false), |
| 157 | − _chatEntryOn(false), | |
| 158 | 157 | _audio(&_audioScope, STARTUP_JITTER_SAMPLES), |
| 159 | 158 | _enableProcessVoxelsThread(true), |
| 160 | 159 | _voxelProcessor(), |
| @@ -508,7 +507,7 @@ void Application::paintGL() { · 347 unmodified lines | ||
| 508 | 507 | float headHeight = _myAvatar->getHead()->calculateAverageEyePosition().y - _myAvatar->getPosition().y; |
| 509 | 508 | _myCamera.setDistance(MIRROR_FULLSCREEN_DISTANCE * _myAvatar->getScale()); |
| 510 | 509 | _myCamera.setTargetPosition(_myAvatar->getPosition() + glm::vec3(0, headHeight, 0)); |
| 511 | − _myCamera.setTargetRotation(_myAvatar->getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PIf, 0.0f))); | |
| 510 | + _myCamera.setTargetRotation(_myAvatar->getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PI, 0.0f))); | |
| 512 | 511 | } |
| 513 | 512 | |
| 514 | 513 | // Update camera position |
| @@ -699,21 +698,6 @@ void Application::keyPressEvent(QKeyEvent* event) { · 184 unmodified lines | ||
| 699 | 698 | } |
| 700 | 699 | |
| 701 | 700 | if (activeWindow() == _window) { |
| 702 | − if (_chatEntryOn) { | |
| 703 | − if (_chatEntry.keyPressEvent(event)) { | |
| 704 | − _myAvatar->setKeyState(event->key() == Qt::Key_Backspace || event->key() == Qt::Key_Delete ? | |
| 705 | − DELETE_KEY_DOWN : INSERT_KEY_DOWN); | |
| 706 | − _myAvatar->setChatMessage(string(_chatEntry.getContents().size(), SOLID_BLOCK_CHAR)); | |
| 707 | − | |
| 708 | − } else { | |
| 709 | − _myAvatar->setChatMessage(_chatEntry.getContents()); | |
| 710 | − _chatEntry.clear(); | |
| 711 | − _chatEntryOn = false; | |
| 712 | − setMenuShortcutsEnabled(true); | |
| 713 | − } | |
| 714 | − return; | |
| 715 | − } | |
| 716 | − | |
| 717 | 701 | bool isShifted = event->modifiers().testFlag(Qt::ShiftModifier); |
| 718 | 702 | bool isMeta = event->modifiers().testFlag(Qt::ControlModifier); |
| 719 | 703 | switch (event->key()) { |
| @@ -745,7 +729,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 25 unmodified lines | ||
| 745 | 729 | if (!_myAvatar->getDriveKeys(UP)) { |
| 746 | 730 | _myAvatar->jump(); |
| 747 | 731 | } |
| 748 | − _myAvatar->setDriveKeys(UP, 1); | |
| 732 | + _myAvatar->setDriveKeys(UP, 1.f); | |
| 749 | 733 | break; |
| 750 | 734 | |
| 751 | 735 | case Qt::Key_Asterisk: |
| @@ -753,11 +737,11 @@ void Application::keyPressEvent(QKeyEvent* event) { · 1 unmodified line | ||
| 753 | 737 | break; |
| 754 | 738 | |
| 755 | 739 | case Qt::Key_C: |
| 756 | − _myAvatar->setDriveKeys(DOWN, 1); | |
| 740 | + _myAvatar->setDriveKeys(DOWN, 1.f); | |
| 757 | 741 | break; |
| 758 | 742 | |
| 759 | 743 | case Qt::Key_W: |
| 760 | − _myAvatar->setDriveKeys(FWD, 1); | |
| 744 | + _myAvatar->setDriveKeys(FWD, 1.f); | |
| 761 | 745 | break; |
| 762 | 746 | |
| 763 | 747 | case Qt::Key_S: |
| @@ -766,7 +750,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 2 unmodified lines | ||
| 766 | 750 | } else if (!isShifted && isMeta) { |
| 767 | 751 | takeSnapshot(); |
| 768 | 752 | } else { |
| 769 | − _myAvatar->setDriveKeys(BACK, 1); | |
| 753 | + _myAvatar->setDriveKeys(BACK, 1.f); | |
| 770 | 754 | } |
| 771 | 755 | break; |
| 772 | 756 | |
| @@ -784,36 +768,33 @@ void Application::keyPressEvent(QKeyEvent* event) { · 11 unmodified lines | ||
| 784 | 768 | if (isShifted) { |
| 785 | 769 | Menu::getInstance()->triggerOption(MenuOption::Atmosphere); |
| 786 | 770 | } else { |
| 787 | − _myAvatar->setDriveKeys(ROT_LEFT, 1); | |
| 771 | + _myAvatar->setDriveKeys(ROT_LEFT, 1.f); | |
| 788 | 772 | } |
| 789 | 773 | break; |
| 790 | 774 | |
| 791 | 775 | case Qt::Key_D: |
| 792 | − _myAvatar->setDriveKeys(ROT_RIGHT, 1); | |
| 776 | + _myAvatar->setDriveKeys(ROT_RIGHT, 1.f); | |
| 793 | 777 | break; |
| 794 | 778 | |
| 795 | 779 | case Qt::Key_Return: |
| 796 | 780 | case Qt::Key_Enter: |
| 797 | − _chatEntryOn = true; | |
| 798 | − _myAvatar->setKeyState(NO_KEY_DOWN); | |
| 799 | − _myAvatar->setChatMessage(string()); | |
| 800 | − setMenuShortcutsEnabled(false); | |
| 781 | + Menu::getInstance()->triggerOption(MenuOption::Chat); | |
| 801 | 782 | break; |
| 802 | 783 | |
| 803 | 784 | case Qt::Key_Up: |
| 804 | − _myAvatar->setDriveKeys(isShifted ? UP : FWD, 1); | |
| 785 | + _myAvatar->setDriveKeys(isShifted ? UP : FWD, 1.f); | |
| 805 | 786 | break; |
| 806 | 787 | |
| 807 | 788 | case Qt::Key_Down: |
| 808 | − _myAvatar->setDriveKeys(isShifted ? DOWN : BACK, 1); | |
| 789 | + _myAvatar->setDriveKeys(isShifted ? DOWN : BACK, 1.f); | |
| 809 | 790 | break; |
| 810 | 791 | |
| 811 | 792 | case Qt::Key_Left: |
| 812 | − _myAvatar->setDriveKeys(isShifted ? LEFT : ROT_LEFT, 1); | |
| 793 | + _myAvatar->setDriveKeys(isShifted ? LEFT : ROT_LEFT, 1.f); | |
| 813 | 794 | break; |
| 814 | 795 | |
| 815 | 796 | case Qt::Key_Right: |
| 816 | − _myAvatar->setDriveKeys(isShifted ? RIGHT : ROT_RIGHT, 1); | |
| 797 | + _myAvatar->setDriveKeys(isShifted ? RIGHT : ROT_RIGHT, 1.f); | |
| 817 | 798 | break; |
| 818 | 799 | |
| 819 | 800 | case Qt::Key_I: |
| @@ -940,54 +921,49 @@ void Application::keyReleaseEvent(QKeyEvent* event) { · 120 unmodified lines | ||
| 940 | 921 | |
| 941 | 922 | |
| 942 | 923 | if (activeWindow() == _window) { |
| 943 | − if (_chatEntryOn) { | |
| 944 | − _myAvatar->setKeyState(NO_KEY_DOWN); | |
| 945 | − return; | |
| 946 | − } | |
| 947 | − | |
| 948 | 924 | switch (event->key()) { |
| 949 | 925 | case Qt::Key_E: |
| 950 | − _myAvatar->setDriveKeys(UP, 0); | |
| 926 | + _myAvatar->setDriveKeys(UP, 0.f); | |
| 951 | 927 | break; |
| 952 | 928 | |
| 953 | 929 | case Qt::Key_C: |
| 954 | − _myAvatar->setDriveKeys(DOWN, 0); | |
| 930 | + _myAvatar->setDriveKeys(DOWN, 0.f); | |
| 955 | 931 | break; |
| 956 | 932 | |
| 957 | 933 | case Qt::Key_W: |
| 958 | − _myAvatar->setDriveKeys(FWD, 0); | |
| 934 | + _myAvatar->setDriveKeys(FWD, 0.f); | |
| 959 | 935 | break; |
| 960 | 936 | |
| 961 | 937 | case Qt::Key_S: |
| 962 | − _myAvatar->setDriveKeys(BACK, 0); | |
| 938 | + _myAvatar->setDriveKeys(BACK, 0.f); | |
| 963 | 939 | break; |
| 964 | 940 | |
| 965 | 941 | case Qt::Key_A: |
| 966 | − _myAvatar->setDriveKeys(ROT_LEFT, 0); | |
| 942 | + _myAvatar->setDriveKeys(ROT_LEFT, 0.f); | |
| 967 | 943 | break; |
| 968 | 944 | |
| 969 | 945 | case Qt::Key_D: |
| 970 | − _myAvatar->setDriveKeys(ROT_RIGHT, 0); | |
| 946 | + _myAvatar->setDriveKeys(ROT_RIGHT, 0.f); | |
| 971 | 947 | break; |
| 972 | 948 | |
| 973 | 949 | case Qt::Key_Up: |
| 974 | − _myAvatar->setDriveKeys(FWD, 0); | |
| 975 | − _myAvatar->setDriveKeys(UP, 0); | |
| 950 | + _myAvatar->setDriveKeys(FWD, 0.f); | |
| 951 | + _myAvatar->setDriveKeys(UP, 0.f); | |
| 976 | 952 | break; |
| 977 | 953 | |
| 978 | 954 | case Qt::Key_Down: |
| 979 | − _myAvatar->setDriveKeys(BACK, 0); | |
| 980 | − _myAvatar->setDriveKeys(DOWN, 0); | |
| 955 | + _myAvatar->setDriveKeys(BACK, 0.f); | |
| 956 | + _myAvatar->setDriveKeys(DOWN, 0.f); | |
| 981 | 957 | break; |
| 982 | 958 | |
| 983 | 959 | case Qt::Key_Left: |
| 984 | − _myAvatar->setDriveKeys(LEFT, 0); | |
| 985 | − _myAvatar->setDriveKeys(ROT_LEFT, 0); | |
| 960 | + _myAvatar->setDriveKeys(LEFT, 0.f); | |
| 961 | + _myAvatar->setDriveKeys(ROT_LEFT, 0.f); | |
| 986 | 962 | break; |
| 987 | 963 | |
| 988 | 964 | case Qt::Key_Right: |
| 989 | − _myAvatar->setDriveKeys(RIGHT, 0); | |
| 990 | − _myAvatar->setDriveKeys(ROT_RIGHT, 0); | |
| 965 | + _myAvatar->setDriveKeys(RIGHT, 0.f); | |
| 966 | + _myAvatar->setDriveKeys(ROT_RIGHT, 0.f); | |
| 991 | 967 | break; |
| 992 | 968 | |
| 993 | 969 | default: |
| @@ -1242,8 +1218,10 @@ void Application::idle() { · 248 unmodified lines | ||
| 1242 | 1218 | _idleLoopStdev.reset(); |
| 1243 | 1219 | } |
| 1244 | 1220 | |
| 1245 | − _buckyBalls.simulate(timeSinceLastUpdate / 1000.f, Application::getInstance()->getAvatar()->getHandData()); | |
| 1246 | − | |
| 1221 | + if (Menu::getInstance()->isOptionChecked(MenuOption::BuckyBalls)) { | |
| 1222 | + _buckyBalls.simulate(timeSinceLastUpdate / 1000.f, Application::getInstance()->getAvatar()->getHandData()); | |
| 1223 | + } | |
| 1224 | + | |
| 1247 | 1225 | // After finishing all of the above work, restart the idle timer, allowing 2ms to process events. |
| 1248 | 1226 | idleTimer->start(2); |
| 1249 | 1227 | } |
| @@ -1492,7 +1470,7 @@ void Application::init() { · 242 unmodified lines | ||
| 1492 | 1470 | 3.0f * TREE_SCALE / 2.0f)); |
| 1493 | 1471 | _sharedVoxelSystemViewFrustum.setNearClip(TREE_SCALE / 2.0f); |
| 1494 | 1472 | _sharedVoxelSystemViewFrustum.setFarClip(3.0f * TREE_SCALE / 2.0f); |
| 1495 | − _sharedVoxelSystemViewFrustum.setFieldOfView(90); | |
| 1473 | + _sharedVoxelSystemViewFrustum.setFieldOfView(90.f); | |
| 1496 | 1474 | _sharedVoxelSystemViewFrustum.setOrientation(glm::quat()); |
| 1497 | 1475 | _sharedVoxelSystemViewFrustum.calculate(); |
| 1498 | 1476 | _sharedVoxelSystem.setViewFrustum(&_sharedVoxelSystemViewFrustum); |
| @@ -2121,7 +2099,7 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node · 622 unmodified lines | ||
| 2121 | 2099 | void Application::loadViewFrustum(Camera& camera, ViewFrustum& viewFrustum) { |
| 2122 | 2100 | // We will use these below, from either the camera or head vectors calculated above |
| 2123 | 2101 | glm::vec3 position(camera.getPosition()); |
| 2124 | − float fov = camera.getFieldOfView(); | |
| 2102 | + float fov = camera.getFieldOfView(); // degrees | |
| 2125 | 2103 | float nearClip = camera.getNearClip(); |
| 2126 | 2104 | float farClip = camera.getFarClip(); |
| 2127 | 2105 | float aspectRatio = camera.getAspectRatio(); |
| @@ -2134,7 +2112,7 @@ void Application::loadViewFrustum(Camera& camera, ViewFrustum& viewFrustum) { · 6 unmodified lines | ||
| 2134 | 2112 | |
| 2135 | 2113 | // Also make sure it's got the correct lens details from the camera |
| 2136 | 2114 | viewFrustum.setAspectRatio(aspectRatio); |
| 2137 | − viewFrustum.setFieldOfView(fov); | |
| 2115 | + viewFrustum.setFieldOfView(fov); // degrees | |
| 2138 | 2116 | viewFrustum.setNearClip(nearClip); |
| 2139 | 2117 | viewFrustum.setFarClip(farClip); |
| 2140 | 2118 | viewFrustum.setEyeOffsetPosition(camera.getEyeOffsetPosition()); |
| @@ -2196,7 +2174,7 @@ void Application::updateShadowMap() { · 55 unmodified lines | ||
| 2196 | 2174 | glPushMatrix(); |
| 2197 | 2175 | glLoadIdentity(); |
| 2198 | 2176 | glm::vec3 axis = glm::axis(rotation); |
| 2199 | − glRotatef(glm::angle(rotation), axis.x, axis.y, axis.z); | |
| 2177 | + glRotatef(glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z); | |
| 2200 | 2178 | |
| 2201 | 2179 | // store view matrix without translation, which we'll use for precision-sensitive objects |
| 2202 | 2180 | glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat*)&_untranslatedViewMatrix); |
| @@ -2275,7 +2253,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 72 unmodified lines | ||
| 2275 | 2253 | glm::vec3 eyeOffsetPos = whichCamera.getEyeOffsetPosition(); |
| 2276 | 2254 | glm::quat eyeOffsetOrient = whichCamera.getEyeOffsetOrientation(); |
| 2277 | 2255 | glm::vec3 eyeOffsetAxis = glm::axis(eyeOffsetOrient); |
| 2278 | − glRotatef(-glm::angle(eyeOffsetOrient), eyeOffsetAxis.x, eyeOffsetAxis.y, eyeOffsetAxis.z); | |
| 2256 | + glRotatef(-glm::degrees(glm::angle(eyeOffsetOrient)), eyeOffsetAxis.x, eyeOffsetAxis.y, eyeOffsetAxis.z); | |
| 2279 | 2257 | glTranslatef(-eyeOffsetPos.x, -eyeOffsetPos.y, -eyeOffsetPos.z); |
| 2280 | 2258 | |
| 2281 | 2259 | // transform view according to whichCamera |
| @@ -2284,7 +2262,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 2 unmodified lines | ||
| 2284 | 2262 | |
| 2285 | 2263 | glm::quat rotation = whichCamera.getRotation(); |
| 2286 | 2264 | glm::vec3 axis = glm::axis(rotation); |
| 2287 | − glRotatef(-glm::angle(rotation), axis.x, axis.y, axis.z); | |
| 2265 | + glRotatef(-glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z); | |
| 2288 | 2266 | |
| 2289 | 2267 | // store view matrix without translation, which we'll use for precision-sensitive objects |
| 2290 | 2268 | glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat*)&_untranslatedViewMatrix); |
| @@ -2488,11 +2466,6 @@ void Application::displayOverlay() { · 197 unmodified lines | ||
| 2488 | 2466 | } |
| 2489 | 2467 | } |
| 2490 | 2468 | |
| 2491 | − // Show chat entry field | |
| 2492 | − if (_chatEntryOn) { | |
| 2493 | − _chatEntry.render(_glWidget->width(), _glWidget->height()); | |
| 2494 | − } | |
| 2495 | − | |
| 2496 | 2469 | // Show on-screen msec timer |
| 2497 | 2470 | if (Menu::getInstance()->isOptionChecked(MenuOption::FrameTimer)) { |
| 2498 | 2471 | char frameTimer[10]; |
| @@ -2502,7 +2475,7 @@ void Application::displayOverlay() { · 3 unmodified lines | ||
| 2502 | 2475 | (Menu::getInstance()->isOptionChecked(MenuOption::Stats) && |
| 2503 | 2476 | Menu::getInstance()->isOptionChecked(MenuOption::Bandwidth)) |
| 2504 | 2477 | ? 80 : 20; |
| 2505 | − drawText(_glWidget->width() - 100, _glWidget->height() - timerBottom, 0.30f, 1.0f, 0, frameTimer, WHITE_TEXT); | |
| 2478 | + drawText(_glWidget->width() - 100, _glWidget->height() - timerBottom, 0.30f, 1.0f, 0.f, frameTimer, WHITE_TEXT); | |
| 2506 | 2479 | } |
| 2507 | 2480 | |
| 2508 | 2481 | _overlays.render2D(); |
| @@ -2557,11 +2530,11 @@ void Application::displayStats() { · 48 unmodified lines | ||
| 2557 | 2530 | sprintf(framesPerSecond, "Framerate: %3.0f FPS", _fps); |
| 2558 | 2531 | |
| 2559 | 2532 | verticalOffset += STATS_PELS_PER_LINE; |
| 2560 | − drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, serverNodes, WHITE_TEXT); | |
| 2533 | + drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, serverNodes, WHITE_TEXT); | |
| 2561 | 2534 | verticalOffset += STATS_PELS_PER_LINE; |
| 2562 | − drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, avatarNodes, WHITE_TEXT); | |
| 2535 | + drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, avatarNodes, WHITE_TEXT); | |
| 2563 | 2536 | verticalOffset += STATS_PELS_PER_LINE; |
| 2564 | − drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, framesPerSecond, WHITE_TEXT); | |
| 2537 | + drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, framesPerSecond, WHITE_TEXT); | |
| 2565 | 2538 | |
| 2566 | 2539 | if (_statsExpanded) { |
| 2567 | 2540 | char packetsPerSecond[30]; |
| @@ -2570,9 +2543,9 @@ void Application::displayStats() { · 2 unmodified lines | ||
| 2570 | 2543 | sprintf(averageMegabitsPerSecond, "Mbps: %3.2f", (float)_bytesPerSecond * 8.f / 1000000.f); |
| 2571 | 2544 | |
| 2572 | 2545 | verticalOffset += STATS_PELS_PER_LINE; |
| 2573 | − drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, packetsPerSecond, WHITE_TEXT); | |
| 2546 | + drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, packetsPerSecond, WHITE_TEXT); | |
| 2574 | 2547 | verticalOffset += STATS_PELS_PER_LINE; |
| 2575 | − drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, averageMegabitsPerSecond, WHITE_TEXT); | |
| 2548 | + drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, averageMegabitsPerSecond, WHITE_TEXT); | |
| 2576 | 2549 | } |
| 2577 | 2550 | |
| 2578 | 2551 | verticalOffset = 0; |
| @@ -2615,7 +2588,7 @@ void Application::displayStats() { · 36 unmodified lines | ||
| 2615 | 2588 | "Buffer msecs %.1f", |
| 2616 | 2589 | (float) (_audio.getNetworkBufferLengthSamplesPerChannel() + (float) _audio.getJitterBufferSamples()) / |
| 2617 | 2590 | (float)_audio.getNetworkSampleRate() * 1000.f); |
| 2618 | − drawText(30, _glWidget->height() - 22, 0.10f, 0, 2, audioJitter, WHITE_TEXT); | |
| 2591 | + drawText(30, _glWidget->height() - 22, 0.10f, 0.f, 2.f, audioJitter, WHITE_TEXT); | |
| 2619 | 2592 | |
| 2620 | 2593 | |
| 2621 | 2594 | char audioPing[30]; |
| @@ -2628,18 +2601,18 @@ void Application::displayStats() { · 6 unmodified lines | ||
| 2628 | 2601 | sprintf(voxelAvgPing, "Voxel avg ping: %d", pingVoxel); |
| 2629 | 2602 | |
| 2630 | 2603 | verticalOffset += STATS_PELS_PER_LINE; |
| 2631 | − drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, audioPing, WHITE_TEXT); | |
| 2604 | + drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, audioPing, WHITE_TEXT); | |
| 2632 | 2605 | verticalOffset += STATS_PELS_PER_LINE; |
| 2633 | − drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, avatarPing, WHITE_TEXT); | |
| 2606 | + drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, avatarPing, WHITE_TEXT); | |
| 2634 | 2607 | verticalOffset += STATS_PELS_PER_LINE; |
| 2635 | − drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, voxelAvgPing, WHITE_TEXT); | |
| 2608 | + drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, voxelAvgPing, WHITE_TEXT); | |
| 2636 | 2609 | |
| 2637 | 2610 | if (_statsExpanded) { |
| 2638 | 2611 | char voxelMaxPing[30]; |
| 2639 | 2612 | sprintf(voxelMaxPing, "Voxel max ping: %d", pingVoxelMax); |
| 2640 | 2613 | |
| 2641 | 2614 | verticalOffset += STATS_PELS_PER_LINE; |
| 2642 | − drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, voxelMaxPing, WHITE_TEXT); | |
| 2615 | + drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, voxelMaxPing, WHITE_TEXT); | |
| 2643 | 2616 | } |
| 2644 | 2617 | |
| 2645 | 2618 | verticalOffset = 0; |
| @@ -2667,11 +2640,11 @@ void Application::displayStats() { · 21 unmodified lines | ||
| 2667 | 2640 | char avatarMixerStats[200]; |
| 2668 | 2641 | |
| 2669 | 2642 | verticalOffset += STATS_PELS_PER_LINE; |
| 2670 | − drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, avatarPosition, WHITE_TEXT); | |
| 2643 | + drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, avatarPosition, WHITE_TEXT); | |
| 2671 | 2644 | verticalOffset += STATS_PELS_PER_LINE; |
| 2672 | − drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, avatarVelocity, WHITE_TEXT); | |
| 2645 | + drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, avatarVelocity, WHITE_TEXT); | |
| 2673 | 2646 | verticalOffset += STATS_PELS_PER_LINE; |
| 2674 | − drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, avatarBodyYaw, WHITE_TEXT); | |
| 2647 | + drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, avatarBodyYaw, WHITE_TEXT); | |
| 2675 | 2648 | |
| 2676 | 2649 | if (_statsExpanded) { |
| 2677 | 2650 | SharedNodePointer avatarMixer = NodeList::getInstance()->soloNodeOfType(NodeType::AvatarMixer); |
| @@ -2684,7 +2657,7 @@ void Application::displayStats() { · 6 unmodified lines | ||
| 2684 | 2657 | } |
| 2685 | 2658 | |
| 2686 | 2659 | verticalOffset += STATS_PELS_PER_LINE; |
| 2687 | − drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, avatarMixerStats, WHITE_TEXT); | |
| 2660 | + drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, avatarMixerStats, WHITE_TEXT); | |
| 2688 | 2661 | } |
| 2689 | 2662 | |
| 2690 | 2663 | verticalOffset = 0; |
| @@ -2699,7 +2672,7 @@ void Application::displayStats() { · 8 unmodified lines | ||
| 2699 | 2672 | voxelStats.str(""); |
| 2700 | 2673 | voxelStats << "Voxels Memory Nodes: " << VoxelTreeElement::getTotalMemoryUsage() / 1000000.f << "MB"; |
| 2701 | 2674 | verticalOffset += STATS_PELS_PER_LINE; |
| 2702 | − drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | |
| 2675 | + drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); | |
| 2703 | 2676 | |
| 2704 | 2677 | voxelStats.str(""); |
| 2705 | 2678 | voxelStats << |
| @@ -2709,14 +2682,14 @@ void Application::displayStats() { · 3 unmodified lines | ||
| 2709 | 2682 | voxelStats << " / GPU: " << _voxels.getVoxelMemoryUsageGPU() / 1000000.f << "MB"; |
| 2710 | 2683 | } |
| 2711 | 2684 | verticalOffset += STATS_PELS_PER_LINE; |
| 2712 | − drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | |
| 2685 | + drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); | |
| 2713 | 2686 | |
| 2714 | 2687 | // Voxel Rendering |
| 2715 | 2688 | voxelStats.str(""); |
| 2716 | 2689 | voxelStats.precision(4); |
| 2717 | 2690 | voxelStats << "Voxel Rendering Slots Max: " << _voxels.getMaxVoxels() / 1000.f << "K"; |
| 2718 | 2691 | verticalOffset += STATS_PELS_PER_LINE; |
| 2719 | − drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | |
| 2692 | + drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); | |
| 2720 | 2693 | } |
| 2721 | 2694 | |
| 2722 | 2695 | voxelStats.str(""); |
| @@ -2724,7 +2697,7 @@ void Application::displayStats() { · 1 unmodified line | ||
| 2724 | 2697 | voxelStats << "Drawn: " << _voxels.getVoxelsWritten() / 1000.f << "K " << |
| 2725 | 2698 | "Abandoned: " << _voxels.getAbandonedVoxels() / 1000.f << "K "; |
| 2726 | 2699 | verticalOffset += STATS_PELS_PER_LINE; |
| 2727 | − drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | |
| 2700 | + drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); | |
| 2728 | 2701 | |
| 2729 | 2702 | // iterate all the current voxel stats, and list their sending modes, and total voxel counts |
| 2730 | 2703 | std::stringstream sendingMode(""); |
| @@ -2768,7 +2741,7 @@ void Application::displayStats() { · 37 unmodified lines | ||
| 2768 | 2741 | sendingMode << " <SCENE STABLE>"; |
| 2769 | 2742 | } |
| 2770 | 2743 | verticalOffset += STATS_PELS_PER_LINE; |
| 2771 | − drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)sendingMode.str().c_str(), WHITE_TEXT); | |
| 2744 | + drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)sendingMode.str().c_str(), WHITE_TEXT); | |
| 2772 | 2745 | } |
| 2773 | 2746 | |
| 2774 | 2747 | // Incoming packets |
| @@ -2780,7 +2753,7 @@ void Application::displayStats() { · 5 unmodified lines | ||
| 2780 | 2753 | voxelStats << "Voxel Packets to Process: " << packetsString.toLocal8Bit().constData() |
| 2781 | 2754 | << " [Recent Max: " << maxString.toLocal8Bit().constData() << "]"; |
| 2782 | 2755 | verticalOffset += STATS_PELS_PER_LINE; |
| 2783 | − drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | |
| 2756 | + drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); | |
| 2784 | 2757 | } |
| 2785 | 2758 | |
| 2786 | 2759 | if (_resetRecentMaxPacketsSoon && voxelPacketsToProcess > 0) { |
| @@ -2803,7 +2776,7 @@ void Application::displayStats() { · 16 unmodified lines | ||
| 2803 | 2776 | voxelStats.str(""); |
| 2804 | 2777 | voxelStats << "Server voxels: " << serversTotalString.toLocal8Bit().constData(); |
| 2805 | 2778 | verticalOffset += STATS_PELS_PER_LINE; |
| 2806 | − drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | |
| 2779 | + drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); | |
| 2807 | 2780 | |
| 2808 | 2781 | if (_statsExpanded) { |
| 2809 | 2782 | QString serversInternalString = locale.toString((uint)totalInternal); |
| @@ -2814,7 +2787,7 @@ void Application::displayStats() { · 4 unmodified lines | ||
| 2814 | 2787 | "Internal: " << serversInternalString.toLocal8Bit().constData() << " " << |
| 2815 | 2788 | "Leaves: " << serversLeavesString.toLocal8Bit().constData() << ""; |
| 2816 | 2789 | verticalOffset += STATS_PELS_PER_LINE; |
| 2817 | − drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | |
| 2790 | + drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); | |
| 2818 | 2791 | } |
| 2819 | 2792 | |
| 2820 | 2793 | unsigned long localTotal = VoxelTreeElement::getNodeCount(); |
| @@ -2824,7 +2797,7 @@ void Application::displayStats() { · 3 unmodified lines | ||
| 2824 | 2797 | voxelStats.str(""); |
| 2825 | 2798 | voxelStats << "Local voxels: " << localTotalString.toLocal8Bit().constData(); |
| 2826 | 2799 | verticalOffset += STATS_PELS_PER_LINE; |
| 2827 | − drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | |
| 2800 | + drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); | |
| 2828 | 2801 | |
| 2829 | 2802 | if (_statsExpanded) { |
| 2830 | 2803 | unsigned long localInternal = VoxelTreeElement::getInternalNodeCount(); |
| @@ -2837,7 +2810,7 @@ void Application::displayStats() { · 6 unmodified lines | ||
| 2837 | 2810 | "Internal: " << localInternalString.toLocal8Bit().constData() << " " << |
| 2838 | 2811 | "Leaves: " << localLeavesString.toLocal8Bit().constData() << ""; |
| 2839 | 2812 | verticalOffset += STATS_PELS_PER_LINE; |
| 2840 | − drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | |
| 2813 | + drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); | |
| 2841 | 2814 | } |
| 2842 | 2815 | } |
| 2843 | 2816 | |
| @@ -2928,17 +2901,17 @@ glm::vec2 Application::getScaledScreenPoint(glm::vec2 projectedPoint) { · 84 unmodified lines | ||
| 2928 | 2901 | void Application::renderRearViewMirror(const QRect& region, bool billboard) { |
| 2929 | 2902 | bool eyeRelativeCamera = false; |
| 2930 | 2903 | if (billboard) { |
| 2931 | − _mirrorCamera.setFieldOfView(BILLBOARD_FIELD_OF_VIEW); | |
| 2904 | + _mirrorCamera.setFieldOfView(BILLBOARD_FIELD_OF_VIEW); // degees | |
| 2932 | 2905 | _mirrorCamera.setDistance(BILLBOARD_DISTANCE * _myAvatar->getScale()); |
| 2933 | 2906 | _mirrorCamera.setTargetPosition(_myAvatar->getPosition()); |
| 2934 | 2907 | |
| 2935 | 2908 | } else if (_rearMirrorTools->getZoomLevel() == BODY) { |
| 2936 | − _mirrorCamera.setFieldOfView(MIRROR_FIELD_OF_VIEW); | |
| 2909 | + _mirrorCamera.setFieldOfView(MIRROR_FIELD_OF_VIEW); // degrees | |
| 2937 | 2910 | _mirrorCamera.setDistance(MIRROR_REARVIEW_BODY_DISTANCE * _myAvatar->getScale()); |
| 2938 | 2911 | _mirrorCamera.setTargetPosition(_myAvatar->getChestPosition()); |
| 2939 | 2912 | |
| 2940 | 2913 | } else { // HEAD zoom level |
| 2941 | − _mirrorCamera.setFieldOfView(MIRROR_FIELD_OF_VIEW); | |
| 2914 | + _mirrorCamera.setFieldOfView(MIRROR_FIELD_OF_VIEW); // degrees | |
| 2942 | 2915 | _mirrorCamera.setDistance(MIRROR_REARVIEW_DISTANCE * _myAvatar->getScale()); |
| 2943 | 2916 | if (_myAvatar->getSkeletonModel().isActive() && _myAvatar->getHead()->getFaceModel().isActive()) { |
| 2944 | 2917 | // as a hack until we have a better way of dealing with coordinate precision issues, reposition the |
| @@ -2952,7 +2925,7 @@ void Application::renderRearViewMirror(const QRect& region, bool billboard) { · 7 unmodified lines | ||
| 2952 | 2925 | } |
| 2953 | 2926 | _mirrorCamera.setAspectRatio((float)region.width() / region.height()); |
| 2954 | 2927 | |
| 2955 | − _mirrorCamera.setTargetRotation(_myAvatar->getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PIf, 0.0f))); | |
| 2928 | + _mirrorCamera.setTargetRotation(_myAvatar->getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PI, 0.0f))); | |
| 2956 | 2929 | _mirrorCamera.update(1.0f/_fps); |
| 2957 | 2930 | |
| 2958 | 2931 | // set the bounds of rear mirror view |