Module 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ยง

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