last days I tried to use bullet in panda3d for collision detection.
Temporarily, I only need to know if two particular solids are contacted. (when they contacted, print a number is enough).
But I’m not familiar with both panda3d and bullet, and the C++ reference for bulletworld in panda3d main page is not very full, I use the following codes but it did not work well.
BulletContactResult br = physics_world->contact_test_pair(base1, wrist1);
int a = br.get_num_contacts();
cout << a << endl;
base1 and wrist1 are two PT(BulletRigidBodyNode) transformed from my model NodePath.
In my expectations， int a will be the number of the contacts of base1 and wrist1. And if a==0, they do not contatct. if a!=1, they contact.
But maybe I fully misunderstand the meaning of the function get_num_contacts()? the return number of a is unexpected. The value can be 1072,1399,983… and is much larger than my expect. (and seems associated with my original pos of base1 and wrist1)
Therefore, I think I misunderstand the function. So, what’s the correct mean? or is there any approach easier to realize the simple collision detection?
Thanks in advance.