mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-05-31 00:51:21 +00:00
- Backend update from Raze.
This commit is contained in:
parent
53c2ac79e1
commit
c55dfbcddd
11 changed files with 100 additions and 22 deletions
|
@ -271,6 +271,19 @@ struct TVector2
|
|||
return *this;
|
||||
}
|
||||
|
||||
TVector2 Resized(double len) const
|
||||
{
|
||||
double vlen = Length();
|
||||
if (vlen != 0.)
|
||||
{
|
||||
double scale = len / vlen;
|
||||
return{ vec_t(X * scale), vec_t(Y * scale) };
|
||||
}
|
||||
else
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
}
|
||||
|
||||
// Dot product
|
||||
vec_t operator | (const TVector2 &other) const
|
||||
|
@ -644,7 +657,7 @@ struct TVector3
|
|||
return *this;
|
||||
}
|
||||
|
||||
TVector3 Resized(double len)
|
||||
TVector3 Resized(double len) const
|
||||
{
|
||||
double vlen = Length();
|
||||
if (vlen != 0.)
|
||||
|
@ -974,7 +987,7 @@ struct TVector4
|
|||
return *this;
|
||||
}
|
||||
|
||||
TVector4 Resized(double len)
|
||||
TVector4 Resized(double len) const
|
||||
{
|
||||
double vlen = Length();
|
||||
if (vlen != 0.)
|
||||
|
@ -1287,12 +1300,7 @@ public:
|
|||
return TAngle(f * (90. / 0x40000000));
|
||||
}
|
||||
|
||||
static constexpr TAngle fromBuild(int bang)
|
||||
{
|
||||
return TAngle(bang * (90. / 512));
|
||||
}
|
||||
|
||||
static constexpr TAngle fromBuildf(double bang)
|
||||
static constexpr TAngle fromBuild(double bang)
|
||||
{
|
||||
return TAngle(bang * (90. / 512));
|
||||
}
|
||||
|
@ -1349,6 +1357,11 @@ public:
|
|||
return Degrees_ * other;
|
||||
}
|
||||
|
||||
constexpr TAngle operator* (TAngle other) const
|
||||
{
|
||||
return Degrees_ * other.Degrees_;
|
||||
}
|
||||
|
||||
constexpr TAngle operator/ (vec_t other) const
|
||||
{
|
||||
return Degrees_ / other;
|
||||
|
@ -1736,6 +1749,7 @@ constexpr DAngle minAngle = DAngle::fromDeg(1. / 65536.);
|
|||
constexpr FAngle nullFAngle = FAngle::fromDeg(0.);
|
||||
|
||||
constexpr DAngle DAngle1 = DAngle::fromDeg(1);
|
||||
constexpr DAngle DAngle15 = DAngle::fromDeg(15);
|
||||
constexpr DAngle DAngle22_5 = DAngle::fromDeg(22.5);
|
||||
constexpr DAngle DAngle45 = DAngle::fromDeg(45);
|
||||
constexpr DAngle DAngle60 = DAngle::fromDeg(60);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue