Skip to main content

Module math

Module math 

Source
Expand description

Math types and helpers.

Consists of re-exported glam types with some additions.

Modules§

bool
bool vector mask types.
f32
f32 vector, quaternion and matrix types.
f64
f64 vector, quaternion and matrix types.
i32
i32 vector types.
swizzles
Traits adding swizzle methods to all vector types.
u32
u32 vector types.

Macros§

const_dmat2
Creates a DMat2 from two column vectors that can be used to initialize a constant value.
const_dmat3
Creates a DMat3 from three column vectors that can be used to initialize a constant value.
const_dmat4
Creates a DMat4 from four column vectors that can be used to initialize a constant value.
const_dquat
Creates a DQuat from x, y, z and w values that can be used to initialize a constant value.
const_dvec2
Creates a DVec2 that can be used to initialize a constant value.
const_dvec3
Creates a DVec3 that can be used to initialize a constant value.
const_dvec4
Creates a DVec4 that can be used to initialize a constant value.
const_ivec2
Creates a IVec2 that can be used to initialize a constant value.
const_ivec3
Creates a IVec3 that can be used to initialize a constant value.
const_ivec4
Creates a IVec4 that can be used to initialize a constant value.
const_m128
const_mat2
Creates a Mat2 from two column vectors that can be used to initialize a constant value.
const_mat3
Creates a Mat3 from three column vectors that can be used to initialize a constant value.
const_mat4
Creates a Mat4 from four column vectors that can be used to initialize a constant value.
const_mat3a
Creates a Mat3A from three column vectors that can be used to initialize a constant value.
const_quat
Creates a Quat from x, y, z and w values that can be used to initialize a constant value.
const_uvec2
Creates a UVec2 that can be used to initialize a constant value.
const_uvec3
Creates a UVec3 that can be used to initialize a constant value.
const_uvec4
Creates a UVec4 that can be used to initialize a constant value.
const_vec2
Creates a Vec2 that can be used to initialize a constant value.
const_vec3
Creates a Vec3 that can be used to initialize a constant value.
const_vec4
Creates a Vec4 that can be used to initialize a constant value.
const_vec3a
Creates a Vec3A that can be used to initialize a constant value.

Structs§

Affine2
A 2D affine transform, which can represent translation, rotation, scaling and shear.
Affine3A
A 3D affine transform, which can represent translation, rotation, scaling and shear.
BVec2
A 2-dimensional boolean vector.
BVec3
A 3-dimensional boolean vector.
BVec4
A 4-dimensional boolean vector.
Circle
DAffine2
A 2D affine transform, which can represent translation, rotation, scaling and shear.
DAffine3
A 3D affine transform, which can represent translation, rotation, scaling and shear.
DMat2
A 2x2 column major matrix.
DMat3
A 3x3 column major matrix.
DMat4
A 4x4 column major matrix.
DQuat
A quaternion representing an orientation.
DVec2
A 2-dimensional vector.
DVec3
A 3-dimensional vector.
DVec4
A 4-dimensional vector.
IVec2
A 2-dimensional vector.
IVec3
A 3-dimensional vector.
IVec4
A 4-dimensional vector.
Mat2
A 2x2 column major matrix.
Mat3
A 3x3 column major matrix.
Mat4
A 4x4 column major matrix.
Mat3A
A 3x3 column major matrix.
Quat
A quaternion representing an orientation.
Rect
A 2D rectangle, defined by its top-left corner, width and height.
RectOffset
UVec2
A 2-dimensional vector.
UVec3
A 3-dimensional vector.
UVec4
A 4-dimensional vector.
Vec2
A 2-dimensional vector.
Vec3
A 3-dimensional vector without SIMD support.
Vec4
A 4-dimensional vector.
Vec3A
A 3-dimensional vector with SIMD support.
XY
XYZ
XYZW

Enums§

EulerRot
Euler rotation sequences.

Traits§

Vec2Swizzles
Swizzle methods for 2-dimensional vector types.
Vec3Swizzles
Swizzle methods for 3-dimensional vector types.
Vec4Swizzles
Swizzle methods for 4-dimensional vector types.

Functions§

cartesian_to_polar
Converts 2d cartesian coordinates to 2d polar coordinates.
clamp
Returns value, bounded in range [min, max].
dmat2
Creates a 2x2 matrix from two column vectors.
dmat3
Creates a 3x3 matrix from three column vectors.
dmat4
Creates a 4x4 matrix from four column vectors.
dquat
Creates a quaternion from x, y, z and w values.
dvec2
Creates a 2-dimensional vector.
dvec3
Creates a 3-dimensional vector.
dvec4
Creates a 4-dimensional vector.
ivec2
Creates a 2-dimensional vector.
ivec3
Creates a 3-dimensional vector.
ivec4
Creates a 4-dimensional vector.
mat2
Creates a 2x2 matrix from two column vectors.
mat3
Creates a 3x3 matrix from three column vectors.
mat4
Creates a 4x4 matrix from four column vectors.
mat3a
Creates a 3x3 matrix from three column vectors.
polar_to_cartesian
Converts 2d polar coordinates to 2d cartesian coordinates.
quat
Creates a quaternion from x, y, z and w values.
uvec2
Creates a 2-dimensional vector.
uvec3
Creates a 3-dimensional vector.
uvec4
Creates a 4-dimensional vector.
vec2
Creates a 2-dimensional vector.
vec3
Creates a 3-dimensional vector.
vec4
Creates a 4-dimensional vector.
vec3a
Creates a 3-dimensional vector.

Type Aliases§

BVec3A
BVec4A