Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [SOLVED] SetSpriteShapePolygon() dont like negatives Y values

Author
Message
XANAX 2B
20
Years of Service
User Offline
Joined: 20th Jun 2003
Location: Corsica (France)
Posted: 17th Apr 2018 23:51
Hello,

I've discovered that testing collisions with the polygon shape below not works when the Y of the points are negatives.



Is this a bug or a mistake i've made ?
Don't let the world decrease your conatus

The author of this post has marked a post as an answer.

Go to answer

Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 18th Apr 2018 00:19 Edited at: 18th Apr 2018 00:20
This post has been marked by the post author as the answer.
It works fine with negative Y values. Thats not the problem.

The problem is that you have created a concave shape...or at least... 2 of your points make the shape concave in places (index 2 and index 10). this creates problems in the collision detection as it needs a convex shape due to the way the collision works. Alternatively you can use multiple convex shapes to make up a concave one.

If you use the following points it will work fine...


Ive edited index 2 and index 10 to allow the shape to be convex so it works
XANAX 2B
20
Years of Service
User Offline
Joined: 20th Jun 2003
Location: Corsica (France)
Posted: 19th Apr 2018 08:05
Thanks a lot Bengismo.
Don't let the world decrease your conatus

Login to post a reply

Server time is: 2024-04-25 03:16:40
Your offset time is: 2024-04-25 03:16:40