mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-13 20:42:11 +00:00
- Clamp applied mouse input to be within safe ranges to interpolate with.
* Input greater than 180 degrees in a single tic can cause the input to be applied backwards.
This commit is contained in:
parent
ff7e0afa6f
commit
817a0cb94a
1 changed files with 4 additions and 4 deletions
|
@ -160,10 +160,10 @@ void processMovement(InputPacket* const currInput, InputPacket* const inputBuffe
|
|||
currInput->svel += drink_amt & 1 ? -currInput->fvel : currInput->fvel;
|
||||
|
||||
// add collected input to game's local input accumulation packet.
|
||||
inputBuffer->fvel = clamp<float>(inputBuffer->fvel + currInput->fvel, -(float)keymove, (float)keymove);
|
||||
inputBuffer->svel = clamp<float>(inputBuffer->svel + currInput->svel, -(float)keymove, (float)keymove);
|
||||
inputBuffer->avel += currInput->avel;
|
||||
inputBuffer->horz += currInput->horz;
|
||||
inputBuffer->fvel = clamp(inputBuffer->fvel + currInput->fvel, -(float)keymove, (float)keymove);
|
||||
inputBuffer->svel = clamp(inputBuffer->svel + currInput->svel, -(float)keymove, (float)keymove);
|
||||
inputBuffer->avel = clamp(inputBuffer->avel + currInput->avel, -179.f, 179.f);
|
||||
inputBuffer->horz = clamp(inputBuffer->horz + currInput->horz, -179.f, 179.f);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue