[Fixed] GetLineX/GetLineY Implementation

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

GetLineX/GetLineY Implementation

Postby Rip and Tear » Mon Oct 07, 2019 4: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 allExpand view
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.
User avatar
Rip and Tear
I <3 ZScript
 
Joined: 02 May 2017
Operating System: Mac OS X 10.8 or later
Graphics Processor: Intel (Modern GZDoom)

Re: GetLineX/GetLineY Implementation

Postby Graf Zahl » Sun Oct 20, 2019 7:31 am

fixed.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests