Proper SCALEDNOLERP usage.

This commit is contained in:
Mari the Deer 2022-12-19 16:46:13 +01:00
commit 9ac0cb2a6f
3 changed files with 16 additions and 14 deletions

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r701 \cu(Sun 18 Dec 21:47:24 CET 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r701 \cu(2022-12-18 21:47:24)\c-";
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r702 \cu(Mon 19 Dec 16:46:13 CET 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r702 \cu(2022-12-19 16:46:13)\c-";

View file

@ -79,14 +79,17 @@ extend Class Demolitionist
player.viewz = ceilingz-4;
if ( player.viewz < floorz+4 )
player.viewz = floorz+4;
// add viewpos Y for side bob
// add viewpos Y for side bob (currently breaks SCALEDNOLERP)
SetViewPos((0.,bob.x*clamp(viewbob,0.,1.5),0.));
}
override void CheckPitch()
{
if ( bFly && !bFlyCheat && !(player.cheats&CF_NOCLIP2) )
return; // handled in moveplayer
{
if ( player.cmd.pitch == -32768 ) player.centering = true;
return; // the rest is handled in moveplayer
}
Super.CheckPitch();
}
@ -152,7 +155,7 @@ extend Class Demolitionist
if ( player.turnticks )
{
player.turnticks--;
angle += (180./TURN180_TICKS);
A_SetAngle(angle+(180./TURN180_TICKS),SPF_INTERPOLATE);
}
else guideangle += .2*player.cmd.yaw*(360./65536.);
guidepitch -= .2*player.cmd.pitch*(360./65536.);
@ -192,7 +195,6 @@ extend Class Demolitionist
}
else
{
player.cheats |= CF_SCALEDNOLERP; // smoother turning
if ( player.turnticks )
{
player.turnticks--;
@ -265,7 +267,7 @@ extend Class Demolitionist
vel *= fact;
player.vel *= fact;
}
if ( abs(roll) > 0. ) A_SetRoll(roll+clamp(deltaangle(roll,0),-3.,3.),SPF_INTERPOLATE);
if ( abs(roll) > 0. ) roll += clamp(deltaangle(roll,0),-3.,3.);
}
guideangle *= .9;
guidepitch *= .9;

View file

@ -426,26 +426,26 @@ extend Class Demolitionist
lagvel.z += bumpvelz*.2;
bumpvelz *= .8;
}
Vector3 temp = (ViewAngle,ViewPitch,ViewRoll);
if ( abs(bumpangle) > double.epsilon )
{
ViewAngle += bumpangle*.5;
temp.x += bumpangle*.5;
bumpangle *= .8;
}
if ( abs(bumppitch) > double.epsilon )
{
ViewPitch += bumppitch*.5;
temp.y += bumppitch*.5;
bumppitch *= .8;
}
if ( abs(bumproll) > double.epsilon )
{
ViewRoll += bumproll*.5;
temp.z += bumproll*.5;
bumproll *= .8;
}
// stabilize view angles
ViewAngle *= .8;
ViewPitch *= .8;
ViewRoll *= .8;
player.cheats |= CF_INTERPVIEWANGLES;
A_SetViewAngle(temp.x*.8,SPF_INTERPOLATE);
A_SetViewPitch(temp.y*.8,SPF_INTERPOLATE);
A_SetViewRoll(temp.z*.8,SPF_INTERPOLATE);
if ( player.onground && !lastground ) landvelz = lastvelz;
else if ( !player.onground && lastground ) landvelz = 0;
else if ( player.onground && lastground ) landvelz *= .9;