mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-20 08:00:56 +00:00
- use .dot() for calculating slopes
This commit is contained in:
parent
e83d0930bf
commit
02f1f79333
1 changed files with 2 additions and 1 deletions
|
@ -142,7 +142,8 @@ void calcSlope(const sectortype* sec, double xpos, double ypos, double* pceilz,
|
|||
double len = wal->Length();
|
||||
if (len != 0)
|
||||
{
|
||||
double fac = (wal->delta().X * (ypos - wal->pos.Y) - wal->delta().Y * (xpos - wal->pos.X)) / len * (1. / SLOPEVAL_FACTOR);
|
||||
DVector2 wd = DVector2(xpos, ypos) - wal->pos;
|
||||
double fac = wal->delta().dot(wd.Rotated90CW()) / len * (1. / SLOPEVAL_FACTOR);
|
||||
if (pceilz && sec->ceilingstat & CSTAT_SECTOR_SLOPE) *pceilz += (sec->ceilingheinum * fac);
|
||||
if (pflorz && sec->floorstat & CSTAT_SECTOR_SLOPE) *pflorz += (sec->floorheinum * fac);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue