I just implemented b2Body::GetContactList(). There's a simple example in the HelloWorld project that outputs the contact normals. Not exactly a thorough test... so proceed with caution.
The contact callback system is a better way to get at contact data, but it works a bit different than the C++ version:
1. Rather than extend b2ContactListener, just extend b2World - all the contact callbacks have been rolled up into the world class.
2. You have to set reportBeginContact, reportEndContact, etc. on the fixtures you are interested in. This is because there's some overhead in making the callback from C++ to AS3, so you don't want it to fire for every single fixture.
3. If you use WCK, the contact callbacks fire AS3 native events off of the BodyShape that you can listen for via addEventListener
Sensors work just like they do in the C++ version. The pinball demo actually uses sensors to teleport the ball back to the beginning when it falls off the screen.
Let me know what you need next 🙂 otherwise I'm off to buoyancy.
The contact callback system is a better way to get at contact data, but it works a bit different than the C++ version:
1. Rather than extend b2ContactListener, just extend b2World - all the contact callbacks have been rolled up into the world class.
2. You have to set reportBeginContact, reportEndContact, etc. on the fixtures you are interested in. This is because there's some overhead in making the callback from C++ to AS3, so you don't want it to fire for every single fixture.
3. If you use WCK, the contact callbacks fire AS3 native events off of the BodyShape that you can listen for via addEventListener
Sensors work just like they do in the C++ version. The pinball demo actually uses sensors to teleport the ball back to the beginning when it falls off the screen.
Let me know what you need next 🙂 otherwise I'm off to buoyancy.