History

Merge branch 'master' of https://github.com/worklist/hifi

Philip Rosedale committed 12 years ago

Commit fa3b1092 parents 246bb1f 4dea4b545 files · +2131 −646Browse files

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

Unified · Split

interface/src/Application.cpp+20−13
@@ -1985,6 +1985,9 @@ void Application::updateMouseRay() { · 1984 unmodified lines
19851985 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
19861986 PerformanceWarning warn(showWarnings, "Application::updateMouseRay()");
19871987
1988+ // make sure the frustum is up-to-date
1989+ loadViewFrustum(_myCamera, _viewFrustum);
1990+
19881991 // if the mouse pointer isn't visible, act like it's at the center of the screen
19891992 float x = 0.5f, y = 0.5f;
19901993 if (!_mouseHidden) {
@@ -2032,11 +2035,12 @@ void Application::updateVisage() { · 41 unmodified lines
20322035 _visage.update();
20332036 }
20342037
2035−void Application::updateMyAvatarLookAtPosition(glm::vec3& lookAtSpot) {
2038+void Application::updateMyAvatarLookAtPosition() {
20362039
20372040 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
20382041 PerformanceWarning warn(showWarnings, "Application::updateMyAvatarLookAtPosition()");
20392042
2043+ glm::vec3 lookAtSpot;
20402044 if (_myCamera.getMode() == CAMERA_MODE_MIRROR) {
20412045 lookAtSpot = _myCamera.getPosition();
20422046
@@ -2226,20 +2230,21 @@ void Application::updateMetavoxels(float deltaTime) { · 183 unmodified lines
22262230 }
22272231
22282232 void Application::cameraMenuChanged() {
2233+ float modeShiftPeriod = (_myCamera.getMode() == CAMERA_MODE_MIRROR) ? 0.0f : 1.0f;
22292234 if (Menu::getInstance()->isOptionChecked(MenuOption::FullscreenMirror)) {
22302235 if (_myCamera.getMode() != CAMERA_MODE_MIRROR) {
22312236 _myCamera.setMode(CAMERA_MODE_MIRROR);
2232− _myCamera.setModeShiftPeriod(0.00f);
2237+ _myCamera.setModeShiftPeriod(0.0f);
22332238 }
22342239 } else if (Menu::getInstance()->isOptionChecked(MenuOption::FirstPerson)) {
22352240 if (_myCamera.getMode() != CAMERA_MODE_FIRST_PERSON) {
22362241 _myCamera.setMode(CAMERA_MODE_FIRST_PERSON);
2237− _myCamera.setModeShiftPeriod(1.0f);
2242+ _myCamera.setModeShiftPeriod(modeShiftPeriod);
22382243 }
22392244 } else {
22402245 if (_myCamera.getMode() != CAMERA_MODE_THIRD_PERSON) {
22412246 _myCamera.setMode(CAMERA_MODE_THIRD_PERSON);
2242− _myCamera.setModeShiftPeriod(1.0f);
2247+ _myCamera.setModeShiftPeriod(modeShiftPeriod);
22432248 }
22442249 }
22452250 }
@@ -2317,13 +2322,10 @@ void Application::update(float deltaTime) { · 71 unmodified lines
23172322 // check what's under the mouse and update the mouse voxel
23182323 updateMouseRay();
23192324
2320− // Set where I am looking based on my mouse ray (so that other people can see)
2321− glm::vec3 lookAtSpot;
2322−
23232325 updateFaceshift();
23242326 updateVisage();
2325− _myAvatar->updateLookAtTargetAvatar(lookAtSpot);
2326− updateMyAvatarLookAtPosition(lookAtSpot);
2327+ _myAvatar->updateLookAtTargetAvatar();
2328+ updateMyAvatarLookAtPosition();
23272329
23282330 // Find the voxel we are hovering over, and respond if clicked
23292331 float distance;
@@ -2346,6 +2348,9 @@ void Application::update(float deltaTime) { · 16 unmodified lines
23462348
23472349 _particles.update(); // update the particles...
23482350 _particleCollisionSystem.update(); // collide the particles...
2351+
2352+ // let external parties know we're updating
2353+ emit simulating(deltaTime);
23492354 }
23502355
23512356 void Application::updateMyAvatar(float deltaTime) {
@@ -2899,8 +2904,8 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 547 unmodified lines
28992904 }
29002905 }
29012906
2902− bool renderMyHead = (whichCamera.getInterpolatedMode() != CAMERA_MODE_FIRST_PERSON);
2903− _avatarManager.renderAvatars(renderMyHead, selfAvatarOnly);
2907+ bool forceRenderMyHead = (whichCamera.getInterpolatedMode() == CAMERA_MODE_MIRROR);
2908+ _avatarManager.renderAvatars(forceRenderMyHead, selfAvatarOnly);
29042909
29052910 if (!selfAvatarOnly) {
29062911 // Render the world box
@@ -4202,7 +4207,9 @@ void Application::reloadAllScripts() { · 1295 unmodified lines
42024207 scriptAction->activate(QAction::Trigger);
42034208 qDebug() << "stopping script..." << scriptAction->text();
42044209 }
4205− _activeScripts.clear();
4210+
4211+ // NOTE: we don't need to clear the _activeScripts list because that is handled on script shutdown.
4212+
42064213 foreach (QString scriptName, reloadList){
42074214 qDebug() << "reloading script..." << scriptName;
42084215 loadScript(scriptName);
@@ -4210,7 +4217,7 @@ void Application::reloadAllScripts() { · 1 unmodified line
42104217 }
42114218
42124219 void Application::removeScriptName(const QString& fileNameString) {
4213− _activeScripts.removeOne(fileNameString);
4220+ _activeScripts.removeOne(fileNameString);
42144221 }
42154222
42164223 void Application::loadScript(const QString& fileNameString) {

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