VolumetricType

public protocol VolumetricType : GeometricType

Protocol for geometric types that have an internal volumetric area that can be queried with Vectors for containment checks.

  • The comparable vector type associated with this VolumetricType.

    Declaration

    Swift

    associatedtype Vector : VectorComparable
  • Returns true iff vector lies within the ‘inside’ area of this volumetric shape.

    For 2D geometries this equates to querying against the inner area of the shape, and for 3D geometries the volume.

    Generalizes to any N-dimensional type.

    Declaration

    Swift

    func contains(_ vector: Vector) -> Bool

Available where Vector: Vector2Type

  • contains(x:y:) Extension method

    Returns true iff vector lies within the ‘inside’ area of this volumetric shape.

    Declaration

    Swift

    func contains(x: Vector.Scalar, y: Vector.Scalar) -> Bool

Available where Vector: Vector3Type

  • contains(x:y:z:) Extension method

    Returns true iff vector lies within the ‘inside’ volume of this volumetric shape.

    Declaration

    Swift

    func contains(x: Vector.Scalar, y: Vector.Scalar, z: Vector.Scalar) -> Bool