mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-12 13:37:01 +03:00
lovely UPV jitter workaround
This commit is contained in:
parent
58ec692255
commit
53a6ac7cb8
1 changed files with 44 additions and 3 deletions
|
@ -495,10 +495,30 @@ static void UserInput(ITEM_INFO* v, ITEM_INFO* l, SUB_INFO* sub)
|
|||
|
||||
if (sub->Flags & UPV_SURFACE)
|
||||
{
|
||||
if (v->pos.xRot > SURFACE_ANGLE)
|
||||
int xa = v->pos.xRot - SURFACE_ANGLE;
|
||||
int ax = SURFACE_ANGLE - v->pos.xRot;
|
||||
if (xa > 0)
|
||||
{
|
||||
if (xa > ANGLE(1))
|
||||
v->pos.xRot -= ANGLE(1.0f);
|
||||
else
|
||||
v->pos.xRot -= ANGLE(0.1f);
|
||||
}
|
||||
else if (ax)
|
||||
{
|
||||
if (ax > ANGLE(1))
|
||||
{
|
||||
v->pos.xRot += ANGLE(1.0f);
|
||||
}
|
||||
else
|
||||
v->pos.xRot += ANGLE(0.1f);
|
||||
}
|
||||
else
|
||||
v->pos.xRot = SURFACE_DIST;
|
||||
/* if (v->pos.xRot > SURFACE_ANGLE)
|
||||
v->pos.xRot -= ANGLE(0.1f);//ANGLE(1.0f); - causes jitters
|
||||
else if (v->pos.xRot < SURFACE_ANGLE)
|
||||
v->pos.xRot += ANGLE(0.1f);//ANGLE(1.0f); - x2
|
||||
v->pos.xRot += ANGLE(0.1f);//ANGLE(1.0f); - x2*/
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -535,10 +555,31 @@ static void UserInput(ITEM_INFO* v, ITEM_INFO* l, SUB_INFO* sub)
|
|||
|
||||
if (sub->Flags & UPV_SURFACE)
|
||||
{
|
||||
int xa = v->pos.xRot - SURFACE_ANGLE;
|
||||
int ax = SURFACE_ANGLE - v->pos.xRot;
|
||||
if (xa > 0)
|
||||
{
|
||||
if (xa > ANGLE(1))
|
||||
v->pos.xRot -= ANGLE(1.0f);
|
||||
else
|
||||
v->pos.xRot -= ANGLE(0.1f);
|
||||
}
|
||||
else if (ax)
|
||||
{
|
||||
if (ax > ANGLE(1))
|
||||
{
|
||||
v->pos.xRot += ANGLE(1.0f);
|
||||
}
|
||||
else
|
||||
v->pos.xRot += ANGLE(0.1f);
|
||||
}
|
||||
else
|
||||
v->pos.xRot = SURFACE_DIST;
|
||||
/*
|
||||
if (v->pos.xRot > SURFACE_ANGLE)
|
||||
v->pos.xRot -= ANGLE(0.1f);//ANGLE(1.0f); - causes jitters
|
||||
else if (v->pos.xRot < SURFACE_ANGLE)
|
||||
v->pos.xRot += ANGLE(0.1f);//ANGLE(1.0f); - x2
|
||||
v->pos.xRot += ANGLE(0.1f);//ANGLE(1.0f); - x2*/
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue