Closed BlueNebulaDev closed 2 years ago
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?
I've been using JSContactListener
and PreSolve
and PostSolve
are called, so everything works correctly with that class.
v7.0.0
deletes JSContactListenerWithoutSolveCallbacks
.
I suspect that this line should contain
void JSContactListenerWithoutSolveCallbacks();
: https://github.com/Birch-san/box2d-wasm/blob/b8c98364a085a0dd1371707778c28576365bdb96/box2d-wasm/Box2D.idl#L52