mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-20 08:00:56 +00:00
- use dot product for getslopeval as well
This commit is contained in:
parent
02f1f79333
commit
f1baf5c69c
1 changed files with 1 additions and 2 deletions
|
@ -170,8 +170,7 @@ void getcorrectzsofslope(int sectnum, int dax, int day, double* ceilz, double* f
|
|||
int getslopeval(sectortype* sect, const DVector3& pos, double basez)
|
||||
{
|
||||
auto wal = sect->firstWall();
|
||||
auto delta = wal->delta();
|
||||
double i = (pos.Y - wal->pos.Y) * delta.X - (pos.X - wal->pos.X) * delta.Y;
|
||||
double i = (pos.XY() - wal->pos).dot(wal->delta().Rotated90CCW());
|
||||
return i == 0? 0 : SLOPEVAL_FACTOR * (pos.Z - basez) * wal->Length() / i;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue