Expand description
Original, dependency-free scalar game mathematics.
Vectors use f32; angles are radians. Matrices are column-major and multiply
column vectors. a * b applies b before a. Rotation is right-handed.
Explicit try_* operations report degenerate inputs; unchecked normalization
and inversion return NaNs instead of silently substituting another transform.
Modules§
- affine
- Checked, reusable affine point, vector and normal transformation.
- curves
- Checked cubic Bezier authoring with allocation-free, bounded tessellation.
- deterministic
- Explicit arithmetic for simulation that must avoid platform libm variation. These helpers do not make an entire game deterministic by themselves.
- prelude
- Frequently used types and constructor functions.
- projection
- Prepared, viewport-aware 3D projection and finite picking rays.
- segments
- Checked closest witnesses for finite 2D and 3D segments.
Structs§
- BVec2
- BVec3
- BVec4
- Color
- Unpremultiplied RGBA floating-point channels. No implicit gamma conversion.
- Mat4
- Column-major 4x4 matrix acting on column vectors:
translation * rotation * scale. - Quat
- Quaternion stored as vector part
(x,y,z)followed by scalar partw. - Rect
- Axis-aligned 2D rectangle. Width and height should be nonnegative.
- Swing
Twist - Checked factorization of a rotation into
swing * twist(twist acts first). - Vec2
- Vec3
- Vec4
Enums§
- Color
Error - Failure from checked color authoring or transfer conversion.
- Euler
Rot - Intrinsic Euler rotations:
XYZ(a,b,c)composesRx(a) * Ry(b) * Rz(c). - Matrix
Error - Failure from a checked matrix operation. No fallback transform is substituted.
Traits§
- Vec2
Swizzles - Compatibility imports: common swizzles are inherent methods.
- Vec3
Swizzles - Vec4
Swizzles