## Question in Bullet source code.

ljb
Posts: 21
Joined: Fri Oct 14, 2011 6:18 am

### Question in Bullet source code.

I'm reading Bullet source code.The function dBoxBox2() is complicated to me,who can explain it to me!How to get peneration depth,contact point?
The Function dBoxBox2() is in btBoxBoxDetector.cpp

ljb
Posts: 21
Joined: Fri Oct 14, 2011 6:18 am

### Re: Question in Bullet source code.

I got vertex face contact.But edge-edge contact is diffult.I 'm think why we don't use quadratic programming(David Eberly use it)to get distance between two rigid box.

ljb
Posts: 21
Joined: Fri Oct 14, 2011 6:18 am

### Re: Question in Bullet source code.

I can't undetstand function dLineClosestApproach() in btBoxboxdetector.cpp.There is not explain.Who can help me!

hyyou
Posts: 96
Joined: Wed Mar 16, 2016 10:11 am

### Re: Question in Bullet source code.

I am curious, so I begin to dig into the source (https://github.com/bulletphysics/bullet ... tector.cpp).

First, it uses separation theorem.

Then, it selects the direction (in separation theorem) that yield the least overlapping distance.

After that, it projects a face of body A, and a face of body B - using the direction as Normal. (and B A vice versa)
There might be 6*6 = 36 cases. I am not sure.
Using the projection result, It calls "intersectRectQuad2()" to check whether an overlapping occur.
That would be enough for vertex case.

For the edge vs edge, I believe the same procedure could be used : just use Normal = edge from A (cross) edge from B.
I didn't check it yet.