mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 08:36:26 +02:00
Fix key mapping for new camera
This commit is contained in:
parent
ddbd30fac9
commit
78eee5961c
3 changed files with 31 additions and 3 deletions
|
@ -85,6 +85,15 @@
|
||||||
"when": ["Application.CameraThirdPerson", "!Keyboard.Shift"],
|
"when": ["Application.CameraThirdPerson", "!Keyboard.Shift"],
|
||||||
"to": "Actions.Yaw"
|
"to": "Actions.Yaw"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{ "from": { "makeAxis" : [
|
||||||
|
["Keyboard.Left"],
|
||||||
|
["Keyboard.Right"]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"when": ["Application.CameraLookAt", "!Keyboard.Shift"],
|
||||||
|
"to": "Actions.Yaw"
|
||||||
|
},
|
||||||
|
|
||||||
{ "from": { "makeAxis" : [
|
{ "from": { "makeAxis" : [
|
||||||
["Keyboard.A"],
|
["Keyboard.A"],
|
||||||
|
@ -104,6 +113,15 @@
|
||||||
"to": "Actions.Yaw"
|
"to": "Actions.Yaw"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{ "from": { "makeAxis" : [
|
||||||
|
["Keyboard.A"],
|
||||||
|
["Keyboard.D"]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"when": ["Application.CameraLookAt", "!Keyboard.Control"],
|
||||||
|
"to": "Actions.Yaw"
|
||||||
|
},
|
||||||
|
|
||||||
{ "from": { "makeAxis" : [
|
{ "from": { "makeAxis" : [
|
||||||
["Keyboard.TouchpadLeft"],
|
["Keyboard.TouchpadLeft"],
|
||||||
["Keyboard.TouchpadRight"]
|
["Keyboard.TouchpadRight"]
|
||||||
|
@ -122,6 +140,15 @@
|
||||||
"to": "Actions.Yaw"
|
"to": "Actions.Yaw"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{ "from": { "makeAxis" : [
|
||||||
|
["Keyboard.TouchpadLeft"],
|
||||||
|
["Keyboard.TouchpadRight"]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"when": "Application.CameraLookAt",
|
||||||
|
"to": "Actions.Yaw"
|
||||||
|
},
|
||||||
|
|
||||||
{ "from": { "makeAxis" : ["Keyboard.MouseMoveLeft", "Keyboard.MouseMoveRight"] },
|
{ "from": { "makeAxis" : ["Keyboard.MouseMoveLeft", "Keyboard.MouseMoveRight"] },
|
||||||
"when": "Keyboard.RightMouseButton",
|
"when": "Keyboard.RightMouseButton",
|
||||||
"to": "Actions.DeltaYaw",
|
"to": "Actions.DeltaYaw",
|
||||||
|
@ -148,8 +175,10 @@
|
||||||
{ "from": "Keyboard.Right", "when": "Keyboard.Shift", "to": "Actions.LATERAL_RIGHT" },
|
{ "from": "Keyboard.Right", "when": "Keyboard.Shift", "to": "Actions.LATERAL_RIGHT" },
|
||||||
{ "from": "Keyboard.Up", "when": "Application.CameraFirstPerson", "to": "Actions.LONGITUDINAL_FORWARD" },
|
{ "from": "Keyboard.Up", "when": "Application.CameraFirstPerson", "to": "Actions.LONGITUDINAL_FORWARD" },
|
||||||
{ "from": "Keyboard.Up", "when": "Application.CameraThirdPerson", "to": "Actions.LONGITUDINAL_FORWARD" },
|
{ "from": "Keyboard.Up", "when": "Application.CameraThirdPerson", "to": "Actions.LONGITUDINAL_FORWARD" },
|
||||||
|
{ "from": "Keyboard.Up", "when": "Application.CameraLookAt", "to": "Actions.LONGITUDINAL_FORWARD" },
|
||||||
{ "from": "Keyboard.Down", "when": "Application.CameraFirstPerson", "to": "Actions.LONGITUDINAL_BACKWARD" },
|
{ "from": "Keyboard.Down", "when": "Application.CameraFirstPerson", "to": "Actions.LONGITUDINAL_BACKWARD" },
|
||||||
{ "from": "Keyboard.Down", "when": "Application.CameraThirdPerson", "to": "Actions.LONGITUDINAL_BACKWARD" },
|
{ "from": "Keyboard.Down", "when": "Application.CameraThirdPerson", "to": "Actions.LONGITUDINAL_BACKWARD" },
|
||||||
|
{ "from": "Keyboard.Down", "when": "Application.CameraLookAt", "to": "Actions.LONGITUDINAL_BACKWARD" },
|
||||||
|
|
||||||
{ "from": "Keyboard.PgDown", "to": "Actions.VERTICAL_DOWN" },
|
{ "from": "Keyboard.PgDown", "to": "Actions.VERTICAL_DOWN" },
|
||||||
{ "from": "Keyboard.PgUp", "to": "Actions.VERTICAL_UP" },
|
{ "from": "Keyboard.PgUp", "to": "Actions.VERTICAL_UP" },
|
||||||
|
|
|
@ -1873,8 +1873,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
_applicationStateDevice->setInputVariant(STATE_CAMERA_THIRD_PERSON, []() -> float {
|
_applicationStateDevice->setInputVariant(STATE_CAMERA_THIRD_PERSON, []() -> float {
|
||||||
return qApp->getCamera().getMode() == CAMERA_MODE_THIRD_PERSON ? 1 : 0;
|
return qApp->getCamera().getMode() == CAMERA_MODE_THIRD_PERSON ? 1 : 0;
|
||||||
});
|
});
|
||||||
// Look at camera and third person camera use the same input mapping
|
_applicationStateDevice->setInputVariant(STATE_CAMERA_LOOK_AT, []() -> float {
|
||||||
_applicationStateDevice->setInputVariant(STATE_CAMERA_THIRD_PERSON, []() -> float {
|
|
||||||
return qApp->getCamera().getMode() == CAMERA_MODE_LOOK_AT ? 1 : 0;
|
return qApp->getCamera().getMode() == CAMERA_MODE_LOOK_AT ? 1 : 0;
|
||||||
});
|
});
|
||||||
_applicationStateDevice->setInputVariant(STATE_CAMERA_ENTITY, []() -> float {
|
_applicationStateDevice->setInputVariant(STATE_CAMERA_ENTITY, []() -> float {
|
||||||
|
|
|
@ -3505,7 +3505,7 @@ glm::vec3 MyAvatar::scaleMotorSpeed(const glm::vec3 forward, const glm::vec3 rig
|
||||||
} else {
|
} else {
|
||||||
// Desktop mode.
|
// Desktop mode.
|
||||||
if (qApp->getCamera().getMode() == CAMERA_MODE_LOOK_AT) {
|
if (qApp->getCamera().getMode() == CAMERA_MODE_LOOK_AT) {
|
||||||
direction = (zSpeed * forward);
|
direction = (zSpeed * forward) + (xSpeed * right);
|
||||||
} else {
|
} else {
|
||||||
direction = (zSpeed * forward) + (xSpeed * right);
|
direction = (zSpeed * forward) + (xSpeed * right);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue