Skip to main content

Module primitives

Module primitives 

Source
Expand description

Core geometric primitives.

Provides fundamental 2D and 3D types used throughout the library.

§Design

Points and vectors are mathematically distinct: points live in affine space, vectors in linear space. Operator overloading enforces this:

  • Point - Point = Vector
  • Point + Vector = Point
  • Vector + Vector = Vector

Structs§

AABB2
A 2D axis-aligned bounding box.
AABB3
A 3D axis-aligned bounding box.
Point2
A 2D point.
Point3
A 3D point.
Segment2
A 2D line segment.
Vector2
A 2D vector.
Vector3
A 3D vector.