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

Author Topic: Bug found in thors ConcaveShape  (Read 2145 times)

0 Members and 2 Guests are viewing this topic.

Doodlemeat

  • Guest
Bug found in thors ConcaveShape
« on: February 20, 2014, 01:21:17 am »
Hello.
I found a bug, maybe 2 of them with thor ConcaveShape.

First bug:
A ConcaveShape is not filled with any color. This happens randomly from what I have seen. And yes, I am 100% sure I fill it with color since. It fills with color more often than it does'nt


Second bug:
Sometimes when I call

rt.draw(shape);

where rt is rendertarget and shape is a thor::ConcaveShape, the program crashes with this message:

here is the callstack:


Here lies my code. In Soundripple.cpp.
There is not other file that manipulates the ConcaveShape.
https://github.com/doodlemeat/ProjectTerminal/blob/master/Stealth/SoundRipple.cpp

thomas9459

  • Newbie
  • *
  • Posts: 49
    • View Profile
    • Email
Re: Bug found in thors ConcaveShape
« Reply #1 on: February 20, 2014, 03:09:22 am »
Can you provide a SSCCE so that others can test the code in question? Otherwise, it ends up just being guesswork...

Doodlemeat

  • Guest
Re: Bug found in thors ConcaveShape
« Reply #2 on: February 20, 2014, 10:31:44 am »
So you want the .sln file ? I think you will need all other dependencies like boost and such?

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Bug found in thors ConcaveShape
« Reply #3 on: February 20, 2014, 11:02:29 am »
No, we want a complete and minimal example that reproduces the problem. Please read the link carefully.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Doodlemeat

  • Guest
Re: Bug found in thors ConcaveShape
« Reply #4 on: March 05, 2014, 02:24:18 am »
Hello!
Sorry for taking so long time.

Below is a .rar file of everything that is included. That is
  • SFML 2.1
  • Thor
  • Aurora (thor depends on this)


Built with visual studio 2013 at Windows 8.
Only configured for debug mode.
http://www.sendspace.com/file/ysni67
« Last Edit: March 05, 2014, 02:26:36 am by Doodlemeat »

Doodlemeat

  • Guest
Re: Bug found in thors ConcaveShape
« Reply #5 on: March 05, 2014, 01:44:17 pm »
UPDATE!
I just want to tell you that the second bug is not related to the topic. Its a mistake by me, but the first bug is still there :)

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Bug found in thors ConcaveShape
« Reply #6 on: March 09, 2014, 06:35:24 pm »
I could reduce the problem to the following list of points:
(344, 248)
(120, 248)
(184, 248)
(184, 181)

The problem here is that three points of adjacent triangles are on a line (y=248). This is a limitation of the Delaunay triangulation and stated in the documentation:
Note that the triangulation may meet problems at 4 co-circular points or at 3 or more collinear points.
This led to a removal of too many triangles in the cleanup step during thor::triangulatePolygon() called from thor::ConcaveShape, so that the convex shapes composing the concave shape were left empty.

I agree that this limitation is annoying, I'll investigate alternatives. For the concave shape it might suffice to simply offset points randomly by a tiny amount, but I actually prefer a clean solution that also works for other triangulations.
« Last Edit: March 09, 2014, 06:57:37 pm by Nexus »
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Bug found in thors ConcaveShape
« Reply #7 on: March 09, 2014, 10:43:47 pm »
Should be fixed now :)

I improved the triangulation so that this specific case is recognized. It won't be possible to handle all situations of 3 collinear points (e.g. only 3 vertices in total), but most reasonable scenarios should be handled correctly now.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: