- added support for angle changing portals to P_AimCamera.

This commit is contained in:
Christoph Oelckers 2016-04-16 22:54:47 +02:00
parent e7c0fd26ba
commit 7ac0cfbbb9
3 changed files with 6 additions and 3 deletions

View file

@ -335,7 +335,7 @@ bool P_CheckMissileSpawn(AActor *missile, double maxdist);
void P_PlaySpawnSound(AActor *missile, AActor *spawner); void P_PlaySpawnSound(AActor *missile, AActor *spawner);
// [RH] Position the chasecam // [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 // [RH] Means of death
enum enum

View file

@ -4714,7 +4714,7 @@ void P_RailAttack(FRailParams *p)
CVAR(Float, chase_height, -8.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Float, chase_height, -8.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
CVAR(Float, chase_dist, 90.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<double>(chase_dist, 0, 30000); double distance = clamp<double>(chase_dist, 0, 30000);
DAngle angle = t1->Angles.Yaw - 180; 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; CameraSector = trace.Sector;
unlinked = trace.unlinked; unlinked = trace.unlinked;
camangle = trace.SrcAngleFromTarget - 180.;
} }

View file

@ -937,8 +937,10 @@ void R_SetupFrame (AActor *actor)
sector_t *oldsector = R_PointInSubsector(iview->Old.Pos)->sector; sector_t *oldsector = R_PointInSubsector(iview->Old.Pos)->sector;
// [RH] Use chasecam view // [RH] Use chasecam view
DVector3 campos; 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.Pos = campos;
iview->New.Angles.Yaw = camangle;
r_showviewer = true; 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 // 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. // it's probably best to just reset the interpolation for this move.