src/collisions/contact-calculation/src/capsule-contact-calculation.js
function capsuleVsCapsule(contactPoint, contactNormal, capsuleA, capsuleB) {
  findClosestPointsFromSegmentToSegment(tmpVec1, tmpVec2,
      capsuleA.segment, capsuleB.segment);
  vec3.subtract(contactNormal, tmpVec2, tmpVec1);
  vec3.normalize(contactNormal, contactNormal);
  vec3.scaleAndAdd(contactPoint, tmpVec1, contactNormal, capsuleA.radius);
}
function capsuleVsCapsule(contactPoint, contactNormal, capsuleA, capsuleB) {
  findClosestPointsFromSegmentToSegment(tmpVec1, tmpVec2,
      capsuleA.segment, capsuleB.segment);
  vec3.subtract(contactNormal, tmpVec2, tmpVec1);
  vec3.normalize(contactNormal, contactNormal);
  vec3.scaleAndAdd(contactPoint, tmpVec1, contactNormal, capsuleA.radius);
}
function capsuleVsCapsule ( contactPoint , contactNormal , capsuleA , capsuleB ) { findClosestPointsFromSegmentToSegment ( tmpVec1 , tmpVec2 , capsuleA . segment , capsuleB . segment ) ; vec3 . subtract ( contactNormal , tmpVec2 , tmpVec1 ) ; vec3 . normalize ( contactNormal , contactNormal ) ; vec3 . scaleAndAdd ( contactPoint , tmpVec1 , contactNormal , capsuleA . radius ) ; }
Finds the closest point on the surface of capsule A to capsule B.

@param {vec3} contactPoint Output param.
@param {vec3} contactNormal Output param.
@param {Capsule} capsuleA
@param {Capsule} capsuleB
Finds the closest point on the surface of capsule A to capsule B .