30 class ClosestPointsSolution;
35 namespace ShapeColliders {
159 const ClosestPointsSolution& closest,
172 bool createOnlyForCyl1InCyl2 =
false);
196 agx::Physics::Geometry::ShapeInstance shape1,
197 agx::Physics::Geometry::ShapeInstance shape2,
226 const agx::Vec3 p1 = cap1 * capsuleTransform;
227 const agx::Vec3 p2 = cap2 * capsuleTransform;
234 if (d1 <= capsuleRadius) {
236 const agx::Real depth = capsuleRadius - d1;
238 ShapeCollider::addContactPoint( result, point, normal * normalFlipSign, depth );
242 if (d2 <= capsuleRadius) {
244 const agx::Real depth = capsuleRadius - d2;
246 ShapeCollider::addContactPoint( result, point, normal * normalFlipSign, depth );
259 const agx::Real radiusSum = radius1 + radius2;
260 agx::Vec3 normal = position1 - position2;
263 if (radiusSum * radiusSum < len2) {
267 if ((radiusSum + epsilon) * (radiusSum + epsilon) < len2)
273 ShapeCollider::addContactPoint( result,
274 position2 + normal * radius2, normal,
agx::Real(0) );
289 const agx::Real depth = radiusSum - distance;
291 ShapeCollider::addContactPoint( result,
292 position2 + normal * (radius2 - depth *
agx::Real(0.5)),
306 if (distance > sphereRadius)
309 const agx::Real depth = sphereRadius - distance;
310 ShapeCollider::addContactPoint( result, spherePosition +
311 normal * (depth *
agx::Real(0.5) - sphereRadius), normal, depth );