Module macroquad::math[][src]

Math types and helpers.

Consists of re-exported glam types with some additions.

Modules

swizzles

Macros

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_quat

Creates a Quat from x, y, z and w values 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_vec3a

Creates a Vec3A that can be used to initialize a constant value.

const_vec4

Creates a Vec4 that can be used to initialize a constant value.

Structs

Mat2
Mat3

A 3x3 column major matrix.

Mat4

A 4x4 column major matrix.

Quat
Rect
Vec2

A 2-dimensional vector.

Vec2Mask

A 2-dimensional vector mask.

Vec3

A 3-dimensional vector without SIMD support.

Vec3A
Vec3AMask

A 3-dimensional vector mask.

Vec3Mask

A 3-dimensional vector mask.

Vec4

A 4-dimensional vector.

Vec4Mask

Traits

Vec2Swizzles
Vec3ASwizzles
Vec3Swizzles
Vec4Swizzles

Functions

cartesian_to_polar

Converts 2d cartesian coordinates to 2d polar coordinates.

clamp

Returns value, bounded in range [min, max].

mat2

Creates a Mat2 from two column vectors.

mat3

Creates a Mat3 from three column vectors.

mat4

Creates a Mat4 from four column vectors.

polar_to_cartesian

Converts 2d polar coordinates to 2d cartesian coordinates.

quat

Creates a Quat from x, y, z and w values.

vec2

Creates a Vec2.

vec3

Creates a Vec3.

vec3a

Creates a Vec3.

vec4

Creates a Vec4.