Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PolygonShape.set() calculates vertex uniqueness incorrectly #23

Closed
ardabro opened this issue Oct 30, 2014 · 1 comment
Closed

PolygonShape.set() calculates vertex uniqueness incorrectly #23

ardabro opened this issue Oct 30, 2014 · 1 comment

Comments

@ardabro
Copy link

ardabro commented Oct 30, 2014

Condition implemented as:
if (MathUtils.distanceSquared(v, ps[j]) < 0.5f * Settings.linearSlop)
should be:
if (MathUtils.distanceSquared(v, ps[j]) < (0.5f * Settings.linearSlop)*(0.5f * Settings.linearSlop))

Existing implementation leads to confusion.

@dmurph
Copy link
Member

dmurph commented Dec 20, 2014

This matches the current Box2D implementation (see here: https://code.google.com/p/box2d/source/browse/trunk/Box2D/Box2D/Collision/Shapes/b2PolygonShape.cpp#141)

I stick to the Box2D implementation for all math and physics related code, unless there is an obvious bug that makes things explode. If you want this changed, you'll have to file an issue with Box2D. Sorry!

@dmurph dmurph closed this as completed Dec 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants