mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-31 21:20:39 +00:00
- Turn DVector2
rotatepoint()
into an inline using the vector's methods.
This commit is contained in:
parent
18f97c3d7e
commit
db5db7d9b3
2 changed files with 5 additions and 17 deletions
|
@ -510,22 +510,6 @@ void dragpoint(walltype* startwall, const DVector2& pos)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
DVector2 rotatepoint(const DVector2& pivot, const DVector2& point, DAngle angle)
|
||||
{
|
||||
auto cosang = angle.Cos();
|
||||
auto sinang = angle.Sin();
|
||||
auto p = point - pivot;
|
||||
return {
|
||||
p.X * cosang - p.Y * sinang + pivot.X,
|
||||
p.Y * cosang + p.X * sinang + pivot.Y };
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
int inside(double x, double y, const sectortype* sect)
|
||||
{
|
||||
if (sect)
|
||||
|
|
|
@ -282,7 +282,6 @@ void checkRotatedWalls();
|
|||
bool sectorsConnected(int sect1, int sect2);
|
||||
void dragpoint(walltype* wal, int newx, int newy);
|
||||
void dragpoint(walltype* wal, const DVector2& pos);
|
||||
DVector2 rotatepoint(const DVector2& pivot, const DVector2& point, DAngle angle);
|
||||
int32_t inside(double x, double y, const sectortype* sect);
|
||||
void getcorrectzsofslope(int sectnum, int dax, int day, int* ceilz, int* florz);
|
||||
int getceilzofslopeptr(const sectortype* sec, int dax, int day);
|
||||
|
@ -328,6 +327,11 @@ inline double getflorzofslopeptrf(const sectortype* sec, const DVector2& pos)
|
|||
return getflorzofslopeptr(sec, pos.X * worldtoint, pos.Y * worldtoint) * zinttoworld;
|
||||
}
|
||||
|
||||
inline DVector2 rotatepoint(const DVector2& pivot, const DVector2& point, DAngle angle)
|
||||
{
|
||||
return (point - pivot).Rotated(angle) + pivot;
|
||||
}
|
||||
|
||||
|
||||
enum EFindNextSector
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue