diff --git a/src/p_local.h b/src/p_local.h index 45b02e8ea..a5336a9ee 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -335,7 +335,7 @@ bool P_CheckMissileSpawn(AActor *missile, double maxdist); void P_PlaySpawnSound(AActor *missile, AActor *spawner); // [RH] Position the chasecam -void P_AimCamera (AActor *t1, DVector3 &, sector_t *&sec, bool &unlinked); +void P_AimCamera (AActor *t1, DVector3 &, DAngle &, sector_t *&sec, bool &unlinked); // [RH] Means of death enum diff --git a/src/p_map.cpp b/src/p_map.cpp index c28d3044f..8254ac5bb 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -4714,7 +4714,7 @@ void P_RailAttack(FRailParams *p) CVAR(Float, chase_height, -8.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Float, chase_dist, 90.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) -void P_AimCamera(AActor *t1, DVector3 &campos, sector_t *&CameraSector, bool &unlinked) +void P_AimCamera(AActor *t1, DVector3 &campos, DAngle &camangle, sector_t *&CameraSector, bool &unlinked) { double distance = clamp(chase_dist, 0, 30000); DAngle angle = t1->Angles.Yaw - 180; @@ -4740,6 +4740,7 @@ void P_AimCamera(AActor *t1, DVector3 &campos, sector_t *&CameraSector, bool &un } CameraSector = trace.Sector; unlinked = trace.unlinked; + camangle = trace.SrcAngleFromTarget - 180.; } diff --git a/src/r_utility.cpp b/src/r_utility.cpp index f2908c6fa..0977505fd 100644 --- a/src/r_utility.cpp +++ b/src/r_utility.cpp @@ -937,8 +937,10 @@ void R_SetupFrame (AActor *actor) sector_t *oldsector = R_PointInSubsector(iview->Old.Pos)->sector; // [RH] Use chasecam view DVector3 campos; - P_AimCamera (camera, campos, viewsector, unlinked); // fixme: This needs to translate the angle, too. + DAngle camangle; + P_AimCamera (camera, campos, camangle, viewsector, unlinked); // fixme: This needs to translate the angle, too. iview->New.Pos = campos; + iview->New.Angles.Yaw = camangle; r_showviewer = true; // Interpolating this is a very complicated thing because nothing keeps track of the aim camera's movement, so whenever we detect a portal transition // it's probably best to just reset the interpolation for this move.