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

Author Topic: Collision of rotated Rectangle  (Read 4719 times)

0 Members and 1 Guest are viewing this topic.

Mossar

  • Newbie
  • *
  • Posts: 15
    • View Profile
Collision of rotated Rectangle
« on: October 10, 2013, 10:47:00 am »
In my game I've got collision mechanism, but it works fine only on rectangles which are not rotated. I decided to add boxes which are rotated, but, of course, my application detect collision between character and bounding box which is not rotated and is not returning real bounds of a rectangle.

I found that article about doing it: http://www.gamedev.net/page/resources/_/technical/game-programming/2d-rotated-rectangle-collision-r2604. I have not read it yet, but as I see you have to get local (not global) x-axis and y-axis of rectangle and create your own system of collision without using, in SFML, getGlobalBounds().

I've got idea how to do it that way, but I'm curious if it's possible to detect collision between rotated object with SFML functions? Or maybe you can advise me how to implement that in a quite simple way.

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: Collision of rotated Rectangle
« Reply #1 on: October 10, 2013, 11:29:11 am »