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

Author Topic: Does SFML support Pixel perfect collision  (Read 3652 times)

0 Members and 1 Guest are viewing this topic.

CuddleBunniezzz12

  • Newbie
  • *
  • Posts: 1
    • View Profile
Does SFML support Pixel perfect collision
« on: March 19, 2010, 03:35:19 am »
Hi, quick question.

Does SFML support Pixel Perfect collision?

I was creating a game before in DarkGDK, it was working out fine till I found out that they only support Bounding rectangle collision, and I'm not advanced enough to write my own collision code.

Thanks for your time.

Walker

  • Full Member
  • ***
  • Posts: 181
    • View Profile
Does SFML support Pixel perfect collision
« Reply #1 on: March 19, 2010, 04:15:02 am »
SFML isn't a game library.

However, there is a collision detection class in the wiki.

http://www.sfml-dev.org/wiki/en/sources/simple_collision_detection

Xeon06

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Does SFML support Pixel perfect collision
« Reply #2 on: March 19, 2010, 07:50:21 pm »
It's not that hard. The FloatRect class allows you to get the intersecting parts of two FloatRects, so all you need to do after that is go through each of those pixels.