-
Notifications
You must be signed in to change notification settings - Fork 195
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
Using collision events not working #91
Comments
@orgicus Sorry, I don't have much time for this project anymore, and I don't remember enough about how stuff like the callbacks work, to be honest. |
There are 2 js version box2d : they are active, I think you could try them. |
It would be great though if someone did have the time to be a maintainer of this project, as it compiles to asm.js/wasm which is great for speed. |
I added prefix "Box2D." to both JSContactListener and b2Contact, |
@ShoutTree do you mind posting a short snippet ? var cl = new Box2D.b2ContactListener()
cl.BeginContact = function(e){
console.log(e);
}
cl.EndContact = function(e){
console.log(e);
}
world.SetContactListener(cl); but I got no console message. Can you please elaborate on your approach that worked ? Thank you, |
var world = new Box2D.b2World(new Box2D.b2Vec2(0.0, -9.8));
var listener = new Box2D.JSContactListener();
listener.EndContact = function(contactPtr) {
var contact = Box2D.wrapPointer( contactPtr, Box2D.b2Contact );
var fixtureA = contact.GetFixtureA();
....
}
listener.BeginContact = function(contactPtr){}
listener.PreSolve = function(contactPtr){}
listener.PostSolve = function(contactPtr){}
world.SetContactListener( listener ); |
Taking a working scene and adding the README code to it (while renaming JSContactListener to b2ContaxtListener):
The console never prints anything...
The text was updated successfully, but these errors were encountered: