Showing the changes to interface/src/Application.cpp (1 of 136 files). Show all
Unified · Split
| @@ -604,7 +604,7 @@ void Application::initializeGL() { · 603 unmodified lines | ||
| 604 | 604 | } |
| 605 | 605 | |
| 606 | 606 | // update before the first render |
| 607 | − update(1.f / _fps); | |
| 607 | + update(1.0f / _fps); | |
| 608 | 608 | |
| 609 | 609 | InfoView::showFirstTime(INFO_HELP_PATH); |
| 610 | 610 | } |
| @@ -668,7 +668,7 @@ void Application::paintGL() { · 57 unmodified lines | ||
| 668 | 668 | |
| 669 | 669 | // Update camera position |
| 670 | 670 | if (!OculusManager::isConnected()) { |
| 671 | − _myCamera.update(1.f / _fps); | |
| 671 | + _myCamera.update(1.0f / _fps); | |
| 672 | 672 | } |
| 673 | 673 | |
| 674 | 674 | // Note: whichCamera is used to pick between the normal camera myCamera for our |
| @@ -693,7 +693,7 @@ void Application::paintGL() { · 18 unmodified lines | ||
| 693 | 693 | |
| 694 | 694 | _viewFrustumOffsetCamera.setRotation(_myCamera.getRotation() * frustumRotation); |
| 695 | 695 | |
| 696 | − _viewFrustumOffsetCamera.update(1.f/_fps); | |
| 696 | + _viewFrustumOffsetCamera.update(1.0f/_fps); | |
| 697 | 697 | whichCamera = &_viewFrustumOffsetCamera; |
| 698 | 698 | } |
| 699 | 699 | |
| @@ -712,7 +712,7 @@ void Application::paintGL() { · 12 unmodified lines | ||
| 712 | 712 | } else { |
| 713 | 713 | OculusManager::display(_myAvatar->getWorldAlignedOrientation(), _myAvatar->getDefaultEyePosition(), *whichCamera); |
| 714 | 714 | } |
| 715 | − _myCamera.update(1.f / _fps); | |
| 715 | + _myCamera.update(1.0f / _fps); | |
| 716 | 716 | |
| 717 | 717 | } else if (TV3DManager::isConnected()) { |
| 718 | 718 | |
| @@ -918,7 +918,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 199 unmodified lines | ||
| 918 | 918 | if (!_myAvatar->getDriveKeys(UP)) { |
| 919 | 919 | _myAvatar->jump(); |
| 920 | 920 | } |
| 921 | − _myAvatar->setDriveKeys(UP, 1.f); | |
| 921 | + _myAvatar->setDriveKeys(UP, 1.0f); | |
| 922 | 922 | break; |
| 923 | 923 | |
| 924 | 924 | case Qt::Key_Asterisk: |
| @@ -927,14 +927,14 @@ void Application::keyPressEvent(QKeyEvent* event) { · 2 unmodified lines | ||
| 927 | 927 | |
| 928 | 928 | case Qt::Key_C: |
| 929 | 929 | case Qt::Key_PageDown: |
| 930 | − _myAvatar->setDriveKeys(DOWN, 1.f); | |
| 930 | + _myAvatar->setDriveKeys(DOWN, 1.0f); | |
| 931 | 931 | break; |
| 932 | 932 | |
| 933 | 933 | case Qt::Key_W: |
| 934 | 934 | if (isOption && !isShifted && !isMeta) { |
| 935 | 935 | Menu::getInstance()->triggerOption(MenuOption::Wireframe); |
| 936 | 936 | } else { |
| 937 | − _myAvatar->setDriveKeys(FWD, 1.f); | |
| 937 | + _myAvatar->setDriveKeys(FWD, 1.0f); | |
| 938 | 938 | } |
| 939 | 939 | break; |
| 940 | 940 | |
| @@ -946,7 +946,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 5 unmodified lines | ||
| 946 | 946 | } else if (!isOption && !isShifted && isMeta) { |
| 947 | 947 | takeSnapshot(); |
| 948 | 948 | } else { |
| 949 | − _myAvatar->setDriveKeys(BACK, 1.f); | |
| 949 | + _myAvatar->setDriveKeys(BACK, 1.0f); | |
| 950 | 950 | } |
| 951 | 951 | break; |
| 952 | 952 | |
| @@ -964,13 +964,13 @@ void Application::keyPressEvent(QKeyEvent* event) { · 11 unmodified lines | ||
| 964 | 964 | if (isShifted) { |
| 965 | 965 | Menu::getInstance()->triggerOption(MenuOption::Atmosphere); |
| 966 | 966 | } else { |
| 967 | − _myAvatar->setDriveKeys(ROT_LEFT, 1.f); | |
| 967 | + _myAvatar->setDriveKeys(ROT_LEFT, 1.0f); | |
| 968 | 968 | } |
| 969 | 969 | break; |
| 970 | 970 | |
| 971 | 971 | case Qt::Key_D: |
| 972 | 972 | if (!isMeta) { |
| 973 | − _myAvatar->setDriveKeys(ROT_RIGHT, 1.f); | |
| 973 | + _myAvatar->setDriveKeys(ROT_RIGHT, 1.0f); | |
| 974 | 974 | } |
| 975 | 975 | break; |
| 976 | 976 | |
| @@ -998,7 +998,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 21 unmodified lines | ||
| 998 | 998 | _raiseMirror += 0.05f; |
| 999 | 999 | } |
| 1000 | 1000 | } else { |
| 1001 | − _myAvatar->setDriveKeys(isShifted ? UP : FWD, 1.f); | |
| 1001 | + _myAvatar->setDriveKeys(isShifted ? UP : FWD, 1.0f); | |
| 1002 | 1002 | } |
| 1003 | 1003 | break; |
| 1004 | 1004 | |
| @@ -1010,23 +1010,23 @@ void Application::keyPressEvent(QKeyEvent* event) { · 5 unmodified lines | ||
| 1010 | 1010 | _raiseMirror -= 0.05f; |
| 1011 | 1011 | } |
| 1012 | 1012 | } else { |
| 1013 | − _myAvatar->setDriveKeys(isShifted ? DOWN : BACK, 1.f); | |
| 1013 | + _myAvatar->setDriveKeys(isShifted ? DOWN : BACK, 1.0f); | |
| 1014 | 1014 | } |
| 1015 | 1015 | break; |
| 1016 | 1016 | |
| 1017 | 1017 | case Qt::Key_Left: |
| 1018 | 1018 | if (_myCamera.getMode() == CAMERA_MODE_MIRROR) { |
| 1019 | − _rotateMirror += PI / 20.f; | |
| 1019 | + _rotateMirror += PI / 20.0f; | |
| 1020 | 1020 | } else { |
| 1021 | − _myAvatar->setDriveKeys(isShifted ? LEFT : ROT_LEFT, 1.f); | |
| 1021 | + _myAvatar->setDriveKeys(isShifted ? LEFT : ROT_LEFT, 1.0f); | |
| 1022 | 1022 | } |
| 1023 | 1023 | break; |
| 1024 | 1024 | |
| 1025 | 1025 | case Qt::Key_Right: |
| 1026 | 1026 | if (_myCamera.getMode() == CAMERA_MODE_MIRROR) { |
| 1027 | − _rotateMirror -= PI / 20.f; | |
| 1027 | + _rotateMirror -= PI / 20.0f; | |
| 1028 | 1028 | } else { |
| 1029 | − _myAvatar->setDriveKeys(isShifted ? RIGHT : ROT_RIGHT, 1.f); | |
| 1029 | + _myAvatar->setDriveKeys(isShifted ? RIGHT : ROT_RIGHT, 1.0f); | |
| 1030 | 1030 | } |
| 1031 | 1031 | break; |
| 1032 | 1032 | |
| @@ -1177,48 +1177,48 @@ void Application::keyReleaseEvent(QKeyEvent* event) { · 144 unmodified lines | ||
| 1177 | 1177 | switch (event->key()) { |
| 1178 | 1178 | case Qt::Key_E: |
| 1179 | 1179 | case Qt::Key_PageUp: |
| 1180 | − _myAvatar->setDriveKeys(UP, 0.f); | |
| 1180 | + _myAvatar->setDriveKeys(UP, 0.0f); | |
| 1181 | 1181 | break; |
| 1182 | 1182 | |
| 1183 | 1183 | case Qt::Key_C: |
| 1184 | 1184 | case Qt::Key_PageDown: |
| 1185 | − _myAvatar->setDriveKeys(DOWN, 0.f); | |
| 1185 | + _myAvatar->setDriveKeys(DOWN, 0.0f); | |
| 1186 | 1186 | break; |
| 1187 | 1187 | |
| 1188 | 1188 | case Qt::Key_W: |
| 1189 | − _myAvatar->setDriveKeys(FWD, 0.f); | |
| 1189 | + _myAvatar->setDriveKeys(FWD, 0.0f); | |
| 1190 | 1190 | break; |
| 1191 | 1191 | |
| 1192 | 1192 | case Qt::Key_S: |
| 1193 | − _myAvatar->setDriveKeys(BACK, 0.f); | |
| 1193 | + _myAvatar->setDriveKeys(BACK, 0.0f); | |
| 1194 | 1194 | break; |
| 1195 | 1195 | |
| 1196 | 1196 | case Qt::Key_A: |
| 1197 | − _myAvatar->setDriveKeys(ROT_LEFT, 0.f); | |
| 1197 | + _myAvatar->setDriveKeys(ROT_LEFT, 0.0f); | |
| 1198 | 1198 | break; |
| 1199 | 1199 | |
| 1200 | 1200 | case Qt::Key_D: |
| 1201 | − _myAvatar->setDriveKeys(ROT_RIGHT, 0.f); | |
| 1201 | + _myAvatar->setDriveKeys(ROT_RIGHT, 0.0f); | |
| 1202 | 1202 | break; |
| 1203 | 1203 | |
| 1204 | 1204 | case Qt::Key_Up: |
| 1205 | − _myAvatar->setDriveKeys(FWD, 0.f); | |
| 1206 | − _myAvatar->setDriveKeys(UP, 0.f); | |
| 1205 | + _myAvatar->setDriveKeys(FWD, 0.0f); | |
| 1206 | + _myAvatar->setDriveKeys(UP, 0.0f); | |
| 1207 | 1207 | break; |
| 1208 | 1208 | |
| 1209 | 1209 | case Qt::Key_Down: |
| 1210 | − _myAvatar->setDriveKeys(BACK, 0.f); | |
| 1211 | − _myAvatar->setDriveKeys(DOWN, 0.f); | |
| 1210 | + _myAvatar->setDriveKeys(BACK, 0.0f); | |
| 1211 | + _myAvatar->setDriveKeys(DOWN, 0.0f); | |
| 1212 | 1212 | break; |
| 1213 | 1213 | |
| 1214 | 1214 | case Qt::Key_Left: |
| 1215 | − _myAvatar->setDriveKeys(LEFT, 0.f); | |
| 1216 | − _myAvatar->setDriveKeys(ROT_LEFT, 0.f); | |
| 1215 | + _myAvatar->setDriveKeys(LEFT, 0.0f); | |
| 1216 | + _myAvatar->setDriveKeys(ROT_LEFT, 0.0f); | |
| 1217 | 1217 | break; |
| 1218 | 1218 | |
| 1219 | 1219 | case Qt::Key_Right: |
| 1220 | − _myAvatar->setDriveKeys(RIGHT, 0.f); | |
| 1221 | − _myAvatar->setDriveKeys(ROT_RIGHT, 0.f); | |
| 1220 | + _myAvatar->setDriveKeys(RIGHT, 0.0f); | |
| 1221 | + _myAvatar->setDriveKeys(ROT_RIGHT, 0.0f); | |
| 1222 | 1222 | break; |
| 1223 | 1223 | case Qt::Key_Control: |
| 1224 | 1224 | case Qt::Key_Shift: |
| @@ -1522,7 +1522,7 @@ void Application::idle() { · 297 unmodified lines | ||
| 1522 | 1522 | PerformanceTimer perfTimer("update"); |
| 1523 | 1523 | PerformanceWarning warn(showWarnings, "Application::idle()... update()"); |
| 1524 | 1524 | const float BIGGEST_DELTA_TIME_SECS = 0.25f; |
| 1525 | − update(glm::clamp((float)timeSinceLastUpdate / 1000.f, 0.f, BIGGEST_DELTA_TIME_SECS)); | |
| 1525 | + update(glm::clamp((float)timeSinceLastUpdate / 1000.0f, 0.0f, BIGGEST_DELTA_TIME_SECS)); | |
| 1526 | 1526 | } |
| 1527 | 1527 | { |
| 1528 | 1528 | PerformanceTimer perfTimer("updateGL"); |
| @@ -1653,8 +1653,8 @@ void Application::makeVoxel(glm::vec3 position, · 124 unmodified lines | ||
| 1653 | 1653 | } |
| 1654 | 1654 | |
| 1655 | 1655 | glm::vec3 Application::getMouseVoxelWorldCoordinates(const VoxelDetail& mouseVoxel) { |
| 1656 | − return glm::vec3((mouseVoxel.x + mouseVoxel.s / 2.f) * TREE_SCALE, (mouseVoxel.y + mouseVoxel.s / 2.f) * TREE_SCALE, | |
| 1657 | − (mouseVoxel.z + mouseVoxel.s / 2.f) * TREE_SCALE); | |
| 1656 | + return glm::vec3((mouseVoxel.x + mouseVoxel.s / 2.0f) * TREE_SCALE, (mouseVoxel.y + mouseVoxel.s / 2.0f) * TREE_SCALE, | |
| 1657 | + (mouseVoxel.z + mouseVoxel.s / 2.0f) * TREE_SCALE); | |
| 1658 | 1658 | } |
| 1659 | 1659 | |
| 1660 | 1660 | FaceTracker* Application::getActiveFaceTracker() { |
| @@ -1867,7 +1867,7 @@ void Application::init() { · 206 unmodified lines | ||
| 1867 | 1867 | 3.0f * TREE_SCALE / 2.0f)); |
| 1868 | 1868 | _sharedVoxelSystemViewFrustum.setNearClip(TREE_SCALE / 2.0f); |
| 1869 | 1869 | _sharedVoxelSystemViewFrustum.setFarClip(3.0f * TREE_SCALE / 2.0f); |
| 1870 | − _sharedVoxelSystemViewFrustum.setFieldOfView(90.f); | |
| 1870 | + _sharedVoxelSystemViewFrustum.setFieldOfView(90.0f); | |
| 1871 | 1871 | _sharedVoxelSystemViewFrustum.setOrientation(glm::quat()); |
| 1872 | 1872 | _sharedVoxelSystemViewFrustum.calculate(); |
| 1873 | 1873 | _sharedVoxelSystem.setViewFrustum(&_sharedVoxelSystemViewFrustum); |
| @@ -2163,7 +2163,7 @@ void Application::updateMyAvatarLookAtPosition() { · 289 unmodified lines | ||
| 2163 | 2163 | } else { |
| 2164 | 2164 | // I am not looking at anyone else, so just look forward |
| 2165 | 2165 | lookAtSpot = _myAvatar->getHead()->getEyePosition() + |
| 2166 | − (_myAvatar->getHead()->getFinalOrientationInWorldFrame() * glm::vec3(0.f, 0.f, -TREE_SCALE)); | |
| 2166 | + (_myAvatar->getHead()->getFinalOrientationInWorldFrame() * glm::vec3(0.0f, 0.0f, -TREE_SCALE)); | |
| 2167 | 2167 | } |
| 2168 | 2168 | } |
| 2169 | 2169 | // |
| @@ -2317,7 +2317,7 @@ void Application::update(float deltaTime) { · 147 unmodified lines | ||
| 2317 | 2317 | updateDialogs(deltaTime); // update various stats dialogs if present |
| 2318 | 2318 | updateCursor(deltaTime); // Handle cursor updates |
| 2319 | 2319 | |
| 2320 | − { | |
| 2320 | + if (!_aboutToQuit) { | |
| 2321 | 2321 | PerformanceTimer perfTimer("entities"); |
| 2322 | 2322 | _entities.update(); // update the models... |
| 2323 | 2323 | { |
| @@ -3221,12 +3221,12 @@ void Application::renderRearViewMirror(const QRect& region, bool billboard) { · 897 unmodified lines | ||
| 3221 | 3221 | if (billboard) { |
| 3222 | 3222 | _mirrorCamera.setFieldOfView(BILLBOARD_FIELD_OF_VIEW); // degees |
| 3223 | 3223 | _mirrorCamera.setPosition(_myAvatar->getPosition() + |
| 3224 | − _myAvatar->getOrientation() * glm::vec3(0.f, 0.f, -1.0f) * BILLBOARD_DISTANCE * _myAvatar->getScale()); | |
| 3224 | + _myAvatar->getOrientation() * glm::vec3(0.0f, 0.0f, -1.0f) * BILLBOARD_DISTANCE * _myAvatar->getScale()); | |
| 3225 | 3225 | |
| 3226 | 3226 | } else if (_rearMirrorTools->getZoomLevel() == BODY) { |
| 3227 | 3227 | _mirrorCamera.setFieldOfView(MIRROR_FIELD_OF_VIEW); // degrees |
| 3228 | 3228 | _mirrorCamera.setPosition(_myAvatar->getChestPosition() + |
| 3229 | − _myAvatar->getOrientation() * glm::vec3(0.f, 0.f, -1.0f) * MIRROR_REARVIEW_BODY_DISTANCE * _myAvatar->getScale()); | |
| 3229 | + _myAvatar->getOrientation() * glm::vec3(0.0f, 0.0f, -1.0f) * MIRROR_REARVIEW_BODY_DISTANCE * _myAvatar->getScale()); | |
| 3230 | 3230 | |
| 3231 | 3231 | } else { // HEAD zoom level |
| 3232 | 3232 | _mirrorCamera.setFieldOfView(MIRROR_FIELD_OF_VIEW); // degrees |
| @@ -3234,11 +3234,11 @@ void Application::renderRearViewMirror(const QRect& region, bool billboard) { · 1 unmodified line | ||
| 3234 | 3234 | // as a hack until we have a better way of dealing with coordinate precision issues, reposition the |
| 3235 | 3235 | // face/body so that the average eye position lies at the origin |
| 3236 | 3236 | eyeRelativeCamera = true; |
| 3237 | − _mirrorCamera.setPosition(_myAvatar->getOrientation() * glm::vec3(0.f, 0.f, -1.0f) * MIRROR_REARVIEW_DISTANCE * _myAvatar->getScale()); | |
| 3237 | + _mirrorCamera.setPosition(_myAvatar->getOrientation() * glm::vec3(0.0f, 0.0f, -1.0f) * MIRROR_REARVIEW_DISTANCE * _myAvatar->getScale()); | |
| 3238 | 3238 | |
| 3239 | 3239 | } else { |
| 3240 | 3240 | _mirrorCamera.setPosition(_myAvatar->getHead()->getEyePosition() + |
| 3241 | − _myAvatar->getOrientation() * glm::vec3(0.f, 0.f, -1.0f) * MIRROR_REARVIEW_DISTANCE * _myAvatar->getScale()); | |
| 3241 | + _myAvatar->getOrientation() * glm::vec3(0.0f, 0.0f, -1.0f) * MIRROR_REARVIEW_DISTANCE * _myAvatar->getScale()); | |
| 3242 | 3242 | } |
| 3243 | 3243 | } |
| 3244 | 3244 | _mirrorCamera.setAspectRatio((float)region.width() / region.height()); |
| @@ -4234,7 +4234,7 @@ void Application::toggleLogDialog() { · 989 unmodified lines | ||
| 4234 | 4234 | } |
| 4235 | 4235 | |
| 4236 | 4236 | void Application::initAvatarAndViewFrustum() { |
| 4237 | − updateMyAvatar(0.f); | |
| 4237 | + updateMyAvatar(0.0f); | |
| 4238 | 4238 | } |
| 4239 | 4239 | |
| 4240 | 4240 | void Application::checkVersion() { |
| @@ -4408,7 +4408,7 @@ unsigned int Application::getRenderTargetFramerate() const { · 167 unmodified lines | ||
| 4408 | 4408 | |
| 4409 | 4409 | float Application::getRenderResolutionScale() const { |
| 4410 | 4410 | if (Menu::getInstance()->isOptionChecked(MenuOption::RenderResolutionOne)) { |
| 4411 | − return 1.f; | |
| 4411 | + return 1.0f; | |
| 4412 | 4412 | } else if (Menu::getInstance()->isOptionChecked(MenuOption::RenderResolutionTwoThird)) { |
| 4413 | 4413 | return 0.666f; |
| 4414 | 4414 | } else if (Menu::getInstance()->isOptionChecked(MenuOption::RenderResolutionHalf)) { |
| @@ -4418,6 +4418,6 @@ float Application::getRenderResolutionScale() const { · 3 unmodified lines | ||
| 4418 | 4418 | } else if (Menu::getInstance()->isOptionChecked(MenuOption::RenderResolutionQuarter)) { |
| 4419 | 4419 | return 0.25f; |
| 4420 | 4420 | } else { |
| 4421 | − return 1.f; | |
| 4421 | + return 1.0f; | |
| 4422 | 4422 | } |
| 4423 | 4423 | } |