25 m_contactBreakingThreshold(contactBreakingThreshold)
50 btVector3 pointOnA = transformB*point+normalOnB*depth;
84 return diff.
dot(diff);
100 btScalar radiusWithThreshold = radius + contactBreakingThreshold;
102 btVector3 normal = (vertices[1]-vertices[0]).
cross(vertices[2]-vertices[0]);
104 btVector3 p1ToCentre = sphereCenter - vertices[0];
105 btScalar distanceFromPlane = p1ToCentre.
dot(normal);
107 if (distanceFromPlane <
btScalar(0.))
114 bool isInsideContactPlane = distanceFromPlane < radiusWithThreshold;
117 bool hasContact =
false;
119 if (isInsideContactPlane) {
123 contactPoint = sphereCenter - normal*distanceFromPlane;
126 btScalar contactCapsuleRadiusSqr = radiusWithThreshold*radiusWithThreshold;
136 if (distanceSqr < contactCapsuleRadiusSqr) {
139 contactPoint = nearestOnEdge;
147 btVector3 contactToCentre = sphereCenter - contactPoint;
150 if (distanceSqr < radiusWithThreshold*radiusWithThreshold)
155 resultNormal = contactToCentre;
157 point = contactPoint;
158 depth = -(radius-distance);
161 resultNormal = normal;
162 point = contactPoint;
192 r1 = edge1_normal.
dot( p1_to_p );
193 r2 = edge2_normal.dot( p2_to_p );
194 r3 = edge3_normal.dot( p3_to_p );
195 if ( ( r1 > 0 && r2 > 0 && r3 > 0 ) ||
196 ( r1 <= 0 && r2 <= 0 && r3 <= 0 ) )