crashcat docs
    Preparing search index...

    Function gjkClosestPoints

    • Get closest points between two convex shapes using GJK.

      Parameters

      • out: GjkClosestPoints

        output object containing pointA, pointB, squaredDistance, penetrationAxis, and simplex. On output: - squaredDistance = 0: shapes are colliding - squaredDistance > 0 && < Number.MAX_VALUE: shapes separated, penetrationAxis is separating axis - squaredDistance = Number.MAX_VALUE: shapes far apart (exceeded maxDistanceSquared)

      • supportA: Support

        pre-configured support function for shape A

      • supportB: Support

        pre-configured support function for shape B

      • tolerance: number

        minimal distance between A and B before the objects are considered colliding

      • direction: Vec3

        initial guess for the separating axis

      • maxDistanceSquared: number

        maximum squared distance between A and B before objects are considered infinitely far away. If exceeded, out.squaredDistance will be set to Number.MAX_VALUE

      Returns void