diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 3cf3643dfb..51eccb2812 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -72,11 +72,6 @@ static char STAR_CACHE_FILE[] = "cachedStars.txt"; static const int BANDWIDTH_METER_CLICK_MAX_DRAG_LENGTH = 6; // farther dragged clicks are ignored -// Where one's own Avatar begins in the world (will be overwritten if avatar data file is found) -// this is basically in the center of the ground plane. Slightly adjusted. This was asked for by -// Grayson as he's building a street around here for demo dinner 2 -const glm::vec3 START_LOCATION(0.485f * TREE_SCALE, 0.f, 0.5f * TREE_SCALE); - const int IDLE_SIMULATE_MSECS = 16; // How often should call simulate and other stuff // in the idle loop? (60 FPS is default) static QTimer* idleTimer = NULL; @@ -3365,12 +3360,6 @@ void Application::eyedropperVoxelUnderCursor() { } } -void Application::goHome() { - qDebug("Going Home!\n"); - _myAvatar.setPosition(START_LOCATION); -} - - void Application::toggleFollowMode() { glm::vec3 mouseRayOrigin, mouseRayDirection; _viewFrustum.computePickRay(_pieMenu.getX() / (float)_glWidget->width(), diff --git a/interface/src/Application.h b/interface/src/Application.h index 5211ec7c07..a644558343 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -187,7 +187,6 @@ private slots: void renderCoverageMapsV2Recursively(CoverageMapV2* map); glm::vec2 getScaledScreenPoint(glm::vec2 projectedPoint); - void goHome(); void toggleFollowMode(); diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 6121045731..d5d2ebb646 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -110,7 +110,11 @@ Menu::Menu() : appInstance->getWebcam()->getGrabber(), SLOT(setDepthOnly(bool))); - addActionToQMenuAndActionHash(optionsMenu, MenuOption::GoHome, Qt::CTRL | Qt::Key_G, appInstance, SLOT(goHome())); + addActionToQMenuAndActionHash(optionsMenu, + MenuOption::GoHome, + Qt::CTRL | Qt::Key_G, + appInstance->getAvatar(), + SLOT(goHome())); QMenu* audioMenu = addMenu("Audio"); addCheckableActionToQMenuAndActionHash(audioMenu, MenuOption::EchoAudio); diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 714c789487..f466ea90d6 100755 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -1654,6 +1654,11 @@ void Avatar::renderJointConnectingCone(glm::vec3 position1, glm::vec3 position2, glEnd(); } +void Avatar::goHome() { + qDebug("Going Home!\n"); + setPosition(START_LOCATION); +} + void Avatar::setNewScale(const float scale) { _newScale = scale; } diff --git a/interface/src/avatar/Avatar.h b/interface/src/avatar/Avatar.h index 9c0dc35247..1a6d53dc1a 100755 --- a/interface/src/avatar/Avatar.h +++ b/interface/src/avatar/Avatar.h @@ -58,8 +58,7 @@ const float BODY_BALL_RADIUS_RIGHT_KNEE = 0.025; const float BODY_BALL_RADIUS_RIGHT_HEEL = 0.025; const float BODY_BALL_RADIUS_RIGHT_TOES = 0.025; -enum AvatarBodyBallID -{ +enum AvatarBodyBallID { BODY_BALL_NULL = -1, BODY_BALL_PELVIS, BODY_BALL_TORSO, @@ -91,8 +90,7 @@ enum AvatarBodyBallID NUM_AVATAR_BODY_BALLS }; -enum DriveKeys -{ +enum DriveKeys { FWD = 0, BACK, LEFT, @@ -104,16 +102,14 @@ enum DriveKeys MAX_DRIVE_KEYS }; -enum AvatarMode -{ +enum AvatarMode { AVATAR_MODE_STANDING = 0, AVATAR_MODE_WALKING, AVATAR_MODE_INTERACTING, NUM_AVATAR_MODES }; -enum ScreenTintLayer -{ +enum ScreenTintLayer { SCREEN_TINT_BEFORE_LANDSCAPE = 0, SCREEN_TINT_BEFORE_AVATARS, SCREEN_TINT_BEFORE_MY_AVATAR, @@ -121,6 +117,11 @@ enum ScreenTintLayer NUM_SCREEN_TINT_LAYERS }; +// Where one's own Avatar begins in the world (will be overwritten if avatar data file is found) +// this is basically in the center of the ground plane. Slightly adjusted. This was asked for by +// Grayson as he's building a street around here for demo dinner 2 +const glm::vec3 START_LOCATION(0.485f * TREE_SCALE, 0.f, 0.5f * TREE_SCALE); + class Avatar : public AvatarData { Q_OBJECT public: @@ -213,6 +214,7 @@ public: public slots: void setWantCollisionsOn(bool wantCollisionsOn) { _isCollisionsOn = wantCollisionsOn; } + void goHome(); private: // privatize copy constructor and assignment operator to avoid copying