diff options
Diffstat (limited to 'linden/indra/newview/llviewerjoystick.cpp')
-rw-r--r-- | linden/indra/newview/llviewerjoystick.cpp | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/linden/indra/newview/llviewerjoystick.cpp b/linden/indra/newview/llviewerjoystick.cpp index cf9d8a1..2e57843 100644 --- a/linden/indra/newview/llviewerjoystick.cpp +++ b/linden/indra/newview/llviewerjoystick.cpp | |||
@@ -99,6 +99,11 @@ void LLViewerJoystick::setOverrideCamera(bool val) | |||
99 | { | 99 | { |
100 | mOverrideCamera = val; | 100 | mOverrideCamera = val; |
101 | } | 101 | } |
102 | |||
103 | if (mOverrideCamera) | ||
104 | { | ||
105 | gAgent.changeCameraToDefault(); | ||
106 | } | ||
102 | } | 107 | } |
103 | 108 | ||
104 | // ----------------------------------------------------------------------------- | 109 | // ----------------------------------------------------------------------------- |
@@ -793,14 +798,6 @@ void LLViewerJoystick::moveFlycam(bool reset) | |||
793 | { | 798 | { |
794 | cur_delta[i] = -getJoystickAxis(axis[i]); | 799 | cur_delta[i] = -getJoystickAxis(axis[i]); |
795 | 800 | ||
796 | // we need smaller camera movements in build mode | ||
797 | if (in_build_mode) | ||
798 | { | ||
799 | if (i == X_I || i == Y_I || i == Z_I) | ||
800 | { | ||
801 | cur_delta[i] /= BUILDMODE_FLYCAM_T_SCALE; | ||
802 | } | ||
803 | } | ||
804 | 801 | ||
805 | F32 tmp = cur_delta[i]; | 802 | F32 tmp = cur_delta[i]; |
806 | if (absolute) | 803 | if (absolute) |
@@ -817,6 +814,18 @@ void LLViewerJoystick::moveFlycam(bool reset) | |||
817 | { | 814 | { |
818 | cur_delta[i] = llmin(cur_delta[i]+dead_zone[i], 0.f); | 815 | cur_delta[i] = llmin(cur_delta[i]+dead_zone[i], 0.f); |
819 | } | 816 | } |
817 | |||
818 | // we need smaller camera movements in build mode | ||
819 | // NOTE: this needs to remain after the deadzone calculation, otherwise | ||
820 | // we have issues with flycam "jumping" when the build dialog is opened/closed -Nyx | ||
821 | if (in_build_mode) | ||
822 | { | ||
823 | if (i == X_I || i == Y_I || i == Z_I) | ||
824 | { | ||
825 | cur_delta[i] /= BUILDMODE_FLYCAM_T_SCALE; | ||
826 | } | ||
827 | } | ||
828 | |||
820 | cur_delta[i] *= axis_scale[i]; | 829 | cur_delta[i] *= axis_scale[i]; |
821 | 830 | ||
822 | if (!absolute) | 831 | if (!absolute) |
@@ -875,10 +884,16 @@ bool LLViewerJoystick::toggleFlycam() | |||
875 | { | 884 | { |
876 | return false; | 885 | return false; |
877 | } | 886 | } |
887 | if (!mOverrideCamera) | ||
888 | { | ||
889 | gAgent.changeCameraToDefault(); | ||
890 | } | ||
891 | |||
878 | mOverrideCamera = !mOverrideCamera; | 892 | mOverrideCamera = !mOverrideCamera; |
879 | if (mOverrideCamera) | 893 | if (mOverrideCamera) |
880 | { | 894 | { |
881 | moveFlycam(true); | 895 | moveFlycam(true); |
896 | |||
882 | } | 897 | } |
883 | else if (!LLToolMgr::getInstance()->inBuildMode()) | 898 | else if (!LLToolMgr::getInstance()->inBuildMode()) |
884 | { | 899 | { |