erincatto / box2d

Box2D is a 2D physics engine for games
https://box2d.org
MIT License
8.35k stars 1.55k forks source link

Contact normal in b2ContactBeginTouchEvent #806

Closed abria closed 1 month ago

abria commented 2 months ago

It would be very useful to add contact normal into b2ContactBeginTouchEvent, like b2ContactHitEvent already has.

I need to implement the collision logic based on the collision normal. If my understanding is correct, currently I have to use b2Shape_GetContactData() and do a linear search for the targeted collision between A and B. Is there a more efficient method?

erincatto commented 1 month ago

I added the entire contact manifold to the begin touch event in #808.