From 5c07638ce21fb998bb8f694f6000d86192b7eb17 Mon Sep 17 00:00:00 2001 From: atlante45 Date: Sat, 8 Jun 2013 02:05:54 +0200 Subject: [PATCH 1/2] 19369 - Added "Use Gravity" option --- interface/src/Application.cpp | 9 ++++++++- interface/src/Application.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index acb82412ca..07d98428c0 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -915,7 +915,12 @@ void Application::idle() { agentList->unlock(); // Simulate myself - _myAvatar.setGravity(_environment.getGravity(_myAvatar.getPosition())); + if (_gravityUse->isChecked()) { + _myAvatar.setGravity(_environment.getGravity(_myAvatar.getPosition())); + } + else { + _myAvatar.setGravity(glm::vec3(0.0f, 0.0f, 0.0f)); + } if (_transmitterDrives->isChecked() && _myTransmitter.isConnected()) { _myAvatar.simulate(deltaTime, &_myTransmitter); } else { @@ -1369,6 +1374,8 @@ void Application::initMenu() { _showHeadMouse->setChecked(false); (_transmitterDrives = optionsMenu->addAction("Transmitter Drive"))->setCheckable(true); _transmitterDrives->setChecked(true); + (_gravityUse = optionsMenu->addAction("Use Gravity"))->setCheckable(true); + _gravityUse->setChecked(true); (_fullScreenMode = optionsMenu->addAction("Fullscreen", this, SLOT(setFullscreen(bool)), Qt::Key_F))->setCheckable(true); diff --git a/interface/src/Application.h b/interface/src/Application.h index 3fe1e8e4b5..8b092c0218 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -176,6 +176,7 @@ private: QAction* _mouseLook; // Whether the have the mouse near edge of screen move your view QAction* _showHeadMouse; // Whether the have the mouse near edge of screen move your view QAction* _transmitterDrives; // Whether to have Transmitter data move/steer the Avatar + QAction* _gravityUse; // Whether gravity is on or not QAction* _renderVoxels; // Whether to render voxels QAction* _renderVoxelTextures; // Whether to render noise textures on voxels QAction* _renderStarsOn; // Whether to display the stars From b1aabc2c1fc3c4360542359d180b7fe931c259c6 Mon Sep 17 00:00:00 2001 From: atlante45 Date: Sun, 9 Jun 2013 23:02:45 +0200 Subject: [PATCH 2/2] Added shortcup for gravity use --- interface/src/Application.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 07d98428c0..d67475c322 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1376,6 +1376,7 @@ void Application::initMenu() { _transmitterDrives->setChecked(true); (_gravityUse = optionsMenu->addAction("Use Gravity"))->setCheckable(true); _gravityUse->setChecked(true); + _gravityUse->setShortcut(Qt::SHIFT | Qt::Key_G); (_fullScreenMode = optionsMenu->addAction("Fullscreen", this, SLOT(setFullscreen(bool)), Qt::Key_F))->setCheckable(true);