Showing the changes to interface/src/Application.cpp (1 of 51 files). Show all
Unified · Split
| @@ -507,7 +507,7 @@ void Application::paintGL() { · 506 unmodified lines | |||
| 507 | float headHeight = _myAvatar->getHead()->calculateAverageEyePosition().y - _myAvatar->getPosition().y; | 507 | float headHeight = _myAvatar->getHead()->calculateAverageEyePosition().y - _myAvatar->getPosition().y; |
| 508 | _myCamera.setDistance(MIRROR_FULLSCREEN_DISTANCE * _myAvatar->getScale()); | 508 | _myCamera.setDistance(MIRROR_FULLSCREEN_DISTANCE * _myAvatar->getScale()); |
| 509 | _myCamera.setTargetPosition(_myAvatar->getPosition() + glm::vec3(0, headHeight, 0)); | 509 | _myCamera.setTargetPosition(_myAvatar->getPosition() + glm::vec3(0, headHeight, 0)); |
| 510 | _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))); |
| 511 | } | 511 | } |
| 512 | 512 | ||
| 513 | // Update camera position | 513 | // Update camera position |
| @@ -744,7 +744,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 230 unmodified lines | |||
| 744 | if (!_myAvatar->getDriveKeys(UP)) { | 744 | if (!_myAvatar->getDriveKeys(UP)) { |
| 745 | _myAvatar->jump(); | 745 | _myAvatar->jump(); |
| 746 | } | 746 | } |
| 747 | _myAvatar->setDriveKeys(UP, 1); | 747 | _myAvatar->setDriveKeys(UP, 1.f); |
| 748 | break; | 748 | break; |
| 749 | 749 | ||
| 750 | case Qt::Key_Asterisk: | 750 | case Qt::Key_Asterisk: |
| @@ -752,11 +752,11 @@ void Application::keyPressEvent(QKeyEvent* event) { · 1 unmodified line | |||
| 752 | break; | 752 | break; |
| 753 | 753 | ||
| 754 | case Qt::Key_C: | 754 | case Qt::Key_C: |
| 755 | _myAvatar->setDriveKeys(DOWN, 1); | 755 | _myAvatar->setDriveKeys(DOWN, 1.f); |
| 756 | break; | 756 | break; |
| 757 | 757 | ||
| 758 | case Qt::Key_W: | 758 | case Qt::Key_W: |
| 759 | _myAvatar->setDriveKeys(FWD, 1); | 759 | _myAvatar->setDriveKeys(FWD, 1.f); |
| 760 | break; | 760 | break; |
| 761 | 761 | ||
| 762 | case Qt::Key_S: | 762 | case Qt::Key_S: |
| @@ -765,7 +765,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 2 unmodified lines | |||
| 765 | } else if (!isShifted && isMeta) { | 765 | } else if (!isShifted && isMeta) { |
| 766 | takeSnapshot(); | 766 | takeSnapshot(); |
| 767 | } else { | 767 | } else { |
| 768 | _myAvatar->setDriveKeys(BACK, 1); | 768 | _myAvatar->setDriveKeys(BACK, 1.f); |
| 769 | } | 769 | } |
| 770 | break; | 770 | break; |
| 771 | 771 | ||
| @@ -783,12 +783,12 @@ void Application::keyPressEvent(QKeyEvent* event) { · 11 unmodified lines | |||
| 783 | if (isShifted) { | 783 | if (isShifted) { |
| 784 | Menu::getInstance()->triggerOption(MenuOption::Atmosphere); | 784 | Menu::getInstance()->triggerOption(MenuOption::Atmosphere); |
| 785 | } else { | 785 | } else { |
| 786 | _myAvatar->setDriveKeys(ROT_LEFT, 1); | 786 | _myAvatar->setDriveKeys(ROT_LEFT, 1.f); |
| 787 | } | 787 | } |
| 788 | break; | 788 | break; |
| 789 | 789 | ||
| 790 | case Qt::Key_D: | 790 | case Qt::Key_D: |
| 791 | _myAvatar->setDriveKeys(ROT_RIGHT, 1); | 791 | _myAvatar->setDriveKeys(ROT_RIGHT, 1.f); |
| 792 | break; | 792 | break; |
| 793 | 793 | ||
| 794 | case Qt::Key_Return: | 794 | case Qt::Key_Return: |
| @@ -800,19 +800,19 @@ void Application::keyPressEvent(QKeyEvent* event) { · 5 unmodified lines | |||
| 800 | break; | 800 | break; |
| 801 | 801 | ||
| 802 | case Qt::Key_Up: | 802 | case Qt::Key_Up: |
| 803 | _myAvatar->setDriveKeys(isShifted ? UP : FWD, 1); | 803 | _myAvatar->setDriveKeys(isShifted ? UP : FWD, 1.f); |
| 804 | break; | 804 | break; |
| 805 | 805 | ||
| 806 | case Qt::Key_Down: | 806 | case Qt::Key_Down: |
| 807 | _myAvatar->setDriveKeys(isShifted ? DOWN : BACK, 1); | 807 | _myAvatar->setDriveKeys(isShifted ? DOWN : BACK, 1.f); |
| 808 | break; | 808 | break; |
| 809 | 809 | ||
| 810 | case Qt::Key_Left: | 810 | case Qt::Key_Left: |
| 811 | _myAvatar->setDriveKeys(isShifted ? LEFT : ROT_LEFT, 1); | 811 | _myAvatar->setDriveKeys(isShifted ? LEFT : ROT_LEFT, 1.f); |
| 812 | break; | 812 | break; |
| 813 | 813 | ||
| 814 | case Qt::Key_Right: | 814 | case Qt::Key_Right: |
| 815 | _myAvatar->setDriveKeys(isShifted ? RIGHT : ROT_RIGHT, 1); | 815 | _myAvatar->setDriveKeys(isShifted ? RIGHT : ROT_RIGHT, 1.f); |
| 816 | break; | 816 | break; |
| 817 | 817 | ||
| 818 | case Qt::Key_I: | 818 | case Qt::Key_I: |
| @@ -946,47 +946,47 @@ void Application::keyReleaseEvent(QKeyEvent* event) { · 127 unmodified lines | |||
| 946 | 946 | ||
| 947 | switch (event->key()) { | 947 | switch (event->key()) { |
| 948 | case Qt::Key_E: | 948 | case Qt::Key_E: |
| 949 | _myAvatar->setDriveKeys(UP, 0); | 949 | _myAvatar->setDriveKeys(UP, 0.f); |
| 950 | break; | 950 | break; |
| 951 | 951 | ||
| 952 | case Qt::Key_C: | 952 | case Qt::Key_C: |
| 953 | _myAvatar->setDriveKeys(DOWN, 0); | 953 | _myAvatar->setDriveKeys(DOWN, 0.f); |
| 954 | break; | 954 | break; |
| 955 | 955 | ||
| 956 | case Qt::Key_W: | 956 | case Qt::Key_W: |
| 957 | _myAvatar->setDriveKeys(FWD, 0); | 957 | _myAvatar->setDriveKeys(FWD, 0.f); |
| 958 | break; | 958 | break; |
| 959 | 959 | ||
| 960 | case Qt::Key_S: | 960 | case Qt::Key_S: |
| 961 | _myAvatar->setDriveKeys(BACK, 0); | 961 | _myAvatar->setDriveKeys(BACK, 0.f); |
| 962 | break; | 962 | break; |
| 963 | 963 | ||
| 964 | case Qt::Key_A: | 964 | case Qt::Key_A: |
| 965 | _myAvatar->setDriveKeys(ROT_LEFT, 0); | 965 | _myAvatar->setDriveKeys(ROT_LEFT, 0.f); |
| 966 | break; | 966 | break; |
| 967 | 967 | ||
| 968 | case Qt::Key_D: | 968 | case Qt::Key_D: |
| 969 | _myAvatar->setDriveKeys(ROT_RIGHT, 0); | 969 | _myAvatar->setDriveKeys(ROT_RIGHT, 0.f); |
| 970 | break; | 970 | break; |
| 971 | 971 | ||
| 972 | case Qt::Key_Up: | 972 | case Qt::Key_Up: |
| 973 | _myAvatar->setDriveKeys(FWD, 0); | 973 | _myAvatar->setDriveKeys(FWD, 0.f); |
| 974 | _myAvatar->setDriveKeys(UP, 0); | 974 | _myAvatar->setDriveKeys(UP, 0.f); |
| 975 | break; | 975 | break; |
| 976 | 976 | ||
| 977 | case Qt::Key_Down: | 977 | case Qt::Key_Down: |
| 978 | _myAvatar->setDriveKeys(BACK, 0); | 978 | _myAvatar->setDriveKeys(BACK, 0.f); |
| 979 | _myAvatar->setDriveKeys(DOWN, 0); | 979 | _myAvatar->setDriveKeys(DOWN, 0.f); |
| 980 | break; | 980 | break; |
| 981 | 981 | ||
| 982 | case Qt::Key_Left: | 982 | case Qt::Key_Left: |
| 983 | _myAvatar->setDriveKeys(LEFT, 0); | 983 | _myAvatar->setDriveKeys(LEFT, 0.f); |
| 984 | _myAvatar->setDriveKeys(ROT_LEFT, 0); | 984 | _myAvatar->setDriveKeys(ROT_LEFT, 0.f); |
| 985 | break; | 985 | break; |
| 986 | 986 | ||
| 987 | case Qt::Key_Right: | 987 | case Qt::Key_Right: |
| 988 | _myAvatar->setDriveKeys(RIGHT, 0); | 988 | _myAvatar->setDriveKeys(RIGHT, 0.f); |
| 989 | _myAvatar->setDriveKeys(ROT_RIGHT, 0); | 989 | _myAvatar->setDriveKeys(ROT_RIGHT, 0.f); |
| 990 | break; | 990 | break; |
| 991 | 991 | ||
| 992 | default: | 992 | default: |
| @@ -1488,7 +1488,7 @@ void Application::init() { · 495 unmodified lines | |||
| 1488 | 3.0f * TREE_SCALE / 2.0f)); | 1488 | 3.0f * TREE_SCALE / 2.0f)); |
| 1489 | _sharedVoxelSystemViewFrustum.setNearClip(TREE_SCALE / 2.0f); | 1489 | _sharedVoxelSystemViewFrustum.setNearClip(TREE_SCALE / 2.0f); |
| 1490 | _sharedVoxelSystemViewFrustum.setFarClip(3.0f * TREE_SCALE / 2.0f); | 1490 | _sharedVoxelSystemViewFrustum.setFarClip(3.0f * TREE_SCALE / 2.0f); |
| 1491 | _sharedVoxelSystemViewFrustum.setFieldOfView(90); | 1491 | _sharedVoxelSystemViewFrustum.setFieldOfView(90.f); |
| 1492 | _sharedVoxelSystemViewFrustum.setOrientation(glm::quat()); | 1492 | _sharedVoxelSystemViewFrustum.setOrientation(glm::quat()); |
| 1493 | _sharedVoxelSystemViewFrustum.calculate(); | 1493 | _sharedVoxelSystemViewFrustum.calculate(); |
| 1494 | _sharedVoxelSystem.setViewFrustum(&_sharedVoxelSystemViewFrustum); | 1494 | _sharedVoxelSystem.setViewFrustum(&_sharedVoxelSystemViewFrustum); |
| @@ -2120,7 +2120,7 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node · 625 unmodified lines | |||
| 2120 | void Application::loadViewFrustum(Camera& camera, ViewFrustum& viewFrustum) { | 2120 | void Application::loadViewFrustum(Camera& camera, ViewFrustum& viewFrustum) { |
| 2121 | // We will use these below, from either the camera or head vectors calculated above | 2121 | // We will use these below, from either the camera or head vectors calculated above |
| 2122 | glm::vec3 position(camera.getPosition()); | 2122 | glm::vec3 position(camera.getPosition()); |
| 2123 | float fov = camera.getFieldOfView(); | 2123 | float fov = camera.getFieldOfView(); // degrees |
| 2124 | float nearClip = camera.getNearClip(); | 2124 | float nearClip = camera.getNearClip(); |
| 2125 | float farClip = camera.getFarClip(); | 2125 | float farClip = camera.getFarClip(); |
| 2126 | float aspectRatio = camera.getAspectRatio(); | 2126 | float aspectRatio = camera.getAspectRatio(); |
| @@ -2133,7 +2133,7 @@ void Application::loadViewFrustum(Camera& camera, ViewFrustum& viewFrustum) { · 6 unmodified lines | |||
| 2133 | 2133 | ||
| 2134 | // Also make sure it's got the correct lens details from the camera | 2134 | // Also make sure it's got the correct lens details from the camera |
| 2135 | viewFrustum.setAspectRatio(aspectRatio); | 2135 | viewFrustum.setAspectRatio(aspectRatio); |
| 2136 | viewFrustum.setFieldOfView(fov); | 2136 | viewFrustum.setFieldOfView(fov); // degrees |
| 2137 | viewFrustum.setNearClip(nearClip); | 2137 | viewFrustum.setNearClip(nearClip); |
| 2138 | viewFrustum.setFarClip(farClip); | 2138 | viewFrustum.setFarClip(farClip); |
| 2139 | viewFrustum.setEyeOffsetPosition(camera.getEyeOffsetPosition()); | 2139 | viewFrustum.setEyeOffsetPosition(camera.getEyeOffsetPosition()); |
| @@ -2195,7 +2195,7 @@ void Application::updateShadowMap() { · 55 unmodified lines | |||
| 2195 | glPushMatrix(); | 2195 | glPushMatrix(); |
| 2196 | glLoadIdentity(); | 2196 | glLoadIdentity(); |
| 2197 | glm::vec3 axis = glm::axis(rotation); | 2197 | glm::vec3 axis = glm::axis(rotation); |
| 2198 | glRotatef(glm::angle(rotation), axis.x, axis.y, axis.z); | 2198 | glRotatef(glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z); |
| 2199 | 2199 | ||
| 2200 | // store view matrix without translation, which we'll use for precision-sensitive objects | 2200 | // store view matrix without translation, which we'll use for precision-sensitive objects |
| 2201 | glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat*)&_untranslatedViewMatrix); | 2201 | glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat*)&_untranslatedViewMatrix); |
| @@ -2274,7 +2274,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 72 unmodified lines | |||
| 2274 | glm::vec3 eyeOffsetPos = whichCamera.getEyeOffsetPosition(); | 2274 | glm::vec3 eyeOffsetPos = whichCamera.getEyeOffsetPosition(); |
| 2275 | glm::quat eyeOffsetOrient = whichCamera.getEyeOffsetOrientation(); | 2275 | glm::quat eyeOffsetOrient = whichCamera.getEyeOffsetOrientation(); |
| 2276 | glm::vec3 eyeOffsetAxis = glm::axis(eyeOffsetOrient); | 2276 | glm::vec3 eyeOffsetAxis = glm::axis(eyeOffsetOrient); |
| 2277 | glRotatef(-glm::angle(eyeOffsetOrient), eyeOffsetAxis.x, eyeOffsetAxis.y, eyeOffsetAxis.z); | 2277 | glRotatef(-glm::degrees(glm::angle(eyeOffsetOrient)), eyeOffsetAxis.x, eyeOffsetAxis.y, eyeOffsetAxis.z); |
| 2278 | glTranslatef(-eyeOffsetPos.x, -eyeOffsetPos.y, -eyeOffsetPos.z); | 2278 | glTranslatef(-eyeOffsetPos.x, -eyeOffsetPos.y, -eyeOffsetPos.z); |
| 2279 | 2279 | ||
| 2280 | // transform view according to whichCamera | 2280 | // transform view according to whichCamera |
| @@ -2283,7 +2283,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 2 unmodified lines | |||
| 2283 | 2283 | ||
| 2284 | glm::quat rotation = whichCamera.getRotation(); | 2284 | glm::quat rotation = whichCamera.getRotation(); |
| 2285 | glm::vec3 axis = glm::axis(rotation); | 2285 | glm::vec3 axis = glm::axis(rotation); |
| 2286 | glRotatef(-glm::angle(rotation), axis.x, axis.y, axis.z); | 2286 | glRotatef(-glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z); |
| 2287 | 2287 | ||
| 2288 | // store view matrix without translation, which we'll use for precision-sensitive objects | 2288 | // store view matrix without translation, which we'll use for precision-sensitive objects |
| 2289 | glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat*)&_untranslatedViewMatrix); | 2289 | glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat*)&_untranslatedViewMatrix); |
| @@ -2501,7 +2501,7 @@ void Application::displayOverlay() { · 211 unmodified lines | |||
| 2501 | (Menu::getInstance()->isOptionChecked(MenuOption::Stats) && | 2501 | (Menu::getInstance()->isOptionChecked(MenuOption::Stats) && |
| 2502 | Menu::getInstance()->isOptionChecked(MenuOption::Bandwidth)) | 2502 | Menu::getInstance()->isOptionChecked(MenuOption::Bandwidth)) |
| 2503 | ? 80 : 20; | 2503 | ? 80 : 20; |
| 2504 | drawText(_glWidget->width() - 100, _glWidget->height() - timerBottom, 0.30f, 1.0f, 0, frameTimer, WHITE_TEXT); | 2504 | drawText(_glWidget->width() - 100, _glWidget->height() - timerBottom, 0.30f, 1.0f, 0.f, frameTimer, WHITE_TEXT); |
| 2505 | } | 2505 | } |
| 2506 | 2506 | ||
| 2507 | _overlays.render2D(); | 2507 | _overlays.render2D(); |
| @@ -2556,11 +2556,11 @@ void Application::displayStats() { · 48 unmodified lines | |||
| 2556 | sprintf(framesPerSecond, "Framerate: %3.0f FPS", _fps); | 2556 | sprintf(framesPerSecond, "Framerate: %3.0f FPS", _fps); |
| 2557 | 2557 | ||
| 2558 | verticalOffset += STATS_PELS_PER_LINE; | 2558 | verticalOffset += STATS_PELS_PER_LINE; |
| 2559 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, serverNodes, WHITE_TEXT); | 2559 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, serverNodes, WHITE_TEXT); |
| 2560 | verticalOffset += STATS_PELS_PER_LINE; | 2560 | verticalOffset += STATS_PELS_PER_LINE; |
| 2561 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, avatarNodes, WHITE_TEXT); | 2561 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, avatarNodes, WHITE_TEXT); |
| 2562 | verticalOffset += STATS_PELS_PER_LINE; | 2562 | verticalOffset += STATS_PELS_PER_LINE; |
| 2563 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, framesPerSecond, WHITE_TEXT); | 2563 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, framesPerSecond, WHITE_TEXT); |
| 2564 | 2564 | ||
| 2565 | if (_statsExpanded) { | 2565 | if (_statsExpanded) { |
| 2566 | char packetsPerSecond[30]; | 2566 | char packetsPerSecond[30]; |
| @@ -2569,9 +2569,9 @@ void Application::displayStats() { · 2 unmodified lines | |||
| 2569 | sprintf(averageMegabitsPerSecond, "Mbps: %3.2f", (float)_bytesPerSecond * 8.f / 1000000.f); | 2569 | sprintf(averageMegabitsPerSecond, "Mbps: %3.2f", (float)_bytesPerSecond * 8.f / 1000000.f); |
| 2570 | 2570 | ||
| 2571 | verticalOffset += STATS_PELS_PER_LINE; | 2571 | verticalOffset += STATS_PELS_PER_LINE; |
| 2572 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, packetsPerSecond, WHITE_TEXT); | 2572 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, packetsPerSecond, WHITE_TEXT); |
| 2573 | verticalOffset += STATS_PELS_PER_LINE; | 2573 | verticalOffset += STATS_PELS_PER_LINE; |
| 2574 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, averageMegabitsPerSecond, WHITE_TEXT); | 2574 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, averageMegabitsPerSecond, WHITE_TEXT); |
| 2575 | } | 2575 | } |
| 2576 | 2576 | ||
| 2577 | verticalOffset = 0; | 2577 | verticalOffset = 0; |
| @@ -2614,7 +2614,7 @@ void Application::displayStats() { · 36 unmodified lines | |||
| 2614 | "Buffer msecs %.1f", | 2614 | "Buffer msecs %.1f", |
| 2615 | (float) (_audio.getNetworkBufferLengthSamplesPerChannel() + (float) _audio.getJitterBufferSamples()) / | 2615 | (float) (_audio.getNetworkBufferLengthSamplesPerChannel() + (float) _audio.getJitterBufferSamples()) / |
| 2616 | (float)_audio.getNetworkSampleRate() * 1000.f); | 2616 | (float)_audio.getNetworkSampleRate() * 1000.f); |
| 2617 | drawText(30, _glWidget->height() - 22, 0.10f, 0, 2, audioJitter, WHITE_TEXT); | 2617 | drawText(30, _glWidget->height() - 22, 0.10f, 0.f, 2.f, audioJitter, WHITE_TEXT); |
| 2618 | 2618 | ||
| 2619 | 2619 | ||
| 2620 | char audioPing[30]; | 2620 | char audioPing[30]; |
| @@ -2627,18 +2627,18 @@ void Application::displayStats() { · 6 unmodified lines | |||
| 2627 | sprintf(voxelAvgPing, "Voxel avg ping: %d", pingVoxel); | 2627 | sprintf(voxelAvgPing, "Voxel avg ping: %d", pingVoxel); |
| 2628 | 2628 | ||
| 2629 | verticalOffset += STATS_PELS_PER_LINE; | 2629 | verticalOffset += STATS_PELS_PER_LINE; |
| 2630 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, audioPing, WHITE_TEXT); | 2630 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, audioPing, WHITE_TEXT); |
| 2631 | verticalOffset += STATS_PELS_PER_LINE; | 2631 | verticalOffset += STATS_PELS_PER_LINE; |
| 2632 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, avatarPing, WHITE_TEXT); | 2632 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, avatarPing, WHITE_TEXT); |
| 2633 | verticalOffset += STATS_PELS_PER_LINE; | 2633 | verticalOffset += STATS_PELS_PER_LINE; |
| 2634 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, voxelAvgPing, WHITE_TEXT); | 2634 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, voxelAvgPing, WHITE_TEXT); |
| 2635 | 2635 | ||
| 2636 | if (_statsExpanded) { | 2636 | if (_statsExpanded) { |
| 2637 | char voxelMaxPing[30]; | 2637 | char voxelMaxPing[30]; |
| 2638 | sprintf(voxelMaxPing, "Voxel max ping: %d", pingVoxelMax); | 2638 | sprintf(voxelMaxPing, "Voxel max ping: %d", pingVoxelMax); |
| 2639 | 2639 | ||
| 2640 | verticalOffset += STATS_PELS_PER_LINE; | 2640 | verticalOffset += STATS_PELS_PER_LINE; |
| 2641 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, voxelMaxPing, WHITE_TEXT); | 2641 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, voxelMaxPing, WHITE_TEXT); |
| 2642 | } | 2642 | } |
| 2643 | 2643 | ||
| 2644 | verticalOffset = 0; | 2644 | verticalOffset = 0; |
| @@ -2666,11 +2666,11 @@ void Application::displayStats() { · 21 unmodified lines | |||
| 2666 | char avatarMixerStats[200]; | 2666 | char avatarMixerStats[200]; |
| 2667 | 2667 | ||
| 2668 | verticalOffset += STATS_PELS_PER_LINE; | 2668 | verticalOffset += STATS_PELS_PER_LINE; |
| 2669 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, avatarPosition, WHITE_TEXT); | 2669 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, avatarPosition, WHITE_TEXT); |
| 2670 | verticalOffset += STATS_PELS_PER_LINE; | 2670 | verticalOffset += STATS_PELS_PER_LINE; |
| 2671 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, avatarVelocity, WHITE_TEXT); | 2671 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, avatarVelocity, WHITE_TEXT); |
| 2672 | verticalOffset += STATS_PELS_PER_LINE; | 2672 | verticalOffset += STATS_PELS_PER_LINE; |
| 2673 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, avatarBodyYaw, WHITE_TEXT); | 2673 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, avatarBodyYaw, WHITE_TEXT); |
| 2674 | 2674 | ||
| 2675 | if (_statsExpanded) { | 2675 | if (_statsExpanded) { |
| 2676 | SharedNodePointer avatarMixer = NodeList::getInstance()->soloNodeOfType(NodeType::AvatarMixer); | 2676 | SharedNodePointer avatarMixer = NodeList::getInstance()->soloNodeOfType(NodeType::AvatarMixer); |
| @@ -2683,7 +2683,7 @@ void Application::displayStats() { · 6 unmodified lines | |||
| 2683 | } | 2683 | } |
| 2684 | 2684 | ||
| 2685 | verticalOffset += STATS_PELS_PER_LINE; | 2685 | verticalOffset += STATS_PELS_PER_LINE; |
| 2686 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, avatarMixerStats, WHITE_TEXT); | 2686 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, avatarMixerStats, WHITE_TEXT); |
| 2687 | } | 2687 | } |
| 2688 | 2688 | ||
| 2689 | verticalOffset = 0; | 2689 | verticalOffset = 0; |
| @@ -2698,7 +2698,7 @@ void Application::displayStats() { · 8 unmodified lines | |||
| 2698 | voxelStats.str(""); | 2698 | voxelStats.str(""); |
| 2699 | voxelStats << "Voxels Memory Nodes: " << VoxelTreeElement::getTotalMemoryUsage() / 1000000.f << "MB"; | 2699 | voxelStats << "Voxels Memory Nodes: " << VoxelTreeElement::getTotalMemoryUsage() / 1000000.f << "MB"; |
| 2700 | verticalOffset += STATS_PELS_PER_LINE; | 2700 | verticalOffset += STATS_PELS_PER_LINE; |
| 2701 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | 2701 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); |
| 2702 | 2702 | ||
| 2703 | voxelStats.str(""); | 2703 | voxelStats.str(""); |
| 2704 | voxelStats << | 2704 | voxelStats << |
| @@ -2708,14 +2708,14 @@ void Application::displayStats() { · 3 unmodified lines | |||
| 2708 | voxelStats << " / GPU: " << _voxels.getVoxelMemoryUsageGPU() / 1000000.f << "MB"; | 2708 | voxelStats << " / GPU: " << _voxels.getVoxelMemoryUsageGPU() / 1000000.f << "MB"; |
| 2709 | } | 2709 | } |
| 2710 | verticalOffset += STATS_PELS_PER_LINE; | 2710 | verticalOffset += STATS_PELS_PER_LINE; |
| 2711 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | 2711 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); |
| 2712 | 2712 | ||
| 2713 | // Voxel Rendering | 2713 | // Voxel Rendering |
| 2714 | voxelStats.str(""); | 2714 | voxelStats.str(""); |
| 2715 | voxelStats.precision(4); | 2715 | voxelStats.precision(4); |
| 2716 | voxelStats << "Voxel Rendering Slots Max: " << _voxels.getMaxVoxels() / 1000.f << "K"; | 2716 | voxelStats << "Voxel Rendering Slots Max: " << _voxels.getMaxVoxels() / 1000.f << "K"; |
| 2717 | verticalOffset += STATS_PELS_PER_LINE; | 2717 | verticalOffset += STATS_PELS_PER_LINE; |
| 2718 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | 2718 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); |
| 2719 | } | 2719 | } |
| 2720 | 2720 | ||
| 2721 | voxelStats.str(""); | 2721 | voxelStats.str(""); |
| @@ -2723,7 +2723,7 @@ void Application::displayStats() { · 1 unmodified line | |||
| 2723 | voxelStats << "Drawn: " << _voxels.getVoxelsWritten() / 1000.f << "K " << | 2723 | voxelStats << "Drawn: " << _voxels.getVoxelsWritten() / 1000.f << "K " << |
| 2724 | "Abandoned: " << _voxels.getAbandonedVoxels() / 1000.f << "K "; | 2724 | "Abandoned: " << _voxels.getAbandonedVoxels() / 1000.f << "K "; |
| 2725 | verticalOffset += STATS_PELS_PER_LINE; | 2725 | verticalOffset += STATS_PELS_PER_LINE; |
| 2726 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | 2726 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); |
| 2727 | 2727 | ||
| 2728 | // iterate all the current voxel stats, and list their sending modes, and total voxel counts | 2728 | // iterate all the current voxel stats, and list their sending modes, and total voxel counts |
| 2729 | std::stringstream sendingMode(""); | 2729 | std::stringstream sendingMode(""); |
| @@ -2767,7 +2767,7 @@ void Application::displayStats() { · 37 unmodified lines | |||
| 2767 | sendingMode << " <SCENE STABLE>"; | 2767 | sendingMode << " <SCENE STABLE>"; |
| 2768 | } | 2768 | } |
| 2769 | verticalOffset += STATS_PELS_PER_LINE; | 2769 | verticalOffset += STATS_PELS_PER_LINE; |
| 2770 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)sendingMode.str().c_str(), WHITE_TEXT); | 2770 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)sendingMode.str().c_str(), WHITE_TEXT); |
| 2771 | } | 2771 | } |
| 2772 | 2772 | ||
| 2773 | // Incoming packets | 2773 | // Incoming packets |
| @@ -2779,7 +2779,7 @@ void Application::displayStats() { · 5 unmodified lines | |||
| 2779 | voxelStats << "Voxel Packets to Process: " << packetsString.toLocal8Bit().constData() | 2779 | voxelStats << "Voxel Packets to Process: " << packetsString.toLocal8Bit().constData() |
| 2780 | << " [Recent Max: " << maxString.toLocal8Bit().constData() << "]"; | 2780 | << " [Recent Max: " << maxString.toLocal8Bit().constData() << "]"; |
| 2781 | verticalOffset += STATS_PELS_PER_LINE; | 2781 | verticalOffset += STATS_PELS_PER_LINE; |
| 2782 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | 2782 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); |
| 2783 | } | 2783 | } |
| 2784 | 2784 | ||
| 2785 | if (_resetRecentMaxPacketsSoon && voxelPacketsToProcess > 0) { | 2785 | if (_resetRecentMaxPacketsSoon && voxelPacketsToProcess > 0) { |
| @@ -2802,7 +2802,7 @@ void Application::displayStats() { · 16 unmodified lines | |||
| 2802 | voxelStats.str(""); | 2802 | voxelStats.str(""); |
| 2803 | voxelStats << "Server voxels: " << serversTotalString.toLocal8Bit().constData(); | 2803 | voxelStats << "Server voxels: " << serversTotalString.toLocal8Bit().constData(); |
| 2804 | verticalOffset += STATS_PELS_PER_LINE; | 2804 | verticalOffset += STATS_PELS_PER_LINE; |
| 2805 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | 2805 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); |
| 2806 | 2806 | ||
| 2807 | if (_statsExpanded) { | 2807 | if (_statsExpanded) { |
| 2808 | QString serversInternalString = locale.toString((uint)totalInternal); | 2808 | QString serversInternalString = locale.toString((uint)totalInternal); |
| @@ -2813,7 +2813,7 @@ void Application::displayStats() { · 4 unmodified lines | |||
| 2813 | "Internal: " << serversInternalString.toLocal8Bit().constData() << " " << | 2813 | "Internal: " << serversInternalString.toLocal8Bit().constData() << " " << |
| 2814 | "Leaves: " << serversLeavesString.toLocal8Bit().constData() << ""; | 2814 | "Leaves: " << serversLeavesString.toLocal8Bit().constData() << ""; |
| 2815 | verticalOffset += STATS_PELS_PER_LINE; | 2815 | verticalOffset += STATS_PELS_PER_LINE; |
| 2816 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | 2816 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); |
| 2817 | } | 2817 | } |
| 2818 | 2818 | ||
| 2819 | unsigned long localTotal = VoxelTreeElement::getNodeCount(); | 2819 | unsigned long localTotal = VoxelTreeElement::getNodeCount(); |
| @@ -2823,7 +2823,7 @@ void Application::displayStats() { · 3 unmodified lines | |||
| 2823 | voxelStats.str(""); | 2823 | voxelStats.str(""); |
| 2824 | voxelStats << "Local voxels: " << localTotalString.toLocal8Bit().constData(); | 2824 | voxelStats << "Local voxels: " << localTotalString.toLocal8Bit().constData(); |
| 2825 | verticalOffset += STATS_PELS_PER_LINE; | 2825 | verticalOffset += STATS_PELS_PER_LINE; |
| 2826 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | 2826 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); |
| 2827 | 2827 | ||
| 2828 | if (_statsExpanded) { | 2828 | if (_statsExpanded) { |
| 2829 | unsigned long localInternal = VoxelTreeElement::getInternalNodeCount(); | 2829 | unsigned long localInternal = VoxelTreeElement::getInternalNodeCount(); |
| @@ -2836,7 +2836,7 @@ void Application::displayStats() { · 6 unmodified lines | |||
| 2836 | "Internal: " << localInternalString.toLocal8Bit().constData() << " " << | 2836 | "Internal: " << localInternalString.toLocal8Bit().constData() << " " << |
| 2837 | "Leaves: " << localLeavesString.toLocal8Bit().constData() << ""; | 2837 | "Leaves: " << localLeavesString.toLocal8Bit().constData() << ""; |
| 2838 | verticalOffset += STATS_PELS_PER_LINE; | 2838 | verticalOffset += STATS_PELS_PER_LINE; |
| 2839 | drawText(horizontalOffset, verticalOffset, 0.10f, 0, 2, (char*)voxelStats.str().c_str(), WHITE_TEXT); | 2839 | drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, (char*)voxelStats.str().c_str(), WHITE_TEXT); |
| 2840 | } | 2840 | } |
| 2841 | } | 2841 | } |
| 2842 | 2842 | ||
| @@ -2927,17 +2927,17 @@ glm::vec2 Application::getScaledScreenPoint(glm::vec2 projectedPoint) { · 84 unmodified lines | |||
| 2927 | void Application::renderRearViewMirror(const QRect& region, bool billboard) { | 2927 | void Application::renderRearViewMirror(const QRect& region, bool billboard) { |
| 2928 | bool eyeRelativeCamera = false; | 2928 | bool eyeRelativeCamera = false; |
| 2929 | if (billboard) { | 2929 | if (billboard) { |
| 2930 | _mirrorCamera.setFieldOfView(BILLBOARD_FIELD_OF_VIEW); | 2930 | _mirrorCamera.setFieldOfView(BILLBOARD_FIELD_OF_VIEW); // degees |
| 2931 | _mirrorCamera.setDistance(BILLBOARD_DISTANCE * _myAvatar->getScale()); | 2931 | _mirrorCamera.setDistance(BILLBOARD_DISTANCE * _myAvatar->getScale()); |
| 2932 | _mirrorCamera.setTargetPosition(_myAvatar->getPosition()); | 2932 | _mirrorCamera.setTargetPosition(_myAvatar->getPosition()); |
| 2933 | 2933 | ||
| 2934 | } else if (_rearMirrorTools->getZoomLevel() == BODY) { | 2934 | } else if (_rearMirrorTools->getZoomLevel() == BODY) { |
| 2935 | _mirrorCamera.setFieldOfView(MIRROR_FIELD_OF_VIEW); | 2935 | _mirrorCamera.setFieldOfView(MIRROR_FIELD_OF_VIEW); // degrees |
| 2936 | _mirrorCamera.setDistance(MIRROR_REARVIEW_BODY_DISTANCE * _myAvatar->getScale()); | 2936 | _mirrorCamera.setDistance(MIRROR_REARVIEW_BODY_DISTANCE * _myAvatar->getScale()); |
| 2937 | _mirrorCamera.setTargetPosition(_myAvatar->getChestPosition()); | 2937 | _mirrorCamera.setTargetPosition(_myAvatar->getChestPosition()); |
| 2938 | 2938 | ||
| 2939 | } else { // HEAD zoom level | 2939 | } else { // HEAD zoom level |
| 2940 | _mirrorCamera.setFieldOfView(MIRROR_FIELD_OF_VIEW); | 2940 | _mirrorCamera.setFieldOfView(MIRROR_FIELD_OF_VIEW); // degrees |
| 2941 | _mirrorCamera.setDistance(MIRROR_REARVIEW_DISTANCE * _myAvatar->getScale()); | 2941 | _mirrorCamera.setDistance(MIRROR_REARVIEW_DISTANCE * _myAvatar->getScale()); |
| 2942 | if (_myAvatar->getSkeletonModel().isActive() && _myAvatar->getHead()->getFaceModel().isActive()) { | 2942 | if (_myAvatar->getSkeletonModel().isActive() && _myAvatar->getHead()->getFaceModel().isActive()) { |
| 2943 | // as a hack until we have a better way of dealing with coordinate precision issues, reposition the | 2943 | // as a hack until we have a better way of dealing with coordinate precision issues, reposition the |
| @@ -2951,7 +2951,7 @@ void Application::renderRearViewMirror(const QRect& region, bool billboard) { · 7 unmodified lines | |||
| 2951 | } | 2951 | } |
| 2952 | _mirrorCamera.setAspectRatio((float)region.width() / region.height()); | 2952 | _mirrorCamera.setAspectRatio((float)region.width() / region.height()); |
| 2953 | 2953 | ||
| 2954 | _mirrorCamera.setTargetRotation(_myAvatar->getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PIf, 0.0f))); | 2954 | _mirrorCamera.setTargetRotation(_myAvatar->getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PI, 0.0f))); |
| 2955 | _mirrorCamera.update(1.0f/_fps); | 2955 | _mirrorCamera.update(1.0f/_fps); |
| 2956 | 2956 | ||
| 2957 | // set the bounds of rear mirror view | 2957 | // set the bounds of rear mirror view |