Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - tyranid12

Pages: [1]
1
Thanks, this worked perfectly!

2
Graphics / Detect if sf::LineStrip primitive overlaps sf::RectangleShape
« on: January 29, 2025, 11:03:02 pm »
I have an sf::VertexArray, with two points, and a primitive type of sf::LineStrip. I want to detect if an object (which will be an sf::RectangleShape) is overlapping on this line.
Reading the documentation, I was drawn towards sf::VertexArray::getBounds(), however it appears that returns a rectangle containing both points. This is not what I want. I would like it so that I can calculate whether or not an object is actually touching the rendered line, which spans between the two vertexes.
I have looked at the documentation ,however I cannot appear to find a solution with my desired effect. I cannot find it on the forums either. How would I be able to do this?

Pages: [1]