Hi:
I am a beginner about bullet.I want to use bullet to get collision results,such as collision points. Now,I create two boxes in the world,the one named A and other named B.First,I set A's pos with p0 and B'pos with p1 in frame F0,and then I can get some collision points from bullet.Some frames later,I set same pos to A and B as F0,then I also get some collision points from bullet.But there are a little difference between them.Especially,I found a very interesting thing that the first collision results as same as the third,and the second collision results as same as fourth.May be some importent parameters I have not set.Please help me ,Thanks a lot
Problem about collision detection
-
- Posts: 91
- Joined: Wed Jun 10, 2009 4:01 am
Re: Problem about collision detection
I guess this phenomenon is possibly caused by the manifold mechanism used by bullet.Because bullet 's collision lib generally generate one contact point one time,so the manifold is to collect and maintain those contact point. May be the first time the box-box detector report one contact point names P1,and in the second frame it report p2,p3 as contact point .Bullet internal will maintain these three points if these point pair's is valid(valid means we need some method to check whether they still in contact for example test their length a long the contact normal, etc),when in the third frame it may only report p4,But bullet will still keep p2,p3,p1 in the manifold if they are still valid ,so the first frame and third frame are same position same orientation but they can have different contact points because of the participate of second frame's contact result. You can see more about this discussion in:
http://www.continuousphysics.com/mediaw ... hysics_FAQ
http://www.continuousphysics.com/mediaw ... hysics_FAQ
-
- Posts: 5
- Joined: Fri Jul 03, 2009 1:40 am
Re: Problem about collision detection
Thanks a lot.That's right!The problem has been sloved.I setthe marco USE_PERSISTENT_CONTACTS to 0 and force to clear mainfold every frame,may be som efficiency I lost.fishboy82 wrote:I guess this phenomenon is possibly caused by the manifold mechanism used by bullet.Because bullet 's collision lib generally generate one contact point one time,so the manifold is to collect and maintain those contact point. May be the first time the box-box detector report one contact point names P1,and in the second frame it report p2,p3 as contact point .Bullet internal will maintain these three points if these point pair's is valid(valid means we need some method to check whether they still in contact for example test their length a long the contact normal, etc),when in the third frame it may only report p4,But bullet will still keep p2,p3,p1 in the manifold if they are still valid ,so the first frame and third frame are same position same orientation but they can have different contact points because of the participate of second frame's contact result. You can see more about this discussion in:
http://www.continuousphysics.com/mediaw ... hysics_FAQ
By the way,bullet is a very powerful engine,I like it