- Floatify chase cam code, providing an inline interface for legacy setup.

This commit is contained in:
Mitchell Richters 2022-09-06 21:06:35 +10:00 committed by Christoph Oelckers
parent 977d8f8109
commit 056bb9b0cd
2 changed files with 45 additions and 48 deletions

View file

@ -252,11 +252,21 @@ inline constexpr int getincangle(unsigned a, unsigned na)
}
extern int cameradist, cameraclock;
extern double cameradist, cameraclock;
void loaddefinitionsfile(const char* fn, bool cumulative = false, bool maingrp = false);
bool calcChaseCamPos(int* px, int* py, int* pz, DCoreActor* pspr, sectortype** psectnum, DAngle ang, fixedhoriz horiz, double const smoothratio);
bool calcChaseCamPos(DVector3& ppos, DCoreActor* pspr, sectortype** psectnum, DAngle ang, fixedhoriz horiz, double const smoothratio);
inline bool calcChaseCamPos(int* px, int* py, int* pz, DCoreActor* pspr, sectortype** psectnum, DAngle ang, fixedhoriz horiz, double const smoothratio)
{
auto pos = DVector3((*px) * inttoworld, (*py) * inttoworld, (*pz) * zinttoworld);
auto res = calcChaseCamPos(pos, pspr, psectnum, ang, horiz, smoothratio);
(*px) = pos.X * worldtoint;
(*py) = pos.Y * worldtoint;
(*pz) = pos.Z * zworldtoint;
return res;
}
void PlanesAtPoint(const sectortype* sec, float dax, float day, float* ceilz, float* florz);