- Convert gi->chaseCamPos() to return a floating point DVector3 object.

This commit is contained in:
Mitchell Richters 2022-09-06 18:36:03 +10:00 committed by Christoph Oelckers
parent 5685af33d8
commit 977d8f8109
6 changed files with 7 additions and 6 deletions

View file

@ -44,7 +44,8 @@ bool calcChaseCamPos(int* px, int* py, int* pz, DCoreActor* act, sectortype** ps
if (!*psect) return false;
// Calculate new pos to shoot backwards, using averaged values from the big three.
vec3_t np = gi->chaseCamPos(ang, horiz);
DVector3 npos = gi->chaseCamPos(ang, horiz);
vec3_t np = {int(npos.X * worldtoint), int(npos.Y * worldtoint), int(npos.Z * zworldtoint)};
auto bakcstat = act->spr.cstat;
act->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;

View file

@ -116,7 +116,7 @@ struct GameInterface
virtual void ToggleThirdPerson() { }
virtual void SwitchCoopView() { Printf("Unsupported command\n"); }
virtual void ToggleShowWeapon() { Printf("Unsupported command\n"); }
virtual vec3_t chaseCamPos(DAngle ang, fixedhoriz horiz) { return vec3_t(0,0,0); }
virtual DVector3 chaseCamPos(DAngle ang, fixedhoriz horiz) { return DVector3(0,0,0); }
virtual void processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, DAngle viewang, double smoothRatio) = 0;
virtual void UpdateCameras(double smoothratio) {}
virtual void EnterPortal(DCoreActor* viewer, int type) {}

View file

@ -142,7 +142,7 @@ struct GameInterface : public ::GameInterface
void ToggleThirdPerson() override;
void SwitchCoopView() override;
void ToggleShowWeapon() override;
vec3_t chaseCamPos(DAngle ang, fixedhoriz horiz) { return vec3_t(int(-ang.Cos() * 1280.), int(-ang.Sin() * 1280.), FixedToInt(MulScale(horiz.asq16(), 1280, 3)) - (16 << 8)); }
DVector3 chaseCamPos(DAngle ang, fixedhoriz horiz) { return DVector3(-ang.ToVector() * 80., horiz.asbuildf() * 0.625 - 16); }
void processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, DAngle viewang, double smoothRatio) override;
void EnterPortal(DCoreActor* viewer, int type) override;
void LeavePortal(DCoreActor* viewer, int type) override;

View file

@ -56,7 +56,7 @@ struct GameInterface : public ::GameInterface
void ToggleThirdPerson() override;
void SwitchCoopView() override;
void ToggleShowWeapon() override;
vec3_t chaseCamPos(DAngle ang, fixedhoriz horiz) { return vec3_t(int(-ang.Cos() * 1024.), int(-ang.Sin() * 1024.), horiz.asq16() >> 9); }
DVector3 chaseCamPos(DAngle ang, fixedhoriz horiz) { return DVector3(-ang.ToVector() * 64., horiz.asbuildf() * 0.5); }
void processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, DAngle viewang, double smoothRatio) override;
void UpdateCameras(double smoothratio) override;
void EnterPortal(DCoreActor* viewer, int type) override;

View file

@ -236,7 +236,7 @@ struct GameInterface : public ::GameInterface
int playerKeyMove() override { return 6; }
void WarpToCoords(double x, double y, double z, DAngle ang, int horz) override;
void ToggleThirdPerson() override;
vec3_t chaseCamPos(DAngle ang, fixedhoriz horiz) { return vec3_t(int(-ang.Cos() * 1536.), int(-ang.Sin() * 1536.), (horiz.asq16() * 3) >> 10); }
DVector3 chaseCamPos(DAngle ang, fixedhoriz horiz) { return DVector3(-ang.ToVector() * 96., horiz.asbuildf() * 0.75); }
void processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, DAngle viewang, double smoothRatio) override;
int GetCurrentSkill() override;
std::pair<DVector3, DAngle> GetCoordinates() override;

View file

@ -2028,7 +2028,7 @@ struct GameInterface : public ::GameInterface
void WarpToCoords(double x, double y, double z, DAngle ang, int horz) override;
void ToggleThirdPerson() override;
void SwitchCoopView() override;
vec3_t chaseCamPos(DAngle ang, fixedhoriz horiz) { return vec3_t(int(-ang.Cos() * 2048.), int(-ang.Sin() * 2048.), horiz.asq16() >> 8); }
DVector3 chaseCamPos(DAngle ang, fixedhoriz horiz) { return DVector3(-ang.ToVector() * 128., horiz.asbuildf()); }
void processSprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, DAngle viewang, double smoothRatio) override;
void UpdateCameras(double smoothratio) override;
void EnterPortal(DCoreActor* viewer, int type) override;