24 m_contactBreakingThreshold(contactBreakingThreshold)
47 btVector3 pointOnA = transformB * point + normalOnB * depth;
48 output.addContactPoint(normalOnA, pointOnA, depth);
52 output.addContactPoint(transformB.
getBasis() * normal, transformB * point, depth);
84 nearest = from + t * v;
85 return diff.
dot(diff);
101 btScalar radiusWithThreshold = radius + contactBreakingThreshold;
103 btVector3 normal = (vertices[1] - vertices[0]).cross(vertices[2] - vertices[0]);
106 bool hasContact =
false;
113 btVector3 p1ToCentre = sphereCenter - vertices[0];
114 btScalar distanceFromPlane = p1ToCentre.
dot(normal);
116 if (distanceFromPlane <
btScalar(0.))
123 bool isInsideContactPlane = distanceFromPlane < radiusWithThreshold;
127 if (isInsideContactPlane)
133 contactPoint = sphereCenter - normal * distanceFromPlane;
138 btScalar contactCapsuleRadiusSqr = radiusWithThreshold * radiusWithThreshold;
139 btScalar minDistSqr = contactCapsuleRadiusSqr;
149 if (distanceSqr < minDistSqr)
152 minDistSqr = distanceSqr;
154 contactPoint = nearestOnEdge;
163 btVector3 contactToCentre = sphereCenter - contactPoint;
166 if (distanceSqr < radiusWithThreshold * radiusWithThreshold)
171 resultNormal = contactToCentre;
173 point = contactPoint;
174 depth = -(radius - distance);
178 resultNormal = normal;
179 point = contactPoint;
208 r1 = edge1_normal.
dot(p1_to_p);
209 r2 = edge2_normal.dot(p2_to_p);
210 r3 = edge3_normal.dot(p3_to_p);
211 if ((r1 > 0 && r2 > 0 && r3 > 0) ||
212 (r1 <= 0 && r2 <= 0 && r3 <= 0))