mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2025-02-15 08:40:40 +00:00
Merge pull request #29 from lvonasek/feature_vignette_yaw_noisefilter
Add noise filter for yaw delta values when drawing vignette
This commit is contained in:
commit
83bd49f800
1 changed files with 8 additions and 2 deletions
|
@ -2592,6 +2592,7 @@ CG_DrawVignette
|
|||
==============
|
||||
*/
|
||||
float currentComfortVignetteValue = 0.0f;
|
||||
float filteredViewYawDelta = 0.0f;
|
||||
|
||||
static void CG_DrawVignette( void )
|
||||
{
|
||||
|
@ -2602,8 +2603,13 @@ static void CG_DrawVignette( void )
|
|||
return;
|
||||
}
|
||||
|
||||
const float yawDelta = fabsf(vr->clientview_yaw_delta);
|
||||
if (VectorLength(cg.predictedPlayerState.velocity) > 30.0 || (yawDelta > 1 && yawDelta < 20) || (yawDelta > 340))
|
||||
float yawDelta = fabsf(vr->clientview_yaw_delta);
|
||||
if (yawDelta > 180)
|
||||
{
|
||||
yawDelta = fabs(yawDelta - 360);
|
||||
}
|
||||
filteredViewYawDelta = filteredViewYawDelta * 0.75f + yawDelta * 0.25f;
|
||||
if (VectorLength(cg.predictedPlayerState.velocity) > 30.0 || (filteredViewYawDelta > 1))
|
||||
{
|
||||
if (currentComfortVignetteValue < comfortVignetteValue)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue