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
1985 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);1985 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
1986 PerformanceWarning warn(showWarnings, "Application::updateMouseRay()");1986 PerformanceWarning warn(showWarnings, "Application::updateMouseRay()");
1987 1987
1988 // make sure the frustum is up-to-date
1989 loadViewFrustum(_myCamera, _viewFrustum);
1990
1988 // if the mouse pointer isn't visible, act like it's at the center of the screen1991 // if the mouse pointer isn't visible, act like it's at the center of the screen
1989 float x = 0.5f, y = 0.5f;1992 float x = 0.5f, y = 0.5f;
1990 if (!_mouseHidden) {1993 if (!_mouseHidden) {
@@ -2032,11 +2035,12 @@ void Application::updateVisage() { · 41 unmodified lines
2032 _visage.update();2035 _visage.update();
2033}2036}
2034 2037
2035void Application::updateMyAvatarLookAtPosition(glm::vec3& lookAtSpot) {2038void Application::updateMyAvatarLookAtPosition() {
2036 2039
2037 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);2040 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
2038 PerformanceWarning warn(showWarnings, "Application::updateMyAvatarLookAtPosition()");2041 PerformanceWarning warn(showWarnings, "Application::updateMyAvatarLookAtPosition()");
2039 2042
2043 glm::vec3 lookAtSpot;
2040 if (_myCamera.getMode() == CAMERA_MODE_MIRROR) {2044 if (_myCamera.getMode() == CAMERA_MODE_MIRROR) {
2041 lookAtSpot = _myCamera.getPosition();2045 lookAtSpot = _myCamera.getPosition();
2042 2046
@@ -2226,20 +2230,21 @@ void Application::updateMetavoxels(float deltaTime) { · 183 unmodified lines
2226}2230}
2227 2231
2228void Application::cameraMenuChanged() {2232void Application::cameraMenuChanged() {
2233 float modeShiftPeriod = (_myCamera.getMode() == CAMERA_MODE_MIRROR) ? 0.0f : 1.0f;
2229 if (Menu::getInstance()->isOptionChecked(MenuOption::FullscreenMirror)) {2234 if (Menu::getInstance()->isOptionChecked(MenuOption::FullscreenMirror)) {
2230 if (_myCamera.getMode() != CAMERA_MODE_MIRROR) {2235 if (_myCamera.getMode() != CAMERA_MODE_MIRROR) {
2231 _myCamera.setMode(CAMERA_MODE_MIRROR);2236 _myCamera.setMode(CAMERA_MODE_MIRROR);
2232 _myCamera.setModeShiftPeriod(0.00f);2237 _myCamera.setModeShiftPeriod(0.0f);
2233 }2238 }
2234 } else if (Menu::getInstance()->isOptionChecked(MenuOption::FirstPerson)) {2239 } else if (Menu::getInstance()->isOptionChecked(MenuOption::FirstPerson)) {
2235 if (_myCamera.getMode() != CAMERA_MODE_FIRST_PERSON) {2240 if (_myCamera.getMode() != CAMERA_MODE_FIRST_PERSON) {
2236 _myCamera.setMode(CAMERA_MODE_FIRST_PERSON);2241 _myCamera.setMode(CAMERA_MODE_FIRST_PERSON);
2237 _myCamera.setModeShiftPeriod(1.0f);2242 _myCamera.setModeShiftPeriod(modeShiftPeriod);
2238 }2243 }
2239 } else {2244 } else {
2240 if (_myCamera.getMode() != CAMERA_MODE_THIRD_PERSON) {2245 if (_myCamera.getMode() != CAMERA_MODE_THIRD_PERSON) {
2241 _myCamera.setMode(CAMERA_MODE_THIRD_PERSON);2246 _myCamera.setMode(CAMERA_MODE_THIRD_PERSON);
2242 _myCamera.setModeShiftPeriod(1.0f);2247 _myCamera.setModeShiftPeriod(modeShiftPeriod);
2243 }2248 }
2244 }2249 }
2245}2250}
@@ -2317,13 +2322,10 @@ void Application::update(float deltaTime) { · 71 unmodified lines
2317 // check what's under the mouse and update the mouse voxel2322 // check what's under the mouse and update the mouse voxel
2318 updateMouseRay();2323 updateMouseRay();
2319 2324
2320 // Set where I am looking based on my mouse ray (so that other people can see)
2321 glm::vec3 lookAtSpot;
2322
2323 updateFaceshift();2325 updateFaceshift();
2324 updateVisage();2326 updateVisage();
2325 _myAvatar->updateLookAtTargetAvatar(lookAtSpot);2327 _myAvatar->updateLookAtTargetAvatar();
2326 updateMyAvatarLookAtPosition(lookAtSpot);2328 updateMyAvatarLookAtPosition();
2327 2329
2328 // Find the voxel we are hovering over, and respond if clicked2330 // Find the voxel we are hovering over, and respond if clicked
2329 float distance;2331 float distance;
@@ -2346,6 +2348,9 @@ void Application::update(float deltaTime) { · 16 unmodified lines
2346 2348
2347 _particles.update(); // update the particles...2349 _particles.update(); // update the particles...
2348 _particleCollisionSystem.update(); // collide the particles...2350 _particleCollisionSystem.update(); // collide the particles...
2351
2352 // let external parties know we're updating
2353 emit simulating(deltaTime);
2349}2354}
2350 2355
2351void Application::updateMyAvatar(float deltaTime) {2356void Application::updateMyAvatar(float deltaTime) {
@@ -2899,8 +2904,8 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { · 547 unmodified lines
2899 }2904 }
2900 }2905 }
2901 2906
2902 bool renderMyHead = (whichCamera.getInterpolatedMode() != CAMERA_MODE_FIRST_PERSON);2907 bool forceRenderMyHead = (whichCamera.getInterpolatedMode() == CAMERA_MODE_MIRROR);
2903 _avatarManager.renderAvatars(renderMyHead, selfAvatarOnly);2908 _avatarManager.renderAvatars(forceRenderMyHead, selfAvatarOnly);
2904 2909
2905 if (!selfAvatarOnly) {2910 if (!selfAvatarOnly) {
2906 // Render the world box2911 // Render the world box
@@ -4202,7 +4207,9 @@ void Application::reloadAllScripts() { · 1295 unmodified lines
4202 scriptAction->activate(QAction::Trigger);4207 scriptAction->activate(QAction::Trigger);
4203 qDebug() << "stopping script..." << scriptAction->text();4208 qDebug() << "stopping script..." << scriptAction->text();
4204 }4209 }
4205 _activeScripts.clear();4210
4211 // NOTE: we don't need to clear the _activeScripts list because that is handled on script shutdown.
4212
4206 foreach (QString scriptName, reloadList){4213 foreach (QString scriptName, reloadList){
4207 qDebug() << "reloading script..." << scriptName;4214 qDebug() << "reloading script..." << scriptName;
4208 loadScript(scriptName);4215 loadScript(scriptName);
@@ -4210,7 +4217,7 @@ void Application::reloadAllScripts() { · 1 unmodified line
4210}4217}
4211 4218
4212void Application::removeScriptName(const QString& fileNameString) {4219void Application::removeScriptName(const QString& fileNameString) {
4213 _activeScripts.removeOne(fileNameString);4220 _activeScripts.removeOne(fileNameString);
4214}4221}
4215 4222
4216void Application::loadScript(const QString& fileNameString) {4223void 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