deltaluca / nape

Haxe/AS3 Physics Engine
http://napephys.com
Other
542 stars 77 forks source link

[Bug] Collision Arbiter Normals Swapped #102

Closed EduardoLopes closed 4 years ago

EduardoLopes commented 8 years ago

While making my game for ludum dare 34, i found a bug, at first i thought it was my code, then i found how to fix it and i guess it is a nape bug.

The api docs says that CollisionArbiter.normal will always point from arbiter's shape1 towards shape2, but doesn't seem to work like this every time, it depends on the order that the shapes are being instantiated.

I made a test. Here's the source code and you can see the test running online. There's some comments in the code explaining what's happening.

Hope this will help figure out what is happening. And if this is not a bug, please help me fix my code, i put a lot of time into this issue trying to fix it without touch nape code.

EduardoLopes commented 8 years ago

I fixed this by checking if the id of the shape1 is equal the id of the shape it should be, if not, i invert the normal.

alamboley commented 8 years ago

Yeah, I'd the same issue too! Having a crazy one-way platform.

alamboley commented 8 years ago

@deltaluca please would you mind to provide a fix & make a release build?

alamboley commented 4 years ago

@EduardoLopes just by curiosity, why closing this?

EduardoLopes commented 4 years ago

@alamboley I was cleaning up my issue box and this is there since 2016. I don't feel like this will ever be fixed.

alamboley commented 4 years ago

@EduardoLopes yup sadly :( thanks for the answer 👍

EduardoLopes commented 4 years ago

yea :(

alamboley commented 4 years ago

Perhaps it has been fixed there, but can't confirm:

Gama11 commented 4 years ago

nape-haxe4 only fixes compilation with Haxe 4 so far, nothing else. From the commit history I doubt that hxnape does more than that too.

MSGhero commented 4 years ago

I think you summoned him from being too busy? https://www.newgrounds.com/bbs/topic/578434/2044#bbspost26513818_post_text