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

JSContactListenerWithoutSolveCallbacks has no constructor #35

Closed
BlueNebulaDev opened this issue Sep 9, 2021 · 3 comments · Fixed by #39
Closed

JSContactListenerWithoutSolveCallbacks has no constructor #35

BlueNebulaDev opened this issue Sep 9, 2021 · 3 comments · Fixed by #39

Comments

@BlueNebulaDev
Copy link

I suspect that this line should contain void JSContactListenerWithoutSolveCallbacks();:

void JSContactListener();

@Birch-san
Copy link
Owner

yeah, I think you're right.

JSContactListenerWithoutSolveCallbacks was a quick, untested attempt of mine to satisfy this TODO from box2d.js:
https://github.com/kripken/box2d.js/blob/1e6e9da36a3160a9f40cda4cddcb4f83abb4d82c/Box2D_v2.3.1.idl#L33-L35

hmm, I also see that their [JSImplementation="b2ContactListener"]s clash.

I think the best solution is to just delete JSContactListenerWithoutSolveCallbacks — the performance problem it was designed to solve (eliminating WASM->JS calls) is not a problem nowadays.

if you construct a b2ContactListener, I'm not sure (because of the clash) whether you'll end up with a JSContactListener or a JSContactListenerWithoutSolveCallbacks. if it's the former (i.e. solve callbacks are included), then I think this isn't very consequential (because you can implement the solve callbacks as a no-op if you want to ignore them). but if it's calling the latter, then solve callbacks won't be called, which is a bigger problem.

are you trying to use solve callbacks, and are they not working?

@BlueNebulaDev
Copy link
Author

I've been using JSContactListener and PreSolve and PostSolve are called, so everything works correctly with that class.

@Birch-san
Copy link
Owner

v7.0.0 deletes JSContactListenerWithoutSolveCallbacks.

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

Successfully merging a pull request may close this issue.

2 participants