mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 14:37:46 +02:00
fix LX behaviour in snap/advanced/basic
This commit is contained in:
parent
0926b2df2a
commit
1fe02477b0
4 changed files with 24 additions and 5 deletions
|
@ -4,7 +4,10 @@
|
||||||
{ "from": "Standard.LY", "to": "Actions.TranslateZ" },
|
{ "from": "Standard.LY", "to": "Actions.TranslateZ" },
|
||||||
|
|
||||||
{ "from": "Standard.LX",
|
{ "from": "Standard.LX",
|
||||||
"when": [ "Application.InHMD", "Application.SnapTurn" ],
|
"when": [
|
||||||
|
"Application.InHMD", "!Application.AdvancedMovement",
|
||||||
|
"Application.SnapTurn", "!Standard.RX"
|
||||||
|
],
|
||||||
"to": "Actions.StepYaw",
|
"to": "Actions.StepYaw",
|
||||||
"filters":
|
"filters":
|
||||||
[
|
[
|
||||||
|
@ -14,7 +17,12 @@
|
||||||
{ "type": "scale", "scale": 22.5 }
|
{ "type": "scale", "scale": 22.5 }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{ "from": "Standard.LX", "to": "Actions.TranslateX" },
|
{ "from": "Standard.LX", "to": "Actions.TranslateX",
|
||||||
|
"when": [ "Application.AdvancedMovement" ]
|
||||||
|
},
|
||||||
|
{ "from": "Standard.LX", "to": "Actions.Yaw",
|
||||||
|
"when": [ "!Application.AdvancedMovement", "!Application.SnapTurn" ]
|
||||||
|
},
|
||||||
|
|
||||||
{ "from": "Standard.RX",
|
{ "from": "Standard.RX",
|
||||||
"when": [ "Application.InHMD", "Application.SnapTurn" ],
|
"when": [ "Application.InHMD", "Application.SnapTurn" ],
|
||||||
|
@ -27,8 +35,10 @@
|
||||||
{ "type": "scale", "scale": 22.5 }
|
{ "type": "scale", "scale": 22.5 }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{ "from": "Standard.RX", "to": "Actions.Yaw" },
|
{ "from": "Standard.RX", "to": "Actions.Yaw",
|
||||||
|
"when": [ "!Application.SnapTurn" ]
|
||||||
|
},
|
||||||
|
|
||||||
{ "from": "Standard.RY",
|
{ "from": "Standard.RY",
|
||||||
"when": "Application.Grounded",
|
"when": "Application.Grounded",
|
||||||
"to": "Actions.Up",
|
"to": "Actions.Up",
|
||||||
|
|
|
@ -423,6 +423,7 @@ static const QString STATE_CAMERA_THIRD_PERSON = "CameraThirdPerson";
|
||||||
static const QString STATE_CAMERA_ENTITY = "CameraEntity";
|
static const QString STATE_CAMERA_ENTITY = "CameraEntity";
|
||||||
static const QString STATE_CAMERA_INDEPENDENT = "CameraIndependent";
|
static const QString STATE_CAMERA_INDEPENDENT = "CameraIndependent";
|
||||||
static const QString STATE_SNAP_TURN = "SnapTurn";
|
static const QString STATE_SNAP_TURN = "SnapTurn";
|
||||||
|
static const QString STATE_ADVANCED_MOVEMENT_CONTROLS = "AdvancedMovement";
|
||||||
static const QString STATE_GROUNDED = "Grounded";
|
static const QString STATE_GROUNDED = "Grounded";
|
||||||
static const QString STATE_NAV_FOCUSED = "NavigationFocused";
|
static const QString STATE_NAV_FOCUSED = "NavigationFocused";
|
||||||
|
|
||||||
|
@ -513,7 +514,7 @@ bool setupEssentials(int& argc, char** argv) {
|
||||||
DependencyManager::set<MessagesClient>();
|
DependencyManager::set<MessagesClient>();
|
||||||
controller::StateController::setStateVariables({ { STATE_IN_HMD, STATE_CAMERA_FULL_SCREEN_MIRROR,
|
controller::StateController::setStateVariables({ { STATE_IN_HMD, STATE_CAMERA_FULL_SCREEN_MIRROR,
|
||||||
STATE_CAMERA_FIRST_PERSON, STATE_CAMERA_THIRD_PERSON, STATE_CAMERA_ENTITY, STATE_CAMERA_INDEPENDENT,
|
STATE_CAMERA_FIRST_PERSON, STATE_CAMERA_THIRD_PERSON, STATE_CAMERA_ENTITY, STATE_CAMERA_INDEPENDENT,
|
||||||
STATE_SNAP_TURN, STATE_GROUNDED, STATE_NAV_FOCUSED } });
|
STATE_SNAP_TURN, STATE_ADVANCED_MOVEMENT_CONTROLS, STATE_GROUNDED, STATE_NAV_FOCUSED } });
|
||||||
DependencyManager::set<UserInputMapper>();
|
DependencyManager::set<UserInputMapper>();
|
||||||
DependencyManager::set<controller::ScriptingInterface, ControllerScriptingInterface>();
|
DependencyManager::set<controller::ScriptingInterface, ControllerScriptingInterface>();
|
||||||
DependencyManager::set<InterfaceParentFinder>();
|
DependencyManager::set<InterfaceParentFinder>();
|
||||||
|
@ -1127,6 +1128,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
_applicationStateDevice->setInputVariant(STATE_SNAP_TURN, []() -> float {
|
_applicationStateDevice->setInputVariant(STATE_SNAP_TURN, []() -> float {
|
||||||
return qApp->getMyAvatar()->getSnapTurn() ? 1 : 0;
|
return qApp->getMyAvatar()->getSnapTurn() ? 1 : 0;
|
||||||
});
|
});
|
||||||
|
_applicationStateDevice->setInputVariant(STATE_ADVANCED_MOVEMENT_CONTROLS, []() -> float {
|
||||||
|
return qApp->getMyAvatar()->useAdvancedMovementControls() ? 1 : 0;
|
||||||
|
});
|
||||||
|
|
||||||
_applicationStateDevice->setInputVariant(STATE_GROUNDED, []() -> float {
|
_applicationStateDevice->setInputVariant(STATE_GROUNDED, []() -> float {
|
||||||
return qApp->getMyAvatar()->getCharacterController()->onGround() ? 1 : 0;
|
return qApp->getMyAvatar()->getCharacterController()->onGround() ? 1 : 0;
|
||||||
});
|
});
|
||||||
|
|
|
@ -104,6 +104,7 @@ MyAvatar::MyAvatar(RigPointer rig) :
|
||||||
_eyeContactTarget(LEFT_EYE),
|
_eyeContactTarget(LEFT_EYE),
|
||||||
_realWorldFieldOfView("realWorldFieldOfView",
|
_realWorldFieldOfView("realWorldFieldOfView",
|
||||||
DEFAULT_REAL_WORLD_FIELD_OF_VIEW_DEGREES),
|
DEFAULT_REAL_WORLD_FIELD_OF_VIEW_DEGREES),
|
||||||
|
_useAdvancedMovementControls("advancedMovementForHandControllersIsChecked", false),
|
||||||
_hmdSensorMatrix(),
|
_hmdSensorMatrix(),
|
||||||
_hmdSensorOrientation(),
|
_hmdSensorOrientation(),
|
||||||
_hmdSensorPosition(),
|
_hmdSensorPosition(),
|
||||||
|
|
|
@ -171,6 +171,8 @@ public:
|
||||||
Q_INVOKABLE void setHMDLeanRecenterEnabled(bool value) { _hmdLeanRecenterEnabled = value; }
|
Q_INVOKABLE void setHMDLeanRecenterEnabled(bool value) { _hmdLeanRecenterEnabled = value; }
|
||||||
Q_INVOKABLE bool getHMDLeanRecenterEnabled() const { return _hmdLeanRecenterEnabled; }
|
Q_INVOKABLE bool getHMDLeanRecenterEnabled() const { return _hmdLeanRecenterEnabled; }
|
||||||
|
|
||||||
|
bool useAdvancedMovementControls() const { return _useAdvancedMovementControls.get(); }
|
||||||
|
|
||||||
// get/set avatar data
|
// get/set avatar data
|
||||||
void saveData();
|
void saveData();
|
||||||
void loadData();
|
void loadData();
|
||||||
|
@ -423,6 +425,7 @@ private:
|
||||||
glm::vec3 _trackedHeadPosition;
|
glm::vec3 _trackedHeadPosition;
|
||||||
|
|
||||||
Setting::Handle<float> _realWorldFieldOfView;
|
Setting::Handle<float> _realWorldFieldOfView;
|
||||||
|
Setting::Handle<bool> _useAdvancedMovementControls;
|
||||||
|
|
||||||
// private methods
|
// private methods
|
||||||
void updateOrientation(float deltaTime);
|
void updateOrientation(float deltaTime);
|
||||||
|
|
Loading…
Reference in a new issue