Use ViewRoll instead of CamRoll, and removed CamRoll entirely. Begin work on interpolation.

This commit is contained in:
MajorCooke 2016-04-25 13:27:27 -05:00 committed by Christoph Oelckers
parent c972caa9f3
commit be9b25e760
5 changed files with 8 additions and 10 deletions

View File

@ -72,7 +72,7 @@ void DEarthquake::Serialize (FArchive &arc)
<< m_QuakeSFX << m_Flags << m_CountdownStart
<< m_WaveSpeed
<< m_Falloff << m_Highpoint << m_MiniCount
<< m_RollIntensity;
<< m_RollIntensity << m_RollWave;
}
//==========================================================================

View File

@ -238,7 +238,6 @@ void AActor::Serialize(FArchive &arc)
<< Angles.Yaw
<< Angles.Pitch
<< Angles.Roll
<< Angles.CamRoll
<< frame
<< Scale
<< RenderStyle
@ -4593,7 +4592,7 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags)
}
mobj->Angles.Yaw = SpawnAngle;
mobj->Angles.Pitch = mobj->Angles.Roll = mobj->Angles.CamRoll = 0.;
mobj->Angles.Pitch = mobj->Angles.Roll = 0.;
mobj->health = p->health;
// [RH] Set player sprite based on skin
@ -5075,7 +5074,7 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position)
if (mthing->pitch)
mobj->Angles.Pitch = (double)mthing->pitch;
if (mthing->roll)
mobj->Angles.Roll = mobj->Angles.CamRoll = (double)mthing->roll;
mobj->Angles.Roll = (double)mthing->roll;
if (mthing->score)
mobj->Score = mthing->score;
if (mthing->fillcolor)

View File

@ -108,6 +108,7 @@ int viewwindowy;
DVector3 ViewPos;
DAngle ViewAngle;
DAngle ViewPitch;
DAngle ViewRoll;
DVector3 ViewPath[2];
extern "C"
@ -542,11 +543,13 @@ void R_InterpolateView (player_t *player, double Frac, InterpolationViewer *ivie
ViewAngle = (nviewangle + AngleToFloat(LocalViewAngle & 0xFFFF0000)).Normalized180();
DAngle delta = player->centering ? DAngle(0.) : AngleToFloat(int(LocalViewPitch & 0xFFFF0000));
ViewPitch = clamp<DAngle>((iview->New.Angles.Pitch - delta).Normalized180(), player->MinPitch, player->MaxPitch);
ViewRoll = iview->New.Angles.Roll.Normalized180();
}
else
{
ViewPitch = (iview->Old.Angles.Pitch + deltaangle(iview->Old.Angles.Pitch, iview->New.Angles.Pitch) * Frac).Normalized180();
ViewAngle = (oviewangle + deltaangle(oviewangle, nviewangle) * Frac).Normalized180();
ViewRoll = iview->Old.Angles.Roll.Normalized180();
}
// Due to interpolation this is not necessarily the same as the sector the camera is in.
@ -871,7 +874,7 @@ void R_SetupFrame (AActor *actor)
if (jiggers.RollIntensity != 0 || jiggers.RollWave != 0)
{
camera->Angles.CamRoll = camera->Angles.Roll + QuakePower(quakefactor, jiggers.RollIntensity, jiggers.RollWave, jiggers.Falloff, jiggers.WFalloff);
ViewRoll += QuakePower(quakefactor, jiggers.RollIntensity, jiggers.RollWave, jiggers.Falloff, jiggers.WFalloff);
}
if (jiggers.RelIntensity.X != 0 || jiggers.RelOffset.X != 0)
{
@ -903,10 +906,6 @@ void R_SetupFrame (AActor *actor)
ViewPos.Z += QuakePower(quakefactor, jiggers.Intensity.Z, jiggers.Offset.Z, jiggers.Falloff, jiggers.WFalloff);
}
}
else
{
camera->Angles.CamRoll = camera->Angles.Roll;
}
}
extralight = camera->player ? camera->player->extralight : 0;

View File

@ -15,6 +15,7 @@ extern DCanvas *RenderTarget;
extern DVector3 ViewPos;
extern DAngle ViewAngle;
extern DAngle ViewPitch;
extern DAngle ViewRoll;
extern DVector3 ViewPath[2];
extern "C" int centerx, centerxwide;

View File

@ -2388,7 +2388,6 @@ static bool InitSpawnedItem(AActor *self, AActor *mo, int flags)
if (flags & SIXF_TRANSFERROLL)
{
mo->Angles.Roll = self->Angles.Roll;
mo->Angles.CamRoll = self->Angles.CamRoll;
}
if (flags & SIXF_ISTARGET)