NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #682 most downloaded on crates.io
A simple and fast 3D math library for games and graphics
Last release 4 days ago
27 Sep 2026
Release timing varies
gaps range from 1 weeks to 3 months
Nearly every release is documented
notes for 59 of the last 60 stable releases
2 versions withdrawn
withdrawn after publishing
7 years old
96 releases · first in 2019
Minimum Supported Version of Rust bumped to 1.45.0 for the spirv-std dependency.
spirv-std
dependency.AXES[] constants to all vector types. These are arrays containing the
unit vector for each axis.from_scaled_axis and to_scaled_axis methods.bytemuck to 1.5, rand to 0.8,
rand_xoshiro to 0.6 and spirv-std to 0.4.0-alpha4.Added vector clamp() functions.
clamp() functions.col() and row().spirv-std for the SPIR-V target.From impls.One column per quarter.
Deprecated ::unit_x/y/z(), ::zero(), ::one(), ::identity() functions in favor of constants.
transform_point3() was changed to not
perform the perspective divide. This is an optimization for use with affine
transforms where perspective correction is not required. The
project_point3() method was added for transforming points by perspective
projections.from_scale() method was changed to
create a affine transform containing a 2-dimensional non-uniform scale to be
consistent with the 4x4 matrix version. The
from_diagonal() method can be used to create a 3x3 scale matrix.transform_point2_as_vec3a,
transform_vector2_as_vec3a and mul_vec3_as_vec3a were unintentionally
pub and are no longer publicly accessible.Vec2::X, Vec4::W etc constants as a shorter versions of unit_x()
and friends.ONE constants for vectors.IDENTITY constants for Mat2, Mat3, Mat4 and Quat.ZERO constant for vectors and matrices.clamp_length(), clamp_length_max(), and clamp_length_min methods
for f32 and f64 vector types.try_normalize() and normalize_or_zero() for all real vector types.from_diagonal() methods to all matrix types for creating diagonal
matrices from a vector.angle_between(), from_rotation_arc() and
from_rotation_arc_colinear() to quaternion types.inverse() which assumes the quaternion is already
normalized and returns the conjugate.from_translation() and from_angle() methods to 3x3 matrix types.project_point3() method to 4x4 matrix types. This method is for
transforming 3D vectors by perspective projection transforms.Eq and Hash impls for integer vector types.::unit_x/y/z(), ::zero(), ::one(), ::identity() functions
in favor of constants.Vec2Mask, Vec3Mask and Vec4Mask have been replaced by BVec2, BVec3, BVec3A, BVec4 and BVec4A. These types are used by some vector methods and are not
Vec2Mask, Vec3Mask and Vec4Mask have been replaced by BVec2, BVec3,
BVec3A, BVec4 and BVec4A. These types are used by some vector methods
and are not typically referenced directly.f64 primitive type support
DVec2, DVec3 and DVec4DMat2, DMat3 and DMat4DQuati32 primitive type support
IVec2, IVec3 and IVec4u32 primitive type support
UVec2, UVec3 and UVec4bool primitive type support
BVec2, BVec3 and BVec4build.rs has been removed.~1900 changes, numerous bugfixes
Highlights
std have been reviewed and updated for
consistency with the in-development Rust coding
guidelines. The standard library documentation tracks
stabilization progress.Language
Index and IndexMut
traits.if let construct takes a branch only if the let pattern
matches, currently behind the 'if_let' feature gate.[0..4]) has been introduced behind
the 'slicing_syntax' feature gate, and can be overloaded with
the Slice or SliceMut traits... instead of prefix (.e.g. [a, b, c..]), for
consistency with other uses of .. and to future-proof
potential additional uses of the syntax.0..3 to 0...4 to be consistent with the exclusive range
syntax for slicing.[a.., b, c]) has been put behind the 'advanced_slice_patterns' feature
gate and may be removed in the future.value.0 syntax, currently behind the tuple_indexing
feature gate.#[crate_id] attribute is no longer supported; versioning
is handled by the package manager.extern crate foo as bar
instead of extern crate bar = foo.use foo as bar instead
of use bar = foo.let and match bindings and argument names in macros are now
hygienic.move has been added as a keyword, for indicating closures
that capture by value.Share trait is now called Sync to free up the term
'shared' to refer to 'shared reference' (the default reference
type.Sized trait has been
introduced, which qualifying types implement by default, and
which type parameters expect by default. To specify that a type
parameter does not need to be sized, write <Sized? T>. Most
types are Sized, notable exceptions being unsized arrays
([T]) and trait types.!, as in || -> ! or proc() -> !.Gc<T> which was once
denoted by the @ sigil, has finally been removed. GC will be
revisited in the future.Libraries
std::time::Duration type has been added for use in I/O
methods that rely on timers, as well as in the 'time' crate's
Timespec arithmetic.collections::btree has been rewritten to have a more
idiomatic and efficient design.Tooling
--crate-name flag can specify the name of the crate
being compiled, like #[crate_name].-C metadata specifies additional metadata to hash into
symbol names, and -C extra-filename specifies additional
information to put into the output filename, for use by the
package manager for versioning.-C codegen-units flag.Misc
Made Vec3 repr(simd) for spirv targets.
Vec3 repr(simd) for spirv targets.From<(Vec2, f32)> for Vec3 and From<(Vec3, f32) for Vec4.Compilation fixes for Rust 1.36.0.
Added support for the Rust GPU SPIR-V target architecture.
Removed deprecated accessor methods.
is_finite method to all types which returns true if, and only if,
all contained elements are finite.exp and powf methods for all vector types.is_nan method now returns a bool to match the new is_finite method
and to be consistent with the same methods on the f32 and f64 primitive
types.is_nan which returns a vector mask to is_nan_mask.cfg definitions added by build.rs for defining structs as
rust-analyzer is not aware of them.~1700 changes, numerous bugfixes
Language
uint
instead of any integral type.b.<'a>|A, B|: 'b + K -> Tpriv keyword has been removed from the language.use foo, bar, baz; syntax has been removed from the language.int, and floating point
literals no longer default to f64. Literals must be suffixed with an
appropriate type if inference cannot determine the type of the
literal.Libraries
rev() on
their forward-iteration counterparts.--cfg ndebug is passed to the compiler.Tooling
[breaking-change] to allow for easy
discovery of breaking changes.mod foo;.pub use has been greatly improved.Deprecated element accessor members .x(), .x_mut(), .set_x(), etc. on vector and quaternion types.
.x(), .x_mut(), .set_x(), etc. on
vector and quaternion types..x_axis(), .x_axis_mut(),
.set_x_axis(), etc. on matrix types.Removed deprecated length_reciprocal and sign methods.
Vec2::perp method which returns a Vec2 perpendicular to self.Vec2 and Vec3 types were changed to use public named fields for .x,
.y, and .z instead of accessors.Quat, Vec3A and Vec4 implement Deref and DerefMut for the new XYZ
and XYZW structs to emulate public named field access.Mat3 and Mat4 had their axis members made public instead of needing
accessors.Mat2 implements Deref and DerefMut for the new XYAxes struct to
emulate public named field access.length_reciprocal and sign methods.glam as a no_std dependency should now work as expected.Changed the return type of Vec4::truncate from Vec3A to Vec3.
Vec4::truncate from Vec3A to Vec3.From implementations to truncate to narrower vector types, e.g.
Vec4 to Vec3A, Vec3 and Vec2 and from Vec3A and Vec3 to Vec2.Vec4, Vec3A, Vec3 and Vec2. These can be used to
reorder elements in the same type and also to create larger or smaller
vectors from the given vectors elements.Quat operators Add<Quat>, Sub<Quat>, Mul<f32> and Div<f32.
These are used by other crates for interpolation quaternions along splines.
Note that these operations will not return unit length quaternions, thus the
results must be normalized before performing other Quat operations.Mat4::transform_point3a and Mat4::transform_vector3a.AsRef<[f32; 9]> and AsMut<[f32; 9]> trait implementations to Mat3.bytemuck support primarily for casting types to &[u8].no_std by disabling the default std
feature and adding the libm feature.distance and distance_squared methods to Vec2, Vec3, Vec3A
and Vec4.glam uses SSE2 for some types which prevents constructor functions can not be made const fn. To work around this limitation the following macro functi
glam uses SSE2 for some types which prevents constructor functions can not
be made const fn. To work around this limitation the following macro
functions have been added to support creating const values of glam types:
const_mat2, const_mat3, const_mat4, const_quat, const_vec2,
const_vec3, const_vec3a and const_vec4.is_nan methods to Vec2, Vec3, Vec3A and Vec4 which return a
mask.Fixed Mat4::transform_point3 to account for homogeneous w coordinate. Previously this would have been incorrect when the resulting homogeneous coordin
Mat4::transform_point3 to account for homogeneous w coordinate.
Previously this would have been incorrect when the resulting homogeneous
coordinate was not 1.0, e.g. when transforming by a perspective projection.Mat3::transform_point2 to account for homogeneous z coordinate.### Added - Added Mat4::perspective_rh.
Mat4::perspective_rh.Added Mat3::mul_vec3a and Quat::mul_vec3a.
Mat3::mul_vec3a and Quat::mul_vec3a.Quat::mul_vec3 to accept and return Vec3 instead of Vec3A.Added Mat3 * Vec3A implementation.
Mat3 * Vec3A implementation.Vec3A benches.Vec3A type.Vec3 has been split into scalar Vec3 and 16 byte aligned Vec3A types. Only the Vec3A type currently uses SIMD optimizations.
Vec3 has been split into scalar Vec3 and 16 byte aligned Vec3A types.
Only the Vec3A type currently uses SIMD optimizations.Vec3Mask has been split into scalar Vec3Mask and 16 byte aligned
Vec3AMask types.mut column accessors to all matrix types, e.g. Mat2::x_axis_mut().From trait implementations for Vec3AMask and Vec4Mask to __m128.Mat3 type is using the scalar Vec3 type for storage.Debug trait output for Quat, Vec4 and Vec3A.Added Quat::slerp - note that this uses a sin approximation.
Quat::slerp - note that this uses a sin approximation.angle_between method for Vec2 and Vec3.Debug, Display, PartialEq, Eq, PartialOrd, Ord,
Hash, and AsRef traits for Vec2Mask, Vec3Mask and Vec4Mask.Vec2Mask, Vec3Mask and Vec4Mask to an
array of [u32].build.rs to simplify conditional feature compilation.cfg-if dependency.Added the packed-vec3 feature flag to disable using SIMD types for Vec3 and Mat3 types. This avoids wasting some space due to 16 byte alignment at the
packed-vec3 feature flag to disable using SIMD types for Vec3
and Mat3 types. This avoids wasting some space due to 16 byte alignment at
the cost of some performance.x_mut, y_mut, z_mut, w_mut where appropriate to Vec2, Vec3
and Vec4.core::ops::Index and core::ops::IndexMut for
Vec2, Vec3 and Vec4.Vec3 and Vec4 implementations into single files
using the cfg-if crate.Added projection functions Mat4::perspective_lh, Mat4::perspective_infinite_lh, Mat4::perspective_infinite_reverse_lh, Mat4::orthgraphic_lh and Mat4::
Mat4::perspective_lh,
Mat4::perspective_infinite_lh, Mat4::perspective_infinite_reverse_lh,
Mat4::orthgraphic_lh and Mat4::orthographic_rh.round, ceil and floor methods to Vec2, Vec3 and Vec4.Added Mat4::to_scale_rotation_translation for extracting scale, rotation and translation from a 4x4 homogeneous transformation matrix.
Mat4::to_scale_rotation_translation for extracting scale, rotation and
translation from a 4x4 homogeneous transformation matrix.cargo-deny GitHub Action.Quat::new to Quat::from_xyzw.Removed deprecated functions Mat2::new, Mat3::new and Mat4::new.
Mat4::orthographic_rh_gl.Mat4::perspective_glu_rh to Mat4::perspective_rh_gl.Mat2::determinant, Mat2::inverse,
Mat2::transpose, Mat3::transpose, Quat::conjugate, Quat::lerp,
Quat::mul_vec3, Quat::mul_quat and Quat::from_rotation_ypr.Mat4::transform_point3 and
Mat4::transform_vector3 as they are probably incorrect and need
investigating.#[repr(C)] to Mat2, Mat3 and Mat4.Mat2::new, Mat3::new and Mat4::new.glam_assert! is no longer enabled by default in debug builds, it can be enabled in any configuration using the glam-assert feature or in debug builds
glam_assert! is no longer enabled by default in debug builds, it can be
enabled in any configuration using the glam-assert feature or in debug
builds only using the debug-glam-assert feature.glam_assert!'s checking lerp is bounded between 0.0 and 1.0 and that
matrix scales are non-zero have been removed.Added Display trait implementations for Mat2, Mat3 and Mat4.
Display trait implementations for Mat2, Mat3 and Mat4.glam's SSE2 sin_cos implementation - it became less precise for
large angle values.is_normalized! macro from
std::f32::EPSILON to 1e-6.Removed the deprecated Vec2b, Vec3b and Vec4b types and the mask methods on Vec2Mask, Vec3Mask and Vec4Mask.
approx crate dependency. Each glam type has an abs_diff_eq
method added which is used by unit tests for approximate floating point
comparisons.Angle type. All angles are now f32 and are expected to
be in radians.Vec2b, Vec3b and Vec4b types and the mask
methods on Vec2Mask, Vec3Mask and Vec4Mask.rand crate dependency has been removed from default features. This was
required for benchmarking but a simple random number generator has been added
to the benches support module instead.From trait implementation converting between 1D and 2D f32 arrays and
matrix types have been removed. It was ambiguous how array data would map to
matrix columns so these have been replaced with explicit methods
from_cols_array and from_cols_array_2d.new methods have been renamed to from_cols to be consistent with
the other methods that create matrices from data.Mat4::perspective_glu to Mat4::perspective_glu_rh.Fixed incorrect projection matrix methods Mat4::look_at_lh and Mat4::look_at_rh.
Mat4::look_at_lh
and Mat4::look_at_rh.Mat4::perspective_infinite_rh and
Mat4::perspective_infinite_rh.Vec2Mask::new, Vec3Mask::new and Vec4Mask::new methods.std::ops BitAnd, BitAndAssign, BitOr, BitOrAssign
and Not traits for Vec2Mask, Vec3Mask and Vec4Mask.Vec4 and Vec4Mask types.serde implementations for Mat2, Mat3 and Mat4.rand and criterion versions.Renamed Vec2b to Vec2Mask, Vec3b to Vec3Mask and Vec4b to Vec4Mask. Old names are aliased to the new name and deprecated.
Vec4 dot was missing a shuffle, meaning the
dot, length, length_squared, length_reciprocal and normalize
methods were sometimes incorrect.glam_assert macro which behaves like Rust's debug_assert but
can be enabled separately to debug_assert. This is used to perform
asserts on correctness.is_normalized method to Vec2, Vec3 and Vec4.std::mem::uninitialized with std::mem::MaybeUninit. This
change requires stable Rust 1.36.Vec2b to Vec2Mask, Vec3b to Vec3Mask and Vec4b to
Vec4Mask. Old names are aliased to the new name and deprecated.VecNMask mask method, use new bitmask method insteadVecNMask types the same size and alignment as the
SIMD versions.Default support to VecNMask types, will add more common traits in
the future.#[inline] to mat2, mat3 and mat4 functions.Added Mat2 into [f32; 4], Mat3 into [f32; 9] and Mat4 into [f32; 16].
Mat2 into [f32; 4], Mat3 into [f32; 9] and Mat4 into
[f32; 16].impl Mul<&Vec2> for Mat2 and impl Mul<&Vec3> for Vec3 as these
don't exist for any other types.Mat2 now uses a Vec4 internally which gives it some performance improvements when SSE2 is available.
Mat2 now uses a Vec4 internally which gives it some performance
improvements when SSE2 is available.Switched from row vectors to column vectors
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →