History

Merge branch 'master' of https://github.com/highfidelity/hifi into editVoxels

Atlante45 committed 12 years ago

Commit a2acdc02 parents 9402a58 e249b2985 files · +2101 −860Browse files

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

Unified · Split

interface/src/Application.cpp+65−92
@@ -154,7 +154,6 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 153 unmodified lines
154154 _touchAvgY(0.0f),
155155 _isTouchPressed(false),
156156 _mousePressed(false),
157− _chatEntryOn(false),
158157 _audio(&_audioScope, STARTUP_JITTER_SAMPLES),
159158 _enableProcessVoxelsThread(true),
160159 _voxelProcessor(),
@@ -508,7 +507,7 @@ void Application::paintGL() { · 347 unmodified lines
508507 float headHeight = _myAvatar->getHead()->calculateAverageEyePosition().y - _myAvatar->getPosition().y;
509508 _myCamera.setDistance(MIRROR_FULLSCREEN_DISTANCE * _myAvatar->getScale());
510509 _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)));
512511 }
513512
514513 // Update camera position
@@ -699,21 +698,6 @@ void Application::keyPressEvent(QKeyEvent* event) { · 184 unmodified lines
699698 }
700699
701700 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−
717701 bool isShifted = event->modifiers().testFlag(Qt::ShiftModifier);
718702 bool isMeta = event->modifiers().testFlag(Qt::ControlModifier);
719703 switch (event->key()) {
@@ -745,7 +729,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 25 unmodified lines
745729 if (!_myAvatar->getDriveKeys(UP)) {
746730 _myAvatar->jump();
747731 }
748− _myAvatar->setDriveKeys(UP, 1);
732+ _myAvatar->setDriveKeys(UP, 1.f);
749733 break;
750734
751735 case Qt::Key_Asterisk:
@@ -753,11 +737,11 @@ void Application::keyPressEvent(QKeyEvent* event) { · 1 unmodified line
753737 break;
754738
755739 case Qt::Key_C:
756− _myAvatar->setDriveKeys(DOWN, 1);
740+ _myAvatar->setDriveKeys(DOWN, 1.f);
757741 break;
758742
759743 case Qt::Key_W:
760− _myAvatar->setDriveKeys(FWD, 1);
744+ _myAvatar->setDriveKeys(FWD, 1.f);
761745 break;
762746
763747 case Qt::Key_S:
@@ -766,7 +750,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 2 unmodified lines
766750 } else if (!isShifted && isMeta) {
767751 takeSnapshot();
768752 } else {
769− _myAvatar->setDriveKeys(BACK, 1);
753+ _myAvatar->setDriveKeys(BACK, 1.f);
770754 }
771755 break;
772756
@@ -784,36 +768,33 @@ void Application::keyPressEvent(QKeyEvent* event) { · 11 unmodified lines
784768 if (isShifted) {
785769 Menu::getInstance()->triggerOption(MenuOption::Atmosphere);
786770 } else {
787− _myAvatar->setDriveKeys(ROT_LEFT, 1);
771+ _myAvatar->setDriveKeys(ROT_LEFT, 1.f);
788772 }
789773 break;
790774
791775 case Qt::Key_D:
792− _myAvatar->setDriveKeys(ROT_RIGHT, 1);
776+ _myAvatar->setDriveKeys(ROT_RIGHT, 1.f);
793777 break;
794778
795779 case Qt::Key_Return:
796780 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);
801782 break;
802783
803784 case Qt::Key_Up:
804− _myAvatar->setDriveKeys(isShifted ? UP : FWD, 1);
785+ _myAvatar->setDriveKeys(isShifted ? UP : FWD, 1.f);
805786 break;
806787
807788 case Qt::Key_Down:
808− _myAvatar->setDriveKeys(isShifted ? DOWN : BACK, 1);
789+ _myAvatar->setDriveKeys(isShifted ? DOWN : BACK, 1.f);
809790 break;
810791
811792 case Qt::Key_Left:
812− _myAvatar->setDriveKeys(isShifted ? LEFT : ROT_LEFT, 1);
793+ _myAvatar->setDriveKeys(isShifted ? LEFT : ROT_LEFT, 1.f);
813794 break;
814795
815796 case Qt::Key_Right:
816− _myAvatar->setDriveKeys(isShifted ? RIGHT : ROT_RIGHT, 1);
797+ _myAvatar->setDriveKeys(isShifted ? RIGHT : ROT_RIGHT, 1.f);
817798 break;
818799
819800 case Qt::Key_I:
@@ -940,54 +921,49 @@ void Application::keyReleaseEvent(QKeyEvent* event) { · 120 unmodified lines
940921
941922
942923 if (activeWindow() == _window) {
943− if (_chatEntryOn) {
944− _myAvatar->setKeyState(NO_KEY_DOWN);
945− return;
946− }
947−
948924 switch (event->key()) {
949925 case Qt::Key_E:
950− _myAvatar->setDriveKeys(UP, 0);
926+ _myAvatar->setDriveKeys(UP, 0.f);
951927 break;
952928
953929 case Qt::Key_C:
954− _myAvatar->setDriveKeys(DOWN, 0);
930+ _myAvatar->setDriveKeys(DOWN, 0.f);
955931 break;
956932
957933 case Qt::Key_W:
958− _myAvatar->setDriveKeys(FWD, 0);
934+ _myAvatar->setDriveKeys(FWD, 0.f);
959935 break;
960936
961937 case Qt::Key_S:
962− _myAvatar->setDriveKeys(BACK, 0);
938+ _myAvatar->setDriveKeys(BACK, 0.f);
963939 break;
964940
965941 case Qt::Key_A:
966− _myAvatar->setDriveKeys(ROT_LEFT, 0);
942+ _myAvatar->setDriveKeys(ROT_LEFT, 0.f);
967943 break;
968944
969945 case Qt::Key_D:
970− _myAvatar->setDriveKeys(ROT_RIGHT, 0);
946+ _myAvatar->setDriveKeys(ROT_RIGHT, 0.f);
971947 break;
972948
973949 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);
976952 break;
977953
978954 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);
981957 break;
982958
983959 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);
986962 break;
987963
988964 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);
991967 break;
992968
993969 default:
@@ -1242,8 +1218,10 @@ void Application::idle() { · 248 unmodified lines
12421218 _idleLoopStdev.reset();
12431219 }
12441220
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+
12471225 // After finishing all of the above work, restart the idle timer, allowing 2ms to process events.
12481226 idleTimer->start(2);
12491227 }
@@ -1492,7 +1470,7 @@ void Application::init() { · 242 unmodified lines
14921470 3.0f * TREE_SCALE / 2.0f));
14931471 _sharedVoxelSystemViewFrustum.setNearClip(TREE_SCALE / 2.0f);
14941472 _sharedVoxelSystemViewFrustum.setFarClip(3.0f * TREE_SCALE / 2.0f);
1495− _sharedVoxelSystemViewFrustum.setFieldOfView(90);
1473+ _sharedVoxelSystemViewFrustum.setFieldOfView(90.f);
14961474 _sharedVoxelSystemViewFrustum.setOrientation(glm::quat());
14971475 _sharedVoxelSystemViewFrustum.calculate();
14981476 _sharedVoxelSystem.setViewFrustum(&_sharedVoxelSystemViewFrustum);
@@ -2121,7 +2099,7 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node · 622 unmodified lines
21212099 void Application::loadViewFrustum(Camera& camera, ViewFrustum& viewFrustum) {
21222100 // We will use these below, from either the camera or head vectors calculated above
21232101 glm::vec3 position(camera.getPosition());
2124− float fov = camera.getFieldOfView();
2102+ float fov = camera.getFieldOfView(); // degrees
21252103 float nearClip = camera.getNearClip();
21262104 float farClip = camera.getFarClip();
21272105 float aspectRatio = camera.getAspectRatio();
@@ -2134,7 +2112,7 @@ void Application::loadViewFrustum(Camera& camera, ViewFrustum& viewFrustum) { · 6 unmodified lines
21342112
21352113 // Also make sure it's got the correct lens details from the camera
21362114 viewFrustum.setAspectRatio(aspectRatio);
2137− viewFrustum.setFieldOfView(fov);
2115+ viewFrustum.setFieldOfView(fov); // degrees
21382116 viewFrustum.setNearClip(nearClip);
21392117 viewFrustum.setFarClip(farClip);
21402118 viewFrustum.setEyeOffsetPosition(camera.getEyeOffsetPosition());
@@ -2196,7 +2174,7 @@ void Application::updateShadowMap() { · 55 unmodified lines
21962174 glPushMatrix();
21972175 glLoadIdentity();
21982176 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);
22002178
22012179 // store view matrix without translation, which we'll use for precision-sensitive objects
22022180 glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat*)&_untranslatedViewMatrix);
@@ -2275,7 +2253,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 72 unmodified lines
22752253 glm::vec3 eyeOffsetPos = whichCamera.getEyeOffsetPosition();
22762254 glm::quat eyeOffsetOrient = whichCamera.getEyeOffsetOrientation();
22772255 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);
22792257 glTranslatef(-eyeOffsetPos.x, -eyeOffsetPos.y, -eyeOffsetPos.z);
22802258
22812259 // transform view according to whichCamera
@@ -2284,7 +2262,7 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 2 unmodified lines
22842262
22852263 glm::quat rotation = whichCamera.getRotation();
22862264 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);
22882266
22892267 // store view matrix without translation, which we'll use for precision-sensitive objects
22902268 glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat*)&_untranslatedViewMatrix);
@@ -2488,11 +2466,6 @@ void Application::displayOverlay() { · 197 unmodified lines
24882466 }
24892467 }
24902468
2491− // Show chat entry field
2492− if (_chatEntryOn) {
2493− _chatEntry.render(_glWidget->width(), _glWidget->height());
2494− }
2495−
24962469 // Show on-screen msec timer
24972470 if (Menu::getInstance()->isOptionChecked(MenuOption::FrameTimer)) {
24982471 char frameTimer[10];
@@ -2502,7 +2475,7 @@ void Application::displayOverlay() { · 3 unmodified lines
25022475 (Menu::getInstance()->isOptionChecked(MenuOption::Stats) &&
25032476 Menu::getInstance()->isOptionChecked(MenuOption::Bandwidth))
25042477 ? 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);
25062479 }
25072480
25082481 _overlays.render2D();
@@ -2557,11 +2530,11 @@ void Application::displayStats() { · 48 unmodified lines
25572530 sprintf(framesPerSecond, "Framerate: %3.0f FPS", _fps);
25582531
25592532 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);
25612534 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);
25632536 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);
25652538
25662539 if (_statsExpanded) {
25672540 char packetsPerSecond[30];
@@ -2570,9 +2543,9 @@ void Application::displayStats() { · 2 unmodified lines
25702543 sprintf(averageMegabitsPerSecond, "Mbps: %3.2f", (float)_bytesPerSecond * 8.f / 1000000.f);
25712544
25722545 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);
25742547 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);
25762549 }
25772550
25782551 verticalOffset = 0;
@@ -2615,7 +2588,7 @@ void Application::displayStats() { · 36 unmodified lines
26152588 "Buffer msecs %.1f",
26162589 (float) (_audio.getNetworkBufferLengthSamplesPerChannel() + (float) _audio.getJitterBufferSamples()) /
26172590 (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);
26192592
26202593
26212594 char audioPing[30];
@@ -2628,18 +2601,18 @@ void Application::displayStats() { · 6 unmodified lines
26282601 sprintf(voxelAvgPing, "Voxel avg ping: %d", pingVoxel);
26292602
26302603 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);
26322605 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);
26342607 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);
26362609
26372610 if (_statsExpanded) {
26382611 char voxelMaxPing[30];
26392612 sprintf(voxelMaxPing, "Voxel max ping: %d", pingVoxelMax);
26402613
26412614 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);
26432616 }
26442617
26452618 verticalOffset = 0;
@@ -2667,11 +2640,11 @@ void Application::displayStats() { · 21 unmodified lines
26672640 char avatarMixerStats[200];
26682641
26692642 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);
26712644 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);
26732646 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);
26752648
26762649 if (_statsExpanded) {
26772650 SharedNodePointer avatarMixer = NodeList::getInstance()->soloNodeOfType(NodeType::AvatarMixer);
@@ -2684,7 +2657,7 @@ void Application::displayStats() { · 6 unmodified lines
26842657 }
26852658
26862659 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);
26882661 }
26892662
26902663 verticalOffset = 0;
@@ -2699,7 +2672,7 @@ void Application::displayStats() { · 8 unmodified lines
26992672 voxelStats.str("");
27002673 voxelStats << "Voxels Memory Nodes: " << VoxelTreeElement::getTotalMemoryUsage() / 1000000.f << "MB";
27012674 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);
27032676
27042677 voxelStats.str("");
27052678 voxelStats <<
@@ -2709,14 +2682,14 @@ void Application::displayStats() { · 3 unmodified lines
27092682 voxelStats << " / GPU: " << _voxels.getVoxelMemoryUsageGPU() / 1000000.f << "MB";
27102683 }
27112684 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);
27132686
27142687 // Voxel Rendering
27152688 voxelStats.str("");
27162689 voxelStats.precision(4);
27172690 voxelStats << "Voxel Rendering Slots Max: " << _voxels.getMaxVoxels() / 1000.f << "K";
27182691 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);
27202693 }
27212694
27222695 voxelStats.str("");
@@ -2724,7 +2697,7 @@ void Application::displayStats() { · 1 unmodified line
27242697 voxelStats << "Drawn: " << _voxels.getVoxelsWritten() / 1000.f << "K " <<
27252698 "Abandoned: " << _voxels.getAbandonedVoxels() / 1000.f << "K ";
27262699 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);
27282701
27292702 // iterate all the current voxel stats, and list their sending modes, and total voxel counts
27302703 std::stringstream sendingMode("");
@@ -2768,7 +2741,7 @@ void Application::displayStats() { · 37 unmodified lines
27682741 sendingMode << " <SCENE STABLE>";
27692742 }
27702743 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);
27722745 }
27732746
27742747 // Incoming packets
@@ -2780,7 +2753,7 @@ void Application::displayStats() { · 5 unmodified lines
27802753 voxelStats << "Voxel Packets to Process: " << packetsString.toLocal8Bit().constData()
27812754 << " [Recent Max: " << maxString.toLocal8Bit().constData() << "]";
27822755 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);
27842757 }
27852758
27862759 if (_resetRecentMaxPacketsSoon && voxelPacketsToProcess > 0) {
@@ -2803,7 +2776,7 @@ void Application::displayStats() { · 16 unmodified lines
28032776 voxelStats.str("");
28042777 voxelStats << "Server voxels: " << serversTotalString.toLocal8Bit().constData();
28052778 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);
28072780
28082781 if (_statsExpanded) {
28092782 QString serversInternalString = locale.toString((uint)totalInternal);
@@ -2814,7 +2787,7 @@ void Application::displayStats() { · 4 unmodified lines
28142787 "Internal: " << serversInternalString.toLocal8Bit().constData() << " " <<
28152788 "Leaves: " << serversLeavesString.toLocal8Bit().constData() << "";
28162789 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);
28182791 }
28192792
28202793 unsigned long localTotal = VoxelTreeElement::getNodeCount();
@@ -2824,7 +2797,7 @@ void Application::displayStats() { · 3 unmodified lines
28242797 voxelStats.str("");
28252798 voxelStats << "Local voxels: " << localTotalString.toLocal8Bit().constData();
28262799 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);
28282801
28292802 if (_statsExpanded) {
28302803 unsigned long localInternal = VoxelTreeElement::getInternalNodeCount();
@@ -2837,7 +2810,7 @@ void Application::displayStats() { · 6 unmodified lines
28372810 "Internal: " << localInternalString.toLocal8Bit().constData() << " " <<
28382811 "Leaves: " << localLeavesString.toLocal8Bit().constData() << "";
28392812 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);
28412814 }
28422815 }
28432816
@@ -2928,17 +2901,17 @@ glm::vec2 Application::getScaledScreenPoint(glm::vec2 projectedPoint) { · 84 unmodified lines
29282901 void Application::renderRearViewMirror(const QRect& region, bool billboard) {
29292902 bool eyeRelativeCamera = false;
29302903 if (billboard) {
2931− _mirrorCamera.setFieldOfView(BILLBOARD_FIELD_OF_VIEW);
2904+ _mirrorCamera.setFieldOfView(BILLBOARD_FIELD_OF_VIEW); // degees
29322905 _mirrorCamera.setDistance(BILLBOARD_DISTANCE * _myAvatar->getScale());
29332906 _mirrorCamera.setTargetPosition(_myAvatar->getPosition());
29342907
29352908 } else if (_rearMirrorTools->getZoomLevel() == BODY) {
2936− _mirrorCamera.setFieldOfView(MIRROR_FIELD_OF_VIEW);
2909+ _mirrorCamera.setFieldOfView(MIRROR_FIELD_OF_VIEW); // degrees
29372910 _mirrorCamera.setDistance(MIRROR_REARVIEW_BODY_DISTANCE * _myAvatar->getScale());
29382911 _mirrorCamera.setTargetPosition(_myAvatar->getChestPosition());
29392912
29402913 } else { // HEAD zoom level
2941− _mirrorCamera.setFieldOfView(MIRROR_FIELD_OF_VIEW);
2914+ _mirrorCamera.setFieldOfView(MIRROR_FIELD_OF_VIEW); // degrees
29422915 _mirrorCamera.setDistance(MIRROR_REARVIEW_DISTANCE * _myAvatar->getScale());
29432916 if (_myAvatar->getSkeletonModel().isActive() && _myAvatar->getHead()->getFaceModel().isActive()) {
29442917 // 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
29522925 }
29532926 _mirrorCamera.setAspectRatio((float)region.width() / region.height());
29542927
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)));
29562929 _mirrorCamera.update(1.0f/_fps);
29572930
29582931 // set the bounds of rear mirror view

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t