non-gon
    Preparing search index...

    Function rectangleIntersection

    • Determines whether the rectangular projections of the end caps of two cylinders intersect in the plane defined by a common normal. This function applies a Separating Axis Theorem (SAT) based test using computed intersection points.

      The rectangles are formed by slicing each cylinder with a plane perpendicular to the shortest vector between their axes and checking whether the resulting cross-sections overlap.

      Parameters

      • u: number

        Distance along the common normal from cylinder1's center to its slicing plane.

      • w: number

        Distance along the common normal from cylinder2's center to its slicing plane.

      • cylinder1: Cylinder

        The first cylinder object.

      • cylinder2: Cylinder

        The second cylinder object.

      • s1: number

        Half-height of the first cylinder.

      • s2: number

        Half-height of the second cylinder.

      • commonNormal: Vector3

        The shortest vector between the axes of the two cylinders.

      • r1: number

        Radius of the first cylinder.

      • r2: number

        Radius of the second cylinder.

      Returns boolean

      True if the projected rectangles intersect, false otherwise.

      • Uses FindIntersectionPoints to compute intersections between planes and cylinder end-caps.
      • Applies Separating Axis Test (SAT) via RectanglesIntersect to determine overlap.
      • Returns false if any of the intersection point sets are invalid or incomplete.