Module kas::geom

source ·
Expand description

Geometry data types

Coord, Size and Offset are all 2D integer (i32) types, representing positions, sizes and scroll deltas respectively.

Vec2 is a 2D floating-point (f32) type used mainly for screen-space position during rendering.

Conversions types mostly use Cast and Conv. From may be used to simply pack/unpack components. To convert from floating-point types to integer types, use CastApprox or CastFloat to specify the rounding mode.

Structs

  • A 2D coordinate, also known as a point
  • 2D vector (double precision)
  • A (x, y) offset, also known as a vector
  • Axis-aligned 2D cuboid, specified via two corners a and b
  • An axis-aligned rectangular region
  • A 2D size, also known as an extent
  • 2D vector
  • 3D vector