I'd say the setup is more like a stack. When the line hits an edge, push a new vertex at the new corner. When it unwinds back to less than the entry angle, pop back to the previous segment anchor.
The full line can then be drawn from the bottom of the vertex stack up, finishing at the player. The only physically simulated constraint is the very last segment.
Unwinding is basically looking for a change of sign of the angle between the last segment and the one before it. There's a few different ways to do that... Depending on what you want to store or calculate.
View all comments
Show parent comment
1
u/KSP_HarvesteR Feb 01 '24
I'd say the setup is more like a stack. When the line hits an edge, push a new vertex at the new corner. When it unwinds back to less than the entry angle, pop back to the previous segment anchor.
The full line can then be drawn from the bottom of the vertex stack up, finishing at the player. The only physically simulated constraint is the very last segment.
Unwinding is basically looking for a change of sign of the angle between the last segment and the one before it. There's a few different ways to do that... Depending on what you want to store or calculate.
Sure does look fun actually