Module math

Module math 

Source
Expand description

Math primitives for the Sable engine.

This module provides vector, matrix, and quaternion types optimized for game development and 3D graphics.

§Types

§Precision

By default, all types use f32. Enable the f64 feature for double precision.

Structs§

Mat3
A 3x3 column-major matrix.
Mat4
A 4x4 column-major matrix.
Quat
A quaternion for representing rotations.
Vec2
A 2D vector.
Vec3
A 3D vector.
Vec4
A 4D vector.

Constants§

EPSILON
A small epsilon value for floating-point comparisons.
PI
Pi constant.
TAU
Two times Pi.

Functions§

approx_eq
Checks if two floats are approximately equal.
clamp
Clamps a value between min and max.
degrees
Converts radians to degrees.
lerp
Linear interpolation between two values.
radians
Converts degrees to radians.

Type Aliases§

Float
The floating-point type used for math operations.