diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 110e81828f..1061bc16c1 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1211,6 +1211,9 @@ 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); + _gravityUse->setShortcut(Qt::SHIFT | Qt::Key_G); (_fullScreenMode = optionsMenu->addAction("Fullscreen", this, SLOT(setFullscreen(bool)), Qt::Key_F))->setCheckable(true); @@ -1535,7 +1538,13 @@ void Application::update(float deltaTime) { 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 { diff --git a/interface/src/Application.h b/interface/src/Application.h index f5180f5f28..dd6a058823 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