ConvexLineIntersection

public enum ConvexLineIntersection<Vector> where Vector : VectorType
extension ConvexLineIntersection: Equatable where Vector: Equatable
extension ConvexLineIntersection: Hashable where Vector: Hashable

The result of a convex-line intersection test.

  • Represents the case where the line’s boundaries are completely contained within the bounds of the convex shape.

    Declaration

    Swift

    case contained
  • Represents the case where the line crosses the bounds of the convex shape on a single vertex, or tangentially, in case of spheroids.

    Declaration

    Swift

    case singlePoint(PointNormal<Vector>)
  • Represents cases where the line starts outside the shape and crosses in before ending within the shape’s bounds.

    Declaration

    Swift

    case enter(PointNormal<Vector>)
  • Represents cases where the line starts within the convex shape and intersects the boundaries on the way out.

    Declaration

    Swift

    case exit(PointNormal<Vector>)
  • Represents cases where the line crosses the convex shape twice: Once on the way in, and once again on the way out.

    Declaration

    Swift

    case enterExit(PointNormal<Vector>, PointNormal<Vector>)
  • Represents the case where no intersection occurs at any point.

    Declaration

    Swift

    case noIntersection
  • Returns a new ConvexLineIntersection where any PointNormal value is mapped by a provided closure before being stored back into the same enum case and returned.

    Declaration

    Swift

    public func mappingPointNormals(_ mapper: (PointNormal<Vector>, PointNormalKind) -> PointNormal<Vector>) -> ConvexLineIntersection<Vector>
  • Returns a new ConvexLineIntersection where any PointNormal value is replaced by a provided closure before being stored back into the same enum case and returned.

    Declaration

    Swift

    public func replacingPointNormals<NewVector>(_ mapper: (PointNormal<Vector>, PointNormalKind) -> PointNormal<NewVector>) -> ConvexLineIntersection<NewVector> where NewVector : VectorType
  • Parameter passed along point normals in mappingPointNormals(_:) and replacingPointNormals(_:) to specify to the closure which kind of point normal was provided.

    See more

    Declaration

    Swift

    public enum PointNormalKind