mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
- added InterceptVector from GZDoom.
This will be useful for some backend stuff.
This commit is contained in:
parent
ef3be6181e
commit
b7ddd9e784
1 changed files with 14 additions and 0 deletions
|
@ -584,6 +584,20 @@ inline double SquareDistToLine(double px, double py, double lx1, double ly1, dou
|
|||
return SquareDist(px, py, xx, yy);
|
||||
}
|
||||
|
||||
// taken from GZDoom with the divline_t parameters removed
|
||||
double InterceptVector(double v2x, double v2y, double v2dx, double v2dy, double v1x, double v1y, double v1dx, double v1dy)
|
||||
{
|
||||
double den = v1dy * v2dx - v1dx * v2dy;
|
||||
|
||||
if (den == 0)
|
||||
return 0; // parallel
|
||||
|
||||
double num = (v1x - v2x) * v1dy + (v2y - v1y) * v1dx;
|
||||
return num / den;
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline void alignceilslope(sectortype* sect, const DVector3& pos)
|
||||
{
|
||||
sect->setceilingslope(getslopeval(sect, pos, sect->ceilingz));
|
||||
|
|
Loading…
Reference in a new issue