mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
physics: also block strafe input when movement is rooted
This commit is contained in:
parent
21604461fc
commit
dd6f6d1174
1 changed files with 5 additions and 4 deletions
|
|
@ -287,14 +287,15 @@ void CameraController::update(float deltaTime) {
|
||||||
// WoW-like third-person keyboard behavior:
|
// WoW-like third-person keyboard behavior:
|
||||||
// - RMB held: A/D strafe
|
// - RMB held: A/D strafe
|
||||||
// - RMB released: A/D turn character+camera, Q/E strafe
|
// - RMB released: A/D turn character+camera, Q/E strafe
|
||||||
|
// Turning is allowed even while rooted; only positional movement is blocked.
|
||||||
if (thirdPerson && !rightMouseDown) {
|
if (thirdPerson && !rightMouseDown) {
|
||||||
nowTurnLeft = keyA;
|
nowTurnLeft = keyA;
|
||||||
nowTurnRight = keyD;
|
nowTurnRight = keyD;
|
||||||
nowStrafeLeft = keyQ;
|
nowStrafeLeft = !movBlocked && keyQ;
|
||||||
nowStrafeRight = keyE;
|
nowStrafeRight = !movBlocked && keyE;
|
||||||
} else {
|
} else {
|
||||||
nowStrafeLeft = keyA || keyQ;
|
nowStrafeLeft = !movBlocked && (keyA || keyQ);
|
||||||
nowStrafeRight = keyD || keyE;
|
nowStrafeRight = !movBlocked && (keyD || keyE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keyboard turning updates camera yaw (character follows yaw in renderer)
|
// Keyboard turning updates camera yaw (character follows yaw in renderer)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue