History

Merge branch 'master' of github.com:highfidelity/hifi into overlay-front-draw

Ryan Huffman committed 11 years ago

Commit 9020fee2 parents 649ae4a c5e923f136 files · +6641 −7080Browse files

Showing the changes to interface/src/Application.cpp (1 of 136 files). Show all

Unified · Split

interface/src/Application.cpp+43−43
@@ -604,7 +604,7 @@ void Application::initializeGL() { · 603 unmodified lines
604604 }
605605
606606 // update before the first render
607− update(1.f / _fps);
607+ update(1.0f / _fps);
608608
609609 InfoView::showFirstTime(INFO_HELP_PATH);
610610 }
@@ -668,7 +668,7 @@ void Application::paintGL() { · 57 unmodified lines
668668
669669 // Update camera position
670670 if (!OculusManager::isConnected()) {
671− _myCamera.update(1.f / _fps);
671+ _myCamera.update(1.0f / _fps);
672672 }
673673
674674 // Note: whichCamera is used to pick between the normal camera myCamera for our
@@ -693,7 +693,7 @@ void Application::paintGL() { · 18 unmodified lines
693693
694694 _viewFrustumOffsetCamera.setRotation(_myCamera.getRotation() * frustumRotation);
695695
696− _viewFrustumOffsetCamera.update(1.f/_fps);
696+ _viewFrustumOffsetCamera.update(1.0f/_fps);
697697 whichCamera = &_viewFrustumOffsetCamera;
698698 }
699699
@@ -712,7 +712,7 @@ void Application::paintGL() { · 12 unmodified lines
712712 } else {
713713 OculusManager::display(_myAvatar->getWorldAlignedOrientation(), _myAvatar->getDefaultEyePosition(), *whichCamera);
714714 }
715− _myCamera.update(1.f / _fps);
715+ _myCamera.update(1.0f / _fps);
716716
717717 } else if (TV3DManager::isConnected()) {
718718
@@ -918,7 +918,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 199 unmodified lines
918918 if (!_myAvatar->getDriveKeys(UP)) {
919919 _myAvatar->jump();
920920 }
921− _myAvatar->setDriveKeys(UP, 1.f);
921+ _myAvatar->setDriveKeys(UP, 1.0f);
922922 break;
923923
924924 case Qt::Key_Asterisk:
@@ -927,14 +927,14 @@ void Application::keyPressEvent(QKeyEvent* event) { · 2 unmodified lines
927927
928928 case Qt::Key_C:
929929 case Qt::Key_PageDown:
930− _myAvatar->setDriveKeys(DOWN, 1.f);
930+ _myAvatar->setDriveKeys(DOWN, 1.0f);
931931 break;
932932
933933 case Qt::Key_W:
934934 if (isOption && !isShifted && !isMeta) {
935935 Menu::getInstance()->triggerOption(MenuOption::Wireframe);
936936 } else {
937− _myAvatar->setDriveKeys(FWD, 1.f);
937+ _myAvatar->setDriveKeys(FWD, 1.0f);
938938 }
939939 break;
940940
@@ -946,7 +946,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 5 unmodified lines
946946 } else if (!isOption && !isShifted && isMeta) {
947947 takeSnapshot();
948948 } else {
949− _myAvatar->setDriveKeys(BACK, 1.f);
949+ _myAvatar->setDriveKeys(BACK, 1.0f);
950950 }
951951 break;
952952
@@ -964,13 +964,13 @@ void Application::keyPressEvent(QKeyEvent* event) { · 11 unmodified lines
964964 if (isShifted) {
965965 Menu::getInstance()->triggerOption(MenuOption::Atmosphere);
966966 } else {
967− _myAvatar->setDriveKeys(ROT_LEFT, 1.f);
967+ _myAvatar->setDriveKeys(ROT_LEFT, 1.0f);
968968 }
969969 break;
970970
971971 case Qt::Key_D:
972972 if (!isMeta) {
973− _myAvatar->setDriveKeys(ROT_RIGHT, 1.f);
973+ _myAvatar->setDriveKeys(ROT_RIGHT, 1.0f);
974974 }
975975 break;
976976
@@ -998,7 +998,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 21 unmodified lines
998998 _raiseMirror += 0.05f;
999999 }
10001000 } else {
1001− _myAvatar->setDriveKeys(isShifted ? UP : FWD, 1.f);
1001+ _myAvatar->setDriveKeys(isShifted ? UP : FWD, 1.0f);
10021002 }
10031003 break;
10041004
@@ -1010,23 +1010,23 @@ void Application::keyPressEvent(QKeyEvent* event) { · 5 unmodified lines
10101010 _raiseMirror -= 0.05f;
10111011 }
10121012 } else {
1013− _myAvatar->setDriveKeys(isShifted ? DOWN : BACK, 1.f);
1013+ _myAvatar->setDriveKeys(isShifted ? DOWN : BACK, 1.0f);
10141014 }
10151015 break;
10161016
10171017 case Qt::Key_Left:
10181018 if (_myCamera.getMode() == CAMERA_MODE_MIRROR) {
1019− _rotateMirror += PI / 20.f;
1019+ _rotateMirror += PI / 20.0f;
10201020 } else {
1021− _myAvatar->setDriveKeys(isShifted ? LEFT : ROT_LEFT, 1.f);
1021+ _myAvatar->setDriveKeys(isShifted ? LEFT : ROT_LEFT, 1.0f);
10221022 }
10231023 break;
10241024
10251025 case Qt::Key_Right:
10261026 if (_myCamera.getMode() == CAMERA_MODE_MIRROR) {
1027− _rotateMirror -= PI / 20.f;
1027+ _rotateMirror -= PI / 20.0f;
10281028 } else {
1029− _myAvatar->setDriveKeys(isShifted ? RIGHT : ROT_RIGHT, 1.f);
1029+ _myAvatar->setDriveKeys(isShifted ? RIGHT : ROT_RIGHT, 1.0f);
10301030 }
10311031 break;
10321032
@@ -1177,48 +1177,48 @@ void Application::keyReleaseEvent(QKeyEvent* event) { · 144 unmodified lines
11771177 switch (event->key()) {
11781178 case Qt::Key_E:
11791179 case Qt::Key_PageUp:
1180− _myAvatar->setDriveKeys(UP, 0.f);
1180+ _myAvatar->setDriveKeys(UP, 0.0f);
11811181 break;
11821182
11831183 case Qt::Key_C:
11841184 case Qt::Key_PageDown:
1185− _myAvatar->setDriveKeys(DOWN, 0.f);
1185+ _myAvatar->setDriveKeys(DOWN, 0.0f);
11861186 break;
11871187
11881188 case Qt::Key_W:
1189− _myAvatar->setDriveKeys(FWD, 0.f);
1189+ _myAvatar->setDriveKeys(FWD, 0.0f);
11901190 break;
11911191
11921192 case Qt::Key_S:
1193− _myAvatar->setDriveKeys(BACK, 0.f);
1193+ _myAvatar->setDriveKeys(BACK, 0.0f);
11941194 break;
11951195
11961196 case Qt::Key_A:
1197− _myAvatar->setDriveKeys(ROT_LEFT, 0.f);
1197+ _myAvatar->setDriveKeys(ROT_LEFT, 0.0f);
11981198 break;
11991199
12001200 case Qt::Key_D:
1201− _myAvatar->setDriveKeys(ROT_RIGHT, 0.f);
1201+ _myAvatar->setDriveKeys(ROT_RIGHT, 0.0f);
12021202 break;
12031203
12041204 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);
12071207 break;
12081208
12091209 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);
12121212 break;
12131213
12141214 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);
12171217 break;
12181218
12191219 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);
12221222 break;
12231223 case Qt::Key_Control:
12241224 case Qt::Key_Shift:
@@ -1522,7 +1522,7 @@ void Application::idle() { · 297 unmodified lines
15221522 PerformanceTimer perfTimer("update");
15231523 PerformanceWarning warn(showWarnings, "Application::idle()... update()");
15241524 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));
15261526 }
15271527 {
15281528 PerformanceTimer perfTimer("updateGL");
@@ -1653,8 +1653,8 @@ void Application::makeVoxel(glm::vec3 position, · 124 unmodified lines
16531653 }
16541654
16551655 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);
16581658 }
16591659
16601660 FaceTracker* Application::getActiveFaceTracker() {
@@ -1867,7 +1867,7 @@ void Application::init() { · 206 unmodified lines
18671867 3.0f * TREE_SCALE / 2.0f));
18681868 _sharedVoxelSystemViewFrustum.setNearClip(TREE_SCALE / 2.0f);
18691869 _sharedVoxelSystemViewFrustum.setFarClip(3.0f * TREE_SCALE / 2.0f);
1870− _sharedVoxelSystemViewFrustum.setFieldOfView(90.f);
1870+ _sharedVoxelSystemViewFrustum.setFieldOfView(90.0f);
18711871 _sharedVoxelSystemViewFrustum.setOrientation(glm::quat());
18721872 _sharedVoxelSystemViewFrustum.calculate();
18731873 _sharedVoxelSystem.setViewFrustum(&_sharedVoxelSystemViewFrustum);
@@ -2163,7 +2163,7 @@ void Application::updateMyAvatarLookAtPosition() { · 289 unmodified lines
21632163 } else {
21642164 // I am not looking at anyone else, so just look forward
21652165 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));
21672167 }
21682168 }
21692169 //
@@ -2317,7 +2317,7 @@ void Application::update(float deltaTime) { · 147 unmodified lines
23172317 updateDialogs(deltaTime); // update various stats dialogs if present
23182318 updateCursor(deltaTime); // Handle cursor updates
23192319
2320− {
2320+ if (!_aboutToQuit) {
23212321 PerformanceTimer perfTimer("entities");
23222322 _entities.update(); // update the models...
23232323 {
@@ -3221,12 +3221,12 @@ void Application::renderRearViewMirror(const QRect& region, bool billboard) { · 897 unmodified lines
32213221 if (billboard) {
32223222 _mirrorCamera.setFieldOfView(BILLBOARD_FIELD_OF_VIEW); // degees
32233223 _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());
32253225
32263226 } else if (_rearMirrorTools->getZoomLevel() == BODY) {
32273227 _mirrorCamera.setFieldOfView(MIRROR_FIELD_OF_VIEW); // degrees
32283228 _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());
32303230
32313231 } else { // HEAD zoom level
32323232 _mirrorCamera.setFieldOfView(MIRROR_FIELD_OF_VIEW); // degrees
@@ -3234,11 +3234,11 @@ void Application::renderRearViewMirror(const QRect& region, bool billboard) { · 1 unmodified line
32343234 // as a hack until we have a better way of dealing with coordinate precision issues, reposition the
32353235 // face/body so that the average eye position lies at the origin
32363236 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());
32383238
32393239 } else {
32403240 _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());
32423242 }
32433243 }
32443244 _mirrorCamera.setAspectRatio((float)region.width() / region.height());
@@ -4234,7 +4234,7 @@ void Application::toggleLogDialog() { · 989 unmodified lines
42344234 }
42354235
42364236 void Application::initAvatarAndViewFrustum() {
4237− updateMyAvatar(0.f);
4237+ updateMyAvatar(0.0f);
42384238 }
42394239
42404240 void Application::checkVersion() {
@@ -4408,7 +4408,7 @@ unsigned int Application::getRenderTargetFramerate() const { · 167 unmodified lines
44084408
44094409 float Application::getRenderResolutionScale() const {
44104410 if (Menu::getInstance()->isOptionChecked(MenuOption::RenderResolutionOne)) {
4411− return 1.f;
4411+ return 1.0f;
44124412 } else if (Menu::getInstance()->isOptionChecked(MenuOption::RenderResolutionTwoThird)) {
44134413 return 0.666f;
44144414 } else if (Menu::getInstance()->isOptionChecked(MenuOption::RenderResolutionHalf)) {
@@ -4418,6 +4418,6 @@ float Application::getRenderResolutionScale() const { · 3 unmodified lines
44184418 } else if (Menu::getInstance()->isOptionChecked(MenuOption::RenderResolutionQuarter)) {
44194419 return 0.25f;
44204420 } else {
4421− return 1.f;
4421+ return 1.0f;
44224422 }
44234423 }