Hello!
There's a way to change the size of the AABB of the objects? I have to lay a finger on a sphere and know when it happened, but the collision information occurs before, in fact, the finger lay in the sphere. Because the collision is detected when the finger enters the sphere AABB.
The figure below shows, more or less, what's going on.
If anyone can help me, I thank!
reduce the AABB for spheres
-
- Posts: 21
- Joined: Wed Mar 25, 2015 2:04 pm
reduce the AABB for spheres
You do not have the required permissions to view the files attached to this post.
-
- Posts: 849
- Joined: Tue Sep 30, 2014 6:03 pm
- Location: San Francisco
Re: reduce the AABB for spheres
You're detecting the "collision" incorrectly. The recommended way to do it is to scan the contact manifold lists and keep a map of existing pairs of objects. When a new pair shows up then you would fire off a collision "start" event. Unfortunately such a system is not one of the default Bullet features and must be a custom implementation. There is a good example that was posted on these forums a while ago.
The AABB can't be made any smaller for the sphere. The object's AABB is used in the broadphase overlapping pair logic and if any part of the sphere were to extend outside its AABB then some real narrow-phase collisions would be missed because the broadphase would incorrectly fail early.
The AABB can't be made any smaller for the sphere. The object's AABB is used in the broadphase overlapping pair logic and if any part of the sphere were to extend outside its AABB then some real narrow-phase collisions would be missed because the broadphase would incorrectly fail early.
-
- Posts: 21
- Joined: Wed Mar 25, 2015 2:04 pm
Re: reduce the AABB for spheres
Thanks for the answer drleviathan.
I'll search the post.
I'll search the post.
-
- Posts: 849
- Joined: Tue Sep 30, 2014 6:03 pm
- Location: San Francisco
Re: reduce the AABB for spheres
Oh hey, I also did a search and found this old post, although that wasn't the one I was thinking about.
-
- Posts: 21
- Joined: Wed Mar 25, 2015 2:04 pm
Re: reduce the AABB for spheres [SOLVED]
Hi drleviathan!
Thanks for the post!
I was on the right track, but was missing the line:
Now the callback is working all right!
Thanks for the post!
I was on the right track, but was missing the line:
Code: Select all
btManifoldPoint &pt = contactManifold->getContactPoint(j);
if(pt.getDistance() < 0.f){
}