mirror of
https://github.com/DrBeef/Raze.git
synced 2025-03-28 20:00:44 +00:00
- Fix mixed X/Y pos subtraction in spriteGetZOfSlopef()
and use a bit more of the backend.
* Confirmed coordinate mix-up when reviewing commit `- added spriteGetZOfSlopeF for the backend`.
This commit is contained in:
parent
22ccf33569
commit
2e8e5f99e7
1 changed files with 1 additions and 3 deletions
|
@ -380,9 +380,7 @@ inline int tspriteGetSlope(const tspritetype* spr)
|
|||
inline double spriteGetZOfSlopef(const spritetypebase* tspr, const DVector2& pos, int heinum)
|
||||
{
|
||||
if (heinum == 0) return tspr->pos.Z;
|
||||
auto ang = tspr->angle;
|
||||
double factor = -ang.Sin() * (pos.X - tspr->pos.Y) - ang.Cos() * (pos.X - tspr->pos.X);
|
||||
return tspr->pos.Z + heinum * factor * (1. / SLOPEVAL_FACTOR);
|
||||
return tspr->pos.Z + heinum * -tspr->angle.ToVector().dot(pos - tspr->pos.XY()) * (1. / SLOPEVAL_FACTOR);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
Loading…
Reference in a new issue