View Issue Details

IDProjectCategoryView StatusLast Update
0000460Gameplay + OpenGL[All Projects] Featurepublic2017-03-28 18:04
Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Summary0000460: Implement getLineX and getLineY
DescriptionI'd like for you to implement the getLineX and getLineY specials from Eternity.

These take in a lineID, a fixed called "ratioAlongLine", and a fixed called "distanceFromLine"

They return a point that is the line's first vertex, plus the difference between the vertexes multiplied by "ratioAlongLine", plus the normal multiplied by "distanceFromLine".

If they just returned a midpoint for now and ignored the second two arguments, I think everyone would be happy.

Preferably, one would be able to pass 0 for the line ID and get the line that called it.
Steps To ReproduceUntested, hypothetical code which won't work and is probably only half of what you need...
[code=C++]fixed GetLineX(int lineId, fixed ratioAlongLine, fixed distanceFromLine) { return ln->v1->x + (ln->v2->x - ln->v1->x) * ratioAlongLine + normal.Unit() * distanceFromLine; } fixed GetLineY(int lineId, fixed ratioAlongLine, fixed distanceFromLine) { return ln->v1->y + (ln->v2->y - ln->v1->y) * ratioAlongLine + normal.Unit() * distanceFromLine; }[/code]



There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2017-03-21 11:11 RockstarRaccoon New Issue
2017-03-21 11:11 RockstarRaccoon Tag Attached: ACS
2017-03-28 18:04 Graf Zahl Status new => resolved
2017-03-28 18:04 Graf Zahl Resolution open => fixed