mirror of
https://github.com/ZDoom/Raze.git
synced 2025-05-30 17:01:03 +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)
|
inline double spriteGetZOfSlopef(const spritetypebase* tspr, const DVector2& pos, int heinum)
|
||||||
{
|
{
|
||||||
if (heinum == 0) return tspr->pos.Z;
|
if (heinum == 0) return tspr->pos.Z;
|
||||||
auto ang = tspr->angle;
|
return tspr->pos.Z + heinum * -tspr->angle.ToVector().dot(pos - tspr->pos.XY()) * (1. / SLOPEVAL_FACTOR);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue