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

Author Topic: NonConvex shapes in SFML2.0  (Read 2350 times)

0 Members and 1 Guest are viewing this topic.

Y.S

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
NonConvex shapes in SFML2.0
« on: August 29, 2013, 01:33:04 pm »
Hi, I just started learning SFML2.0 a few weeks ago and I wonder how I can make
non convex shapes. I learned how to make circle shapes and polygonal convex shapes
but is there any way to create non convex polygons? (I'm not taking about sprites that
can be taken from outside, but creating your own).  Thanks.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: NonConvex shapes in SFML2.0
« Reply #1 on: August 29, 2013, 01:48:44 pm »
You can't do it directly. You must either split it into multiple convex shapes, or use an add-on library like Thor.
Laurent Gomila - SFML developer

Y.S

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: NonConvex shapes in SFML2.0
« Reply #2 on: August 29, 2013, 01:57:07 pm »
Well, I will try to search for this library. But if you already familiar with it can you recommend me some references or links that explain how to install this library you suggested? Thanks.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: NonConvex shapes in SFML2.0
« Reply #3 on: August 29, 2013, 02:02:08 pm »
There: http://www.bromeon.ch/libraries/thor/

And if you have troubles using it, its creator is active on this forum ;)
Laurent Gomila - SFML developer

Y.S

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: NonConvex shapes in SFML2.0
« Reply #4 on: August 29, 2013, 02:11:00 pm »
Thanks!

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: NonConvex shapes in SFML2.0
« Reply #5 on: August 29, 2013, 02:55:31 pm »
The class that can handle concave shapes is thor::ConcaveShape. You'll see how it is used in the Shapes example of the SDK -- but its API is very similar to sf::ConvexShape.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: