Page 1 of 1

what is the tolerance of distance for contact in Bullet?

Posted: Thu Mar 31, 2011 2:39 pm
by Xuhai.Tang
If the distance between two objects is 0.0, the two objects are contact. But in numerical method there is no perfect 0.0.

So, what is the tolerance of distance in Bullet?

Sorry for my poor English.

Re: what is the tolerance of distance for contact in Bullet?

Posted: Thu Mar 31, 2011 4:44 pm
by Erwin Coumans
Contact points can be added even if the distance is positive. The constraint solver can deal with contacts with positive distances as well as negative (penetration). Contact points are discarded if the distance exceeds a certain threshold.

Bullet has a contact processing threshold and a contact breaking threshold.
If the distance is larger than the contact breaking threshold, it will be removed after one frame.
If the distance is larger than the contact processing threshold, the constraint solver will ignore it.

This is separate/independent from the collision margin. The collision margin increases the object a bit to improve collision detection performance and accuracy.

Again, thanks for bringing up this complicated topic, unfortunately it is not well documented.
Thanks,
Erwin

Re: what is the tolerance of distance for contact in Bullet?

Posted: Fri Apr 01, 2011 2:15 pm
by Xuhai.Tang
Erwin Coumans wrote:Contact points can be added even if the distance is positive. The constraint solver can deal with contacts with positive distances as well as negative (penetration). Contact points are discarded if the distance exceeds a certain threshold.

Bullet has a contact processing threshold and a contact breaking threshold.
If the distance is larger than the contact breaking threshold, it will be removed after one frame.
If the distance is larger than the contact processing threshold, the constraint solver will ignore it.

This is separate/independent from the collision margin. The collision margin increases the object a bit to improve collision detection performance and accuracy.

Again, thanks for bringing up this complicated topic, unfortunately it is not well documented.
Thanks,
Erwin
Erwin, thank you.
I have three more short questions:
(1) How can I read the current value of my object's "collision margin"?
(2) Is the collision margin an absolute or relative number?
(3) Can I edit the value of the collision margin?

Thanks in advance,
Xuhai

Re: what is the tolerance of distance for contact in Bullet?

Posted: Fri Apr 01, 2011 6:10 pm
by Erwin Coumans
The collision margin can be set/get by the user using btCollisionShape::getMargin/setMargin

This margin is a absolute value, by default it is 0.04 units for convex objects. Assuming 1 unit = 1 meter, this means 4 centimeter.
The handling of the collision margin differs dependent on the type of collision shape.
Most implicit convex shapes, such as btSphereShape, btBoxShape embed this margin.
The convex hull shape extends the shape with the margin. To compensate for this you can scale the graphics object, or shrink the btConvexHull.
See for example: http://code.google.com/p/bullet/source/ ... mo.cpp#299

Thanks,
Erwin

Re: what is the tolerance of distance for contact in Bullet?

Posted: Thu Jun 23, 2011 4:41 pm
by shadiq
This is really valuable for us.........

Re: what is the tolerance of distance for contact in Bullet?

Posted: Mon Jul 04, 2011 12:26 pm
by Xuhai.Tang
Erwin, thank you for your promptly reply.

Xuhai

Erwin Coumans wrote:The collision margin can be set/get by the user using btCollisionShape::getMargin/setMargin

This margin is a absolute value, by default it is 0.04 units for convex objects. Assuming 1 unit = 1 meter, this means 4 centimeter.
The handling of the collision margin differs dependent on the type of collision shape.
Most implicit convex shapes, such as btSphereShape, btBoxShape embed this margin.
The convex hull shape extends the shape with the margin. To compensate for this you can scale the graphics object, or shrink the btConvexHull.
See for example: http://code.google.com/p/bullet/source/ ... mo.cpp#299

Thanks,
Erwin

Re: what is the tolerance of distance for contact in Bullet?

Posted: Fri Sep 18, 2015 3:27 pm
by nictosi
Erwin Coumans wrote:Contact points can be added even if the distance is positive. The constraint solver can deal with contacts with positive distances as well as negative (penetration). Contact points are discarded if the distance exceeds a certain threshold.

Bullet has a contact processing threshold and a contact breaking threshold.
If the distance is larger than the contact breaking threshold, it will be removed after one frame.
If the distance is larger than the contact processing threshold, the constraint solver will ignore it.

This is separate/independent from the collision margin. The collision margin increases the object a bit to improve collision detection performance and accuracy.

Again, thanks for bringing up this complicated topic, unfortunately it is not well documented.
Thanks,
Erwin

Thanks a lot Erwin.

If I need to keep at least a minimum distance d between two collision objects, shall I set the breaking threshold to d or rather the margin to d?