I try to use Bullet for handling collisions in a small project, I started.
I come to define my objects, and detect collisions between them.
For cons, I'm facing a trouble in the static scenery, as the interior of a building for example.
I use this routine for detection:
Code: Select all
btVoronoiSimplexSolver sGjkSimplexSolver;
btGjkEpaPenetrationDepthSolver epaSolver;
btPointCollector gjkOutput;
{
btGjkPairDetector convexConvex((btConvexShape*)shape1, (btConvexShape*)shape2,&sGjkSimplexSolver,&epaSolver);
btGjkPairDetector::ClosestPointInput input;
input.m_transformA = tr[0];
input.m_transformB = tr[1];
convexConvex.getClosestPoints(input, gjkOutput, 0);
}
if (gjkOutput.m_hasResult && gjkOutput.m_distance<0)
{
ContactPoint = gjkOutput.m_pointInWorld;
coldistance = gjkOutput.m_distance;
NormalPoint = gjkOutput.m_normalOnBInWorld;
}
As if, in fact, my building was considered a giant ConvexHull.
How is it possible to make detection in static world, including when they are closed?
I searched the forum, but confess it difficult to really find an answer.
Thank you in advance to those who take the time to read and answer.