Open dystopm opened 4 weeks ago
@s1lentq @wopox1337
1) I have BIG doubts that the screen should rotate along the Z axis.
In game engines BEFORE GoldSrc and AFTER, the screen has a logical "forward" tilt on the **X** axis when falling.
Therefore, only the line that unreasonably rotates the Roll angle needs to be fixed.
2) Also, investigating all possible source code of other similar engines it was found that the value here should be 0.01 (1% of the fall velocity to apply the angle).
float flFallVel = player->m_Local.m_flFallVelocity;
if ( flFallVel > 16.0f && flFallVel <= PLAYER_FATAL_FALL_SPEED )
{
// punch view when we hit the ground
QAngle punchAngle = player->GetViewPunchAngle();
punchAngle.x = (flFallVel * 0.001);
if ( punchAngle.x < 0.75 )
punchAngle.x = 0.75;
player->SetViewPunchAngle( punchAngle );
}
//
// Knock the screen around a little bit, temporary effect.
//
player->m_Local.m_vecPunchAngle.Set( ROLL, player->m_Local.m_flFallVelocity * 0.013 );
if ( player->m_Local.m_vecPunchAngle[PITCH] > 8 )
{
player->m_Local.m_vecPunchAngle.Set( PITCH, 8 );
}
Q2 source code: https://github.com/id-Software/Quake-2/blob/372afde46e7defc9dd2d719a1732b8ace1fa096e/game/p_view.c#L560
https://upload.wikimedia.org/wikipedia/commons/8/85/Quake_-_family_tree_2.svg
some reflections https://hlfx.ru/forum/showthread.php?s=8f03de21bacaf9bf2192e8defd2b8d74&postid=123925
Actually it makes sense that roll changes, since it gives a feeling of imbalance. Changing pitch axis will provoke a little itch from client prediction, I suggest to only change the capping axis to Z instead of X and leave roll axis changing, what do you think?
https://github.com/s1lentq/ReGameDLL_CS/blob/f9969aceab95783a537902282d127d4c88daf5ae/regamedll/pm_shared/pm_shared.cpp#L2729-L2735
Should the boundary check the Z axis instead of the X axis?