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 - SeikenPunch

Pages: [1]
1
As an example of collision, you could take a look at:
https://github.com/SFML/SFML/wiki/Source%3A-Rectangular-Boundary-Collision

If you feel that it doesn't already do for you the collision that you need, it at least shows an example of how to get the points of a rectangle (using local points and its transform) as well as using an inverse transform to convert into local co-ordinates of a different shape.

This helps. I think they are doing what I was planning to do or something very similar. Thank you!

2
No, they're axis aligned.

If you want to get the rotated points, you can get the local bounds and apply the transformation as you've shown on each point of the sf::Rect. Which still provides a better guarantee than deciding on a specific order of the index.

Ohh okay. I am still pretty new to SFML thank you!

3
I guess you can check the source code, but the order is not part of the API and instead is an implementation detail.

If you want to know the specific points, you're better off with getPosition() and getPosition() + getSize().

But how would I get the location of the points if the RectangleShape is rotated? I am trying to code collision and I think I can do it if I know the location of the points.

4
I was looking to get the coordinates of the points of a RectangleShape and saw a post saying you can use rect.getTransform().transformPoint(rect.getPoint(i)) where rect is a RectangleShape and i is the index, but I could not find any information about how the points are in the index. Is 0 the top left point and 1 the top right point and so on or is it something else?

Thank you for any help!

Pages: [1]