Make sure first person mode and mirror mode are mutually exclusive.

This commit is contained in:
Andrzej Kapolka 2013-06-12 13:30:41 -07:00
parent 52c616b688
commit 178996bb8b
2 changed files with 9 additions and 6 deletions

View file

@ -144,7 +144,6 @@ Application::Application(int& argc, char** argv, timeval &startup_time) :
_viewFrustumOffsetDistance(25.0),
_viewFrustumOffsetUp(0.0),
_audioScope(256, 200, true),
_manualFirstPerson(false),
_mouseX(0),
_mouseY(0),
_mousePressed(false),
@ -908,6 +907,8 @@ void Application::setHead(bool head) {
if (head) {
_myCamera.setMode(CAMERA_MODE_MIRROR);
_myCamera.setModeShiftRate(100.0f);
_manualFirstPerson->setChecked(false);
} else {
_myCamera.setMode(CAMERA_MODE_THIRD_PERSON);
_myCamera.setModeShiftRate(1.0f);
@ -925,7 +926,9 @@ void Application::setFullscreen(bool fullscreen) {
}
void Application::setRenderFirstPerson(bool firstPerson) {
_manualFirstPerson = firstPerson;
if (firstPerson) {
_lookingInMirror->setChecked(false);
}
}
void Application::setFrustumOffset(bool frustumOffset) {
@ -1250,8 +1253,8 @@ void Application::initMenu() {
_renderFrameTimerOn->setChecked(false);
(_renderLookatOn = renderMenu->addAction("Lookat Vectors"))->setCheckable(true);
_renderLookatOn->setChecked(false);
renderMenu->addAction("First Person", this, SLOT(setRenderFirstPerson(bool)), Qt::Key_P)->setCheckable(true);
(_manualFirstPerson = renderMenu->addAction(
"First Person", this, SLOT(setRenderFirstPerson(bool)), Qt::Key_P))->setCheckable(true);
QMenu* toolsMenu = menuBar->addMenu("Tools");
(_renderStatsOn = toolsMenu->addAction("Stats"))->setCheckable(true);
@ -1572,7 +1575,7 @@ void Application::update(float deltaTime) {
}
} else {
if (_myCamera.getMode() != CAMERA_MODE_MIRROR && !OculusManager::isConnected()) {
if (_manualFirstPerson) {
if (_manualFirstPerson->isChecked()) {
if (_myCamera.getMode() != CAMERA_MODE_FIRST_PERSON ) {
_myCamera.setMode(CAMERA_MODE_FIRST_PERSON);
_myCamera.setModeShiftRate(1.0f);

View file

@ -186,6 +186,7 @@ private:
QAction* _renderStatsOn; // Whether to show onscreen text overlay with stats
QAction* _renderFrameTimerOn; // Whether to show onscreen text overlay with stats
QAction* _renderLookatOn; // Whether to show lookat vectors from avatar eyes if looking at something
QAction* _manualFirstPerson; // Whether to force first-person mode
QAction* _logOn; // Whether to show on-screen log
QActionGroup* _voxelModeActions; // The group of voxel edit mode actions
QAction* _addVoxelMode; // Whether add voxel mode is enabled
@ -249,7 +250,6 @@ private:
Environment _environment;
int _headMouseX, _headMouseY;
bool _manualFirstPerson;
float _headCameraPitchYawScale;
HandControl _handControl;