RandyGaul / qu3e

Lightweight and Simple 3D Open Source Physics Engine in C++
zlib License
928 stars 111 forks source link

assert (axis != 0) #44

Closed Rorybabory closed 4 years ago

Rorybabory commented 4 years ago

I was wondering what triggers this crash on programs using this library. I'm not sure if this is how I should use the issues section but I just wanted to ask.

RandyGaul commented 4 years ago

The idea is nothing should ever trigger this assert. Did you actually hit this assert? It's just here to make sure the implementation is correct and there are no obvious bugs.

Feel free to re-open this issue or comment more of like, just closing for now :)

Rorybabory commented 4 years ago

I did check and I am hitting the assert. Should I send you a dump with the results?

RandyGaul commented 4 years ago

Yeah if you can dump the world just before the assert I can try debugging it.

RandyGaul commented 4 years ago

Just make sure the assert is hit after you load up the dump -- the dump doesn't save cached impulses so results will vary slightly.

Rorybabory commented 4 years ago

I haven't been able to find a way to consistently trigger the assert. It is always extremely random if it triggers or not. But I am also wondering if you can explain what triggers this assert because I do not understand.

RandyGaul commented 4 years ago

I'm still not exactly sure how this case is being hit, but, maybe simply returning no collision in this case is appropriate, since it's more or less saying none of the axes were selected as penetrating. Let me know if this causes any problems for you.

https://github.com/RandyGaul/qu3e/commit/ad3feda2958f023f4989a69e5127265281cdf603

If I do get a reproduction, then I can investigate with the debugger to figure out exactly what's going on.

Rorybabory commented 4 years ago

I got your new version. It is working perfect now. Thank You!