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

Can't edit contacts! (box2dflash 2.1a was outdated, broken, incomplete) #18

Open
JoeCreates opened this issue Dec 16, 2018 · 2 comments

Comments

@JoeCreates
Copy link

I wanted to raise this issue mainly to raise awareness as there is no simple fix.

The version of Box2D which this is a port of (2.1a) is not only very out of date, but was broken/incomplete at the time and lost some critical features compared to the even older 2.0.2. C++ box2d has since developed far beyond this version (2.3.1 in 2014) and never lost those critical features.

The main missing feature I came across was that in 2.1a you cannot modify a contact, which is a really big deal. For example, suppose you want to use a listener to change the friction of a contact based on the normal, in cpp this is easy (https://github.com/erincatto/Box2D/blob/master/Box2D/Dynamics/Contacts/b2Contact.h#L120). These variables and methods are not new; they pre-date version 2.1.

But for some reason they were removed from flash 2.1a so now contacts don't even have these properties in flash/haxe 2.1a.

I would recommend the cpp version as a better source as it is not only more up to date with better features, but also isn't critically broken when it comes to editing contacts.

@jgranick
Copy link
Member

jgranick commented Dec 17, 2018

I did not know that Box2D (the original) had only been updated as recently as 4 years ago. It would be very interesting if we could write A.) a CFFI version for Haxe C++ to use the original but also B.) consider doing a newer port to Haxe for all targets to use.

We could also consider A.) plus a WASM version for JavaScript (maybe someone has already done that)

@jgranick
Copy link
Member

Speaking of: https://github.com/kripken/box2d.js/

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