DanielChappuis / reactphysics3d

Open source C++ physics engine library in 3D
http://www.reactphysics3d.com
zlib License
1.54k stars 223 forks source link

Crash when capsule dynamic rigidbody collides with a concave triangle mesh static body #215

Closed grenappels closed 2 years ago

grenappels commented 3 years ago

Hello, thanks for the very nice library! I was up and running in a couple hours and have been enjoying using it a lot so far.

I noticed a crash I'm trying to get to the bottom of, when I have a dynamic rigidbody with a capsule collider collide with a concave triangle mesh collider static rigidbody. Seems like it tries to construct a ContactPointInfo but the contactNormal being fed to the function has nan for each component.

Assertion failed: contactNormal.lengthSquare() > decimal(0.8), file reactphysics3d/collision/ContactPointInfo.h, line 76

here's what my local variables look like in debugging, notice the normal: {x=nan y=nan z=nan } image

This has happened on both my mac laptop and windows PC. Any ideas of what I may be doing wrong and can correct on my end would be appreciated! I tried to follow the logic of what was happening that lead to this but it's a bit over my head 😅

DanielChappuis commented 3 years ago

Hello. Thanks a lot for reporting this issue.

Do you think you can post some code with your capsule and concave mesh so that I can try to reproduce the issue on my side? It would be very helpful for this kind of bug.

DanielChappuis commented 2 years ago

I am closing this issue for the moment because I don't have enough information to investigate this deeper. Of course, do not hesitate to reopen it if you have more information.