by Rip and Tear » Mon Oct 07, 2019 3:09 pm
GetLineX/GetLineY are ACS functions that were added to GZDoom based on their implementation in the Eternity engine (
thread). However, the behavior in GZDoom is different than in Eternity, seemingly by mistake. Here's the the method signatures.
Code: Select all
fixed GetLineX(int lineID, fixed ratioAlongLine, fixed distanceFromLine)
fixed GetLineY(int lineID, fixed ratioAlongLine, fixed distanceFromLine)
The
Eternity Engine implementations of these functions return absolute coordinates in the world, which seems to be to be the intended behavior.
In the
GZDoom implementation, the functions return a position relative to the line's first vertex. Essentially, this means that calling GetLineX/GetLineY with ratioAlongLine = 0 will
always return zero.
Comparing the two implementations, you can see that Eternity adds the delta to the position of the line's vertex, while GZDoom does not. This seems to be an oversight, and should be corrected.
GetLineX/GetLineY are ACS functions that were added to GZDoom based on their implementation in the Eternity engine ([url=https://forum.zdoom.org/viewtopic.php?f=3&t=55724]thread[/url]). However, the behavior in GZDoom is different than in Eternity, seemingly by mistake. Here's the the method signatures.
[code]fixed GetLineX(int lineID, fixed ratioAlongLine, fixed distanceFromLine)
fixed GetLineY(int lineID, fixed ratioAlongLine, fixed distanceFromLine)[/code]
The [url=https://github.com/team-eternity/eternity/blob/bbc52e7bbb330b9c8a420a0e7cbc3571162adf3f/source/acs_func.cpp#L906]Eternity Engine implementations[/url] of these functions return absolute coordinates in the world, which seems to be to be the intended behavior.
In the [url=https://github.com/coelckers/gzdoom/blob/18464d571dca923c2f866c697119f2ca692799fa/src/playsim/p_acs.cpp#L6686]GZDoom implementation[/url], the functions return a position relative to the line's first vertex. Essentially, this means that calling GetLineX/GetLineY with ratioAlongLine = 0 will [i]always[/i] return zero.
Comparing the two implementations, you can see that Eternity adds the delta to the position of the line's vertex, while GZDoom does not. This seems to be an oversight, and should be corrected.