selimnahimi / sbox-gandsrc

A WIP GoldSrc Foundation for s&box
3 stars 0 forks source link

GoldSrc screenshake is too quick #13

Open selimnahimi opened 1 year ago

selimnahimi commented 1 year ago
VerticalRotationAmount *= invdelta;
HorizontalRotationAmount *= invdelta;

doesn't do the same thing as

Rotation *= Rotation.FromAxis( Vector3.Right, VerticalRotationAmount * invdelta );
Rotation *= Rotation.FromAxis( Vector3.Up, HorizontalRotationAmount * invdelta );
selimnahimi commented 1 year ago

VerticalRotationAmount *= invdelta; changes the VerticalRotation value, while the second examples don't change the initial value itself, but rather transform it in a way so it seems as if it's decreasing towards zero in a linear fashion. Changing the initial value makes it decrease in a more exponential fashion, which is not the needed result.

This is problematic, because this way adding values to VerticalRotation won't produce the wanted effect. There needs to be a way so shooting multiple times could stack the screenshake.

selimnahimi commented 1 year ago

Reverted to the version where shakes can't be added on top of each other. Will fix in the future