glam
A simple and fast 3D math library for games and graphics
0.33.5
126M downloads/mo
#705 most downloaded on crates.io
bitshifter/glam-rs
What this package is like to depend on
Last release 4 days ago
19 Aug 2026
Ships fairly regularly
a new release about every 3 weeks
Nearly every release is documented
notes for 81 of 88 stable releases
2 versions withdrawn
withdrawn after publishing
7 years old
90 releases · first in 2019
15 releases in the last 12 months
see the full history below
Release timeline
90 releases · May 2019 to Aug 2026Releases
latest 60 of 90-
0.33.519 Aug 2026 -
0.33.418 Aug 2026Release notes
Open source →Added
- Add serde serialize to
BVec3AandBVec4Awhenscalar-mathenabled. (#768)
Fixed
Changed
- Replace scalar
recip()calls with explicit division in vector implementations (#765)
Other
- Add serde serialize to
-
0.33.303 Aug 2026Release notes
Open source →Added
-
Added
Vec3::angle_towhich returns the signed angle (in radians) between two vectors around a given axis in the range[-π, +π]. The angle follows the right-hand rule around the axis and can be used withrotate_axis, e.g.self.rotate_axis(axis, self.angle_to(rhs, axis))will be equal torhs. -
Added
Vec2::rotate_anglewhich rotates a vector by an angle (in radians), equivalent toself.rotate(Vec2::from_angle(angle)). -
Added
glam_asserts thatangle_toandangle_betweeninputs are non-zero vectors.
Changed
to_arrayis now aconst fnon all quaternion types.
-
-
0.33.228 Jun 2026Release notes
Open source →Added
-
Added the
cameraanddcameramodules containing view and projection constructor functions organized by handedness and graphics API convention.The
viewsub-module provideslook_at_*andlook_to_*functions that returnMat4,Affine3,Affine3A,Mat3,Mat3A, orQuatview transforms.The
projsub-module provides API-specific constructors for OpenGL, DirectX and Vulkan conventions, each offeringperspective,perspective_infinite,perspective_infinite_reverse,orthographic, andfrustumconstructors for both left-handed and right-handed view spaces. -
Added a
preludemodule which re-exports all common types and traits but not camera modules. -
Added
slerp_longmethod to quaternion types, a spherical linear interpolation that preserves the rotation direction. -
Added
is_negative_maskmethod to all signed vector types which returns a boolean mask vector indicating which components have a negative sign.
Changed
- View and projection constructors (
look_at_*,look_to_*,perspective_*,orthographic_*,frustum_*) have been moved off matrix, affine and quaternion types into thecamera/dcameramodules as free functions. The existing methods on those types have been deprecated.
-
-
0.33.106 Jun 2026Release notes
Open source →Changed
-
Changed vector
mapmethod constraint fromFntoFnMut, allowing closures that mutate their captured state. -
Clarified documentation for
any_orthogonal_pairmethod to specify it produces a right-handed basis.
-
-
0.33.021 May 2026Release notes
Open source →Breaking changes
-
All types apart from
f32andbooltypes are now optional but enabled by default. Unused types can be disabled to improve compile times. -
Added
#[must_use]attribute toas_dmat2,as_dmat3andas_dmat4vector methods.
-
-
0.32.106 Mar 2026Release notes
Open source →Fixed
- Fixed the implementation of dividing a scalar value by a matrix. This was
actually dividing the matrix by the scalar value, with this fix
1.0/m == m.recip()is now true.
Added
- Added matrix
recip()method which returns a new matrix containing the reciprocal of each element of the source matrix.
- Fixed the implementation of dividing a scalar value by a matrix. This was
actually dividing the matrix by the scalar value, with this fix
-
0.32.011 Feb 2026 -
0.31.111 Feb 2026Release notes
Open source →Added
-
Added
isizevector typesISizeVec2,ISizeVec3andISizeVec4. -
Added
wasm64-unknown-unknownsupport. Thewasm64-unknown-unknowntarget uses the samesimd128instructions aswasm32. Note thatwasm64-unknown-unknownrequires anightlytoolchain.
Changed
- The
USES_WASM32_SIMDconstant on vector types has been renamed toUSES_WASM_SIMD,USES_WASM32_SIMDhas been deprecated.
-
-
0.31.021 Jan 2026Release notes
Open source →Breaking changes
-
The signature of
Quat::from_affine3(&Affine3A)was changed toQuat::from_affine3(&Affine3)with the addition of theAffine3type. -
Removed deprecated
Vec2andDVec2angle_betweenmethods. -
Consistently use
&selffor matrix and affine type methods andselffor vector, quat and mask types.
Added
-
Added
Affine3type. -
Added
diagonalmethod to matrix types which returns a vector containing the diagonal of the matrix. -
Added
mul_diagonal_scalemethods to matrix types which multiply the matrix by a scale vector without needing to multiply by a scale matrix. -
Added
mul_transpose_vecnmethods to matrix types which multiply the vector by the transpose of the matrix without needing to transpose it first. They can be slightly more efficient for SIMD backed types. -
Added
try_inversemethod to matrix types which returns an option containing the inverted matrix orNoneif the matrix was not invertible. -
Added
inverse_or_zeromethod to matrix types which returns the inverted matrix or a zero matrix if the matrix was not invertible. -
Added
stepandsaturatemethods to theFloatExttrait. -
Added
step,saturate,sqrt,sin,cosandsin_cosmethods to float vector types. -
Added
from_rotation_axesmethod to quaternion types. This method was previously internal only.
-
-
0.30.1007 Jan 2026Release notes
Open source →Added
-
Added float vector
exp2,lnandlog2methods. -
Added convenience methods for working with homogeneous coordinates, including 3D vector
from_homogeneousandto_homogeneousand 4D vectorproject.
Fixed
- Fixed
randUniformSamplernew_inclusivemethods so they're actually inclusive.
-
-
0.30.928 Oct 2025Release notes
Open source →Added
-
Added 3D vector
rotate_x,rotate_y,rotate_zandrotate_axismethods. -
Added
arbitraryfeature, providingarbitrarytrait implementations forglamtypes. -
Added
zerocopyfeature, providingzerocopytrait implementations forglamtypes.
Changed
- Made the threshold used in
DQuat::is_near_identity()more precise, previously it used the same threshold asQuat::is_near_identity.
-
-
0.30.824 Sep 2025Release notes
Open source →Changed
- Updates from the rust-gpu project, primarily removing the requirement to use
repr(simd)onspirv.
- Updates from the rust-gpu project, primarily removing the requirement to use
-
0.30.719 Sep 2025Release notes
Open source →Changed
- Reverted change to use
selfin vectors and&selfin vectors and matrices as this was a breaking change for some code.
- Reverted change to use
-
0.30.618 Sep 2025 withdrawnRelease notes
Open source →Added
- Added
encasefeature, providingencasetrait implementations forglamtypes.
Changed
- Consistently use
selffor vector and quat methods and&selffor matrix and affine methods.
- Added
-
0.30.526 Jul 2025Release notes
Open source →Added
- Added
Vec3::to_vec3aandVec3A::to_vec3methods.
Fixed
- Fixed using
bytemuckfeature onspirvtargets.
- Added
-
0.30.412 Jun 2025Release notes
Open source →Added
-
Added 4x4 matrix
frustum_lh,frustum_rhandfrustum_rh_glmethods. -
Added assign methods for all corresponding op trait impls (e.g.
add_assign,div_assign,mul_assign,sub_assignetc.) -
Added by reference implementations for all op trait impls.
Changed
bytemucktrait implementations now use derive macros to catch potentially misuse.
Fixed
-
Fixed unsoundness in core-simd implementation of
Vec3Ato[f32;3]array andVec3AtoVec3conversion. -
Fixed potential unsoundness in conversion from
Vec4to(f32, f32, f32, f32)tuple conversion.
-
-
0.30.301 May 2025Release notes
Open source →Added
-
Added
speedyfeature, implementing serialization and deserialization via thespeedycrate. -
Added
fract_glto the 'FloatExt' trait which uses the GLSL specification offract,self - self.floor().
-
-
0.30.213 Apr 2025Release notes
Open source →Added
-
Added precision conversion functions for affine types:
Affine3A::as_daffine3,DAffine3::as_affine3a,Affine2::as_daffine2andDAffine3::as_affine2 -
Added
normalize_and_lengthmethod tof32andf64vectors.
Changed
- Vector min and max scalar implementations have been changed to use an
ifcheck instead of the built in Rust floating point primitiveminandmaxmethods. The Rust methods have special handling forNaNpropagation however because this is not consistent between the different SIMD implementations in glam the most efficient implementation is preferred.
-
-
0.30.120 Mar 2025Release notes
Open source →Added
-
Added
usizevector types,USizeVec2,USizeVec3andUSizeVec4. -
Added
min_positionandmax_positionmethods for vector types, which return the index of the min or max element in the vector. -
Added
rotate_towardsmethod to 3D vector types.
Changed
- Removed the small angle check from 2D vector
rotate_towardsimplementations as it was unnecessary and would not preserve the length of the input.
-
-
0.30.018 Feb 2025Release notes
Open source →Breaking changes
-
The
upanddirvectors passed to affine and matrixlook_to_lhandlook_to_rhmethods must now be normalized. This was changed to be consistent with other methods. -
Updated the optional
randdependency to0.9 -
Updated the optional
rkyvdependency to0.8
Added
-
Implemented
randUniformdistribution trait for all vector types. -
Added "swizzle assignment" support to vector swizzles, in the form of
v.with_zx(ivec2(1, 2))which will return a copy ofvwhere thezandxcomponents are set to 1 and 2 respectively. -
Added
Mat3andQuatlook_at_lhandlook_at_rhmethods. -
Added
Quatlook_to_lhandlook_to_rhmethods. -
Added 3D vector
slerpmethod that performs a spherical linear interpolation between a source and a target 3D vector. -
Added
manhattan_distance,checked_manhattan_distanceandchebyshev_distancemethods to integer vector types which calculates the Manhattan Distance and the Chebyshev Distance between two vectors. -
Added 4x4 matrix
from_mat3_translationmethod to have parity with the 3D affine type.
Fixed
Quat::rotate_towards()now returns the targetQuatif the angle is small. Previouslyselfwas returned which could skip the rotation entirely.
-
-
0.29.331 Mar 2025Nothing published for this version
-
0.29.205 Nov 2024Release notes
Open source →Fixed
- Fix regression in vector
write_to_slicemethods where the destination had to be the same size as the input, but it should support writing to a slice that is the same size or larger than the input.
- Fix regression in vector
-
0.29.130 Oct 2024Release notes
Open source →Added
-
Added
i8andu8vector types,I8Vec2,I8Vec3,I8Vec4,U8Vec2,U8Vec3andU8Vec4. -
Added
Mat4::project_point3a(Vec3A)method transforming points by perspective projections.
Changed
-
Removed normalized assertions from quaternion multiplies as sometimes this is valid.
-
Include
DebugandDisplayimplementations onspirvtargets. -
Optimized vector
from_sliceandwrite_to_slicemethods. -
Improved
serdeerror messages.
-
-
0.29.020 Aug 2024Release notes
Open source →Breaking changes
EulerRothas been reimplemented and now has support for 24 different rotation order enum values.
Fixed
- Reduced the dot threshold at which quaternion slerp uses lerp to improve accuracy.
Added
-
Added 3x3 matrix
from_mat4_minor()and 2x2 matrixfrom_mat3_minor()methods. -
Added
bvec2,bvec3,bvec3a,bvec4andbvec4avector mask creation functions. -
Added all 24 possible intrinsic and extrinsic Euler angle rotation combinations to
EulerRotenum. -
Added
is_finite_maskmethod to vector types which returns a vector mask. -
Added
reflectandrefractmethods to vector types. -
Added
to_eulermethods to matrix types which extracts Euler angles from a rotation matrix for a givenEulerRot. -
Added generic
mapmethod to vector types which applies a functor to all vector elements. -
Vector arithmetic ops are now implemented on references.
Changed
- Vector and quaternion lerp now uses a precise lerp algorithm.
-
0.28.010 Jun 2024Release notes
Open source →Breaking changes
-
Removed derives from
glam::dereftypes used byDerefon SIMD vector types. These unintentionally added support for traits likePartialOrdto SIMD vector types. This may break existing code that was depending on this. Please usecmple().all()etc. instead ofPartialOrdmethods. -
Removed
impl From<Vec4> for Vec3Aas this violated theFromtrait contract that conversions should be lossless. Please use the explicitVec3A::from_vec4method instead. -
Renamed 2D vector
angle_betweentoangle_toto differentiate from the 3Dangle_betweenwhich has different semantics to the 2D version.
Added
-
Added aarch64 neon support.
-
Added
rotate_towardsmethods for 2D vectors and quaternions. -
Added
Vec3A::from_vec4method which can perform a no-op conversion when SIMD is used. This replaces theimpl From<Vec4> for Vec3Aimplementation.
-
-
0.27.023 Mar 2024Release notes
Open source →Breaking changes
- Changed implementation of vector
fractmethod to match the Rust implementation instead of the GLSL implementation, that isself - self.trunc()instead ofself - self.floor().
Added
- Added vector
fract_glwhich uses the GLSL specification offract,self - self.floor().
- Changed implementation of vector
-
0.26.018 Mar 2024Release notes
Open source →Breaking changes
- Minimum Supported Rust Version bumped to 1.68.2 for
impl From<bool> for {f32,f64}support.
Fixed
-
Respect precision format specifier in Display implementations. Previously it was ignored.
-
Corrected precision documentation for vector
is_normalizedmethods and changed the internal check to use2e-4to better match the documented precision value of1e-4.
Added
-
Added
with_x,with_y, etc. to vector types which returns a copy of the vector with the new component value. -
Added
midpointmethod to vector types that returns the point between two points. -
Added
move_towardsfor float vector types. -
Added saturating add and sub methods for signed and unsigned integer vector types.
-
Added element wise sum and product methods for vector types.
-
Added element wise absolute values method for matrix types.
-
Added
from_arraymethod for boolean vector types. -
Added
normalize_ormethod to vector types that returns the specified value if normalization failed. -
Added
From<BVecN>support for all vector types. -
Added
DivandDivAssignby scalar implementations to matrix types.
- Minimum Supported Rust Version bumped to 1.68.2 for
-
0.25.019 Dec 2023Release notes
Open source →Breaking changes
- Changed
Vec4to always usedBVec4Aas a mask type, regardless if the target architecture has SIMD support in glam. Previously this was inconsistent on different hardware like ARM. This will have a slight performance cost when SIMD is not available.Vec4will continue to useBVec4as a mask type when thescalar-mathfeature is used.
Fixed
-
Made
Affine2implement thebytemuck::AnyBitPatterntrait instead ofbytemuck::Podas it contains internal padding due toMat2being 16 byte aligned. -
Updated the
core-simdimplementation to build on latest nightly.
Added
-
Added
to_anglemethod to 2D vectors. -
Added
FloatExttrait which addslerp,inverse_lerpandremapmethods tof32andf64types. -
Added
i16andu16vector types,I16Vec2,I16Vec3,I16Vec4,U16Vec2,U16Vec3andU16Vec4.
Changed
-
Renamed
Quat::as_f64()toQuat::as_dquat()andDQuat::as_f32()toDQuat::as_quat()to be consistent with other types. The old methods have been deprecated. -
Added the
#[must_use]attribute to all pure functions following the guidelines for the Rust standard library.
- Changed
-
0.24.223 Sep 2023Release notes
Open source →Fixed
- Fixed singularities in
Quat::to_euler.
Added
-
Added
div_euclidandrem_euclidto integer vector types. -
Added wrapping and saturating arithmetic operations to integer vector types.
-
Added
to_scale_angle_translationto 2D affine types. -
Added
mul_assignops to affine types.
Changed
- Disable default features on optional
rkyvdependency.
- Fixed singularities in
-
0.24.124 Jun 2023Release notes
Open source →Added
-
Implemented missing
bytemuck,mint,rand,rkyvandserdetraits fori64andu64types. -
Added missing safe
Fromconversions fromf32vectors tof64vectors. -
Added
TryFromimplementations between different vector types. -
Added
testandsetmethods toboolvector types for testing and setting individual mask elements. -
Added
MIN,MAX,INFINITYandNEG_INFINITYvector constants.
-
-
0.24.024 Apr 2023Release notes
Open source →Breaking changes
- Enabling
libmin astdbuild now overrides thestdmath functions. This is unlikely to break anything but it is a change in behavior.
Added
-
Added
i64andu64vector types;I64Vec2,I64Vec3,I64Vec4,U64Vec2,U64Vec3andU64Vec4. -
Added
length_squaredmethod on signed and unsigned integer vector types. -
Added
distance_squaredmethod on signed integer vector types. -
Implemented the
bytemuckAnyBitPatterntrait onVec3A,Mat3AandAffine3A.
Changed
- Changed quaternion
to_axis_anglefor improved numerical stability.
Removed
- Removed dependency on
serde_derivefor improved compile times when usingserde.
- Enabling
-
0.23.020 Feb 2023Release notes
Open source →Breaking changes
- When the
scalar-mathfeature is enabled the vector mask type forVec3Awas changed fromBVec3toBVec3A.
Added
- Added
copysignmethod to signed vector types.
- When the
-
0.22.024 Oct 2022Release notes
Open source →Breaking changes
-
Added
u32implementation ofBVec3AandBVec4when SIMD is not available. These are used instead of aliasing to theboolimplementations. -
Removed
Add,Sub, and scalarMulimplementations from affine types as they didn't make sense on these types. -
Removed deprecated
const_*macros. These have been replaced byconst fnmethods.
Fixed
-
Fixed
negandsignumto consistently handle negative zero across multiple platforms. -
Removed
register_attrfeature usage for SPIR-V targets.
Added
-
Added missing
Serialize,DeserializeandPartialEqimplementations. -
Added
Sum<Self>andProduct<Self>implementations for all vector, matrix and quaternion types. -
Added 4x4 matrix methods
look_to_lhandlook_to_rh. These were previously private. -
Added
dot_into_vecmethods to vector which returns the result of the dot product splatted to all vector lanes. -
Added
is_negative_bitmaskto vector types which returns au32of bits for each negative vector lane. -
Added
splatmethod andTRUEandFALSEconstants to allBVectypes. -
Added
from_mat3amethods toAffine2,Mat2,Mat4andQuattypes.
Changed
-
Disable
serdedefault features. -
Made
to_cols_array,to_cols_array_2d, andfrom_diagonalmethodsconst fn.
-
-
0.21.302 Aug 2022Release notes
Open source →Fixed
- Fixed
glam_assertbeing too restrictive in matrix transform point and transform vector methods.
Added
- Added experimental
core-simdfeature which enables SIMD support via the unstablecore::simdmodule.
Changed
- Derive from
PartialEqandEqinstead of providing a trait implementation for all non SIMD types.
- Fixed
-
0.21.225 Jun 2022Release notes
Open source →Fixed
-
Restore missing
$crate::prefix in deprecatedconst_*macros. -
Fixed some performance regressions in affine and matrix determinant and inverses due to lack of inlining.
-
Fixed some performance regressions in the SSE2
Vec3AtoVec3from conversion.
Added
- Implemented
BitXorandBitXorAssigntraits forboolvectors.
-
-
0.21.122 Jun 2022 -
0.21.022 Jun 2022 withdrawnRelease notes
Open source →Breaking changes
-
Minimum Supported Version of Rust bumped to 1.58.1 to allow
constpointer dereferences in constant evaluation. -
The
abs_diff_eqmethod onMat2andDMat2now takesotherby value instead of reference. This is consistent with the other matrix types. -
The
AsMutandDereftrait implementations onQuatandDQuatwas removed. Quaternion fields are now public. -
The
AsReftrait implementations were removed fromBVec2,BVec3,BVec3A,BVec4andBVec4A.
Added
-
NEG_ONEconstant was added to all signed vector types. -
NEG_X,NEG_Y,NEG_ZandNEG_Wnegative axis vectors were added to signed vector types. -
The
rotateandfrom_anglemethods were added toVec2andDVec2.from_anglereturns a 2D vector containing[angle.cos(), angle.sin()]that can be used torotateanother 2D vector. -
The
from_arrayconstfunction was added to all vector types.
Changed
-
Source code is now largely generated. This removes most usage of macros internally to improve readability. There should be no change in API or behavior other than what is documented here.
-
Many methods have been made
const fn:new,splat,from_slice,to_arrayandextendon vector typesfrom_cols,from_cols_array,from_cols_array_2d,from_cols_sliceon matrix typesfrom_xyzwandfrom_arrayon quaternion typesfrom_colson affine types
-
The
constnew macros where deprecated.
Removed
- Deleted deprecated
TransformRTandTransformSRTtypes.
-
-
0.20.512 Apr 2022Release notes
Open source →Fixed
- Fixed a bug in the scalar implementation of 4D vector
max_elementmethod where thewelement check was incorrect.
- Fixed a bug in the scalar implementation of 4D vector
-
0.20.411 Apr 2022 -
0.20.328 Mar 2022Release notes
Open source →Added
- Added
to_array()toQuatandDQuat. - Added
mul_addmethod to all vector types - note that this will be slower without hardware support enabled. - Added the
fast-mathflag which will sacrifice some float determinism for speed.
Fixed
- Fixed a bug in the
sse2andwasm32implementations ofMat4::determinant().
- Added
-
0.20.219 Dec 2021 -
0.20.123 Nov 2021Release notes
Open source →Added
- Added the
from_rotation_arc_2d()method toQuatandDQuatwhich will return a rotation between two 2D vectors around the z axis. - Added impl of
Negoperator for matrix types. - Added
cudafeature which forcesglamtypes to match cuda's alignment requirements.
Changed
- The
QuatandDQuatmethodsfrom_rotation_arc()andfrom_rotation_arc_colinear()are now available inno_std. - The
Vec3andDVec3methodsany_orthogonal_vector(),any_orthonormal_vector()andany_orthonormal_pair()are now available inno_std. - Added
repr(C)attribute to affine types.
Removed
- Removed deprecated
as_f32(),as_f64(),as_i32()andas_u32()methods.
- Added the
-
0.20.001 Nov 2021Release notes
Open source →Breaking changes
- Minimum Supported Version of Rust bumped to 1.52.1 for an update to the
mintcrate.
Added
- Added implementations for new
IntoMinttrait from themintcrate. - Added
mintconversions forMat3A. - Added
as_vec3acast methods to vector types.
- Minimum Supported Version of Rust bumped to 1.52.1 for an update to the
-
0.19.005 Oct 2021Release notes
Open source →Breaking changes
- Removed truncating vector
Fromimplementations. Use.truncate()or swizzle methods instead.
Added
- Added
Not,Shl,Shr,BitAnd,BitOrandBitXorimplementations for allIVecandUVecvector types. - Added
NANconstant for all types. - Documented
glam's architecture.
Changed
SumandProducttraits are now implemented inno_stdbuilds.
- Removed truncating vector
-
0.18.026 Aug 2021Release notes
Open source →Breaking changes
- Minimum Supported Version of Rust bumped to 1.51.0 for
wasm-bindgen-testandrustdocaliassupport.
Added
- Added
wasm32SIMD intrinsics support. - Added optional support for the
rkyvserialization crate. - Added
RemandRemAssignimplementations for all vector types. - Added quaternion
xyz()method for returning the vector part of the quaternion. - Added
From((Scalar, Vector3))for 4D vector types.
Changed
- Deprecated
as_f32(),as_f64(),as_i32()andas_u32()methods in favor of more specific methods such asas_vec2(),as_dvec2(),as_ivec2()andas_uvec2()and so on.
- Minimum Supported Version of Rust bumped to 1.51.0 for
-
0.17.318 Jul 2021 -
0.17.215 Jul 2021 -
0.17.129 Jun 2021 -
0.17.026 Jun 2021Release notes
Open source →Breaking changes
- The addition of
AddandSubimplementations of scalar values for vector types may create ambiguities with existing calls toaddandsub. - Removed
From<Mat3>implementation forMat2andFrom<DMat3>forDMat2. These have been replaced byMat2::from_mat3()andDMat2::from_mat3(). - Removed
From<Mat4>implementation forMat3andFrom<DMat4>forDMat3. These have been replaced byMat3::from_mat4()andDMat3::from_mat4(). - Removed deprecated
from_slice_unaligned(),write_to_slice_unaligned(),from_rotation_mat4andfrom_rotation_ypr()methods.
Added
- Added
col_mut()method which returns a mutable reference to a matrix column to all matrix types. - Added
AddAssign,MulAssignandSubAssignimplementations for all matrix types. - Added
AddandSubimplementations of scalar values for vector types. - Added more
glam_assert!checks and documented methods where they are used. - Added vector projection and rejection methods
project_onto(),project_onto_normalized(),reject_from()andreject_from_normalized(). - Added
Mat2::from_mat3(),DMat2::from_mat3(),Mat3::from_mat4(),DMat3::from_mat4()which create a smaller matrix from a larger one, discarding a final row and column of the input matrix. - Added
Mat3::from_mat2(),DMat3::from_mat2(),Mat4::from_mat3()andDMat4::from_mat3()which create an affine transform from a smaller linear transform matrix.
Changed
- Don't support
AsRefandAsMuton SPIR-V targets. Also removed SPIR-V support for some methods that usedas_ref(), includinghash(). Not a breaking change as these methods would not have worked anyway.
Fixed
- Fixed compile time alignment checks failing on i686 targets.
- The addition of
-
0.16.006 Jun 2021Release notes
Open source →Breaking changes
sprirv-stddependency was removed, rust-gpu depends on glam internally again for now.- Added
must_useattribute to allinverse(),normalize(),try_normalize(),transpose()andconjugate()methods.
Added
- Added
fract()method to float vector types which return a vector containingself - self.floor(). - Added optional support for the
approxcrate. Note that all glam types implement their ownabs_diff_eq()method without requiring theapproxdependency.
-
0.15.219 May 2021Release notes
Open source →Added
- Added
from_cols()methods to affine types. - Added methods for reading and writing affine types from and to arrays and
slices, including
from_cols_array(),to_cols_array(),from_cols_array_2d(),to_cols_array_2d(),from_cols_slice()andwrite_cols_to_slice(). - Added
core::fmt::Displaytrait implementations for affine types. - Added
core::ops::Add,core::ops::Mulscalar andcore::ops::Subtrait implementations for affine types. - Added
from_array()methods to quaternion types.
Changed
- Renamed vector and quaternion
from_slice_unaligned()andwrite_to_slice_unaligned()methods tofrom_slice()andwrite_to_slice(). - Removed usage of
_mm_rcp_psfrom SSE2 implementation ofQuat::slerpas this instruction is not deterministic between Intel and AMD chips.
- Added
-
0.15.114 May 2021Release notes
Open source →Changed
- Disable
const_assert_eq!size and alignment checks for SPIR-V targets.
- Disable
-
0.15.014 May 2021Release notes
Open source →Breaking changes
- Removed
PartialOrdandOrdtrait implementations for allglamtypes. - Removed deprecated
zero(),one(),unit_x(),unit_y(),unit_z(),unit_w(),identity()andMat2::scale()methods. - Remove problematic
QuatFromtrait conversions which would allow creating a non-uniform quaternion without necessarily realizing, including fromVec4,(x, y, z, w)and[f32; 4].
Added
- Added
EulerRotenum for specifying Euler rotation order andQuat::from_euler(),Mat3::from_euler()andMat4::from_euler()which support specifying a rotation order and angles of rotation. - Added
Quat::to_euler()method for extracting Euler angles. - Added
Quat::from_vec4()which is an explicit method for creating a quaternion from a 4D vector. The method does not normalize the resulting quaternion. - Added
Mat3Atype which usesVec3Acolumns. It is 16 byte aligned and contains internal padding but it generally faster thanMat3for most operations if SIMD is available. - Added 3D affine transform types
Affine3AandDAffine3. These are more efficient than usingMat4andDMat4respectively when working with 3D affine transforms. - Added 2D affine transform types
Affine2andDAffine2. These are more efficient than usingMat3andDMat3respectively when working with 2D affine transforms. - Added
Quat::from_affine3()to create a quaternion from an affine transform rotation. - Added explicit
to_array()method to vector types to better match the matrix methods.
Changed
- Deprecated
Quat::from_rotation_ypr(),Mat3::from_rotation_ypr()andMat4::from_rotation_ypr()in favor of newfrom_euler()methods. - Deprecated
Quat::from_rotation_mat3()andQuat::from_rotation_mat4()in favor of newfrom_mat3andfrom_mat4methods. - Deprecated
TransformSRTandTransformRTwhich are under thetransform-typesfeature. These will be moved to a separate experimental crate. - Updated
spirv-stddependency version to0.4.0-alpha7.
- Removed
-
0.14.009 Apr 2021Release notes
Open source →Breaking changes
- Minimum Supported Version of Rust bumped to 1.45.0 for the
spirv-stddependency.
Added
- Added
AXES[]constants to all vector types. These are arrays containing the unit vector for each axis. - Added quaternion
from_scaled_axisandto_scaled_axismethods.
Changed
- Updated dependency versions of
bytemuckto1.5,randto0.8,rand_xoshiroto0.6andspirv-stdto0.4.0-alpha4.
- Minimum Supported Version of Rust bumped to 1.45.0 for the
-
0.13.124 Mar 2021Release notes
Open source →Added
- Added vector
clamp()functions. - Added matrix column and row accessor methods,
col()androw(). - Added SPIR-V module and dependency on
spirv-stdfor the SPIR-V target. - Added matrix truncation from 4x4 to 3x3 and 3x3 to 2x2 via
Fromimpls.
Changed
- Documentation corrections and improvements.
- Added vector
-
0.13.004 Mar 2021Release notes
Open source →Breaking changes
- The behavior of the 4x4 matrix method
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. Theproject_point3()method was added for transforming points by perspective projections. - The 3x3 matrix
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. Thefrom_diagonal()method can be used to create a 3x3 scale matrix. - The 3x3 matrix methods
transform_point2_as_vec3a,transform_vector2_as_vec3aandmul_vec3_as_vec3awere unintentionallypuband are no longer publicly accessible.
Added
- Added
Vec2::X,Vec4::Wetc constants as a shorter versions ofunit_x()and friends. - Added
ONEconstants for vectors. - Added
IDENTITYconstants forMat2,Mat3,Mat4andQuat. - Added
ZEROconstant for vectors and matrices. - Added
clamp_length(),clamp_length_max(), andclamp_length_minmethods forf32andf64vector types. - Added
try_normalize()andnormalize_or_zero()for all real vector types. - Added
from_diagonal()methods to all matrix types for creating diagonal matrices from a vector. - Added
angle_between(),from_rotation_arc()andfrom_rotation_arc_colinear()to quaternion types. - Added quaternion
inverse()which assumes the quaternion is already normalized and returns the conjugate. - Added
from_translation()andfrom_angle()methods to 3x3 matrix types. - Added
project_point3()method to 4x4 matrix types. This method is for transforming 3D vectors by perspective projection transforms. - Added
EqandHashimpls for integer vector types.
Changed
- Deprecated
::unit_x/y/z(),::zero(),::one(),::identity()functions in favor of constants.
- The behavior of the 4x4 matrix method
-
0.12.015 Jan 2021Release notes
Open source →Breaking changes
Vec2Mask,Vec3MaskandVec4Maskhave been replaced byBVec2,BVec3,BVec3A,BVec4andBVec4A. These types are used by some vector methods and are not typically referenced directly.
Added
- Added
f64primitive type support- vectors:
DVec2,DVec3andDVec4 - square matrices:
DMat2,DMat3andDMat4 - a quaternion type:
DQuat
- vectors:
- Added
i32primitive type support- vectors:
IVec2,IVec3andIVec4
- vectors:
- Added
u32primitive type support- vectors:
UVec2,UVec3andUVec4
- vectors:
- Added
boolprimitive type support- vectors:
BVec2,BVec3andBVec4
- vectors:
Removed
build.rshas been removed.
Release notes
Open source →-
~1900 changes, numerous bugfixes
-
Highlights
- The introductory documentation (now called The Rust Guide) has been completely rewritten, as have a number of supplementary guides.
- Rust's package manager, Cargo, continues to improve and is sometimes considered to be quite awesome.
- Many API's in
stdhave been reviewed and updated for consistency with the in-development Rust coding guidelines. The standard library documentation tracks stabilization progress. - Minor libraries have been moved out-of-tree to the rust-lang org on GitHub: uuid, semver, glob, num, hexfloat, fourcc. They can be installed with Cargo.
- Lifetime elision allows lifetime annotations to be left off of function declarations in many common scenarios.
- Rust now works on 64-bit Windows.
-
Language
- Indexing can be overloaded with the
IndexandIndexMuttraits. - The
if letconstruct takes a branch only if theletpattern matches, currently behind the 'if_let' feature gate. - 'where clauses', a more flexible syntax for specifying trait bounds that is more aesthetic, have been added for traits and free functions. Where clauses will in the future make it possible to constrain associated types, which would be impossible with the existing syntax.
- A new slicing syntax (e.g.
[0..4]) has been introduced behind the 'slicing_syntax' feature gate, and can be overloaded with theSliceorSliceMuttraits. - The syntax for matching of sub-slices has been changed to use a
postfix
..instead of prefix (.e.g.[a, b, c..]), for consistency with other uses of..and to future-proof potential additional uses of the syntax. - The syntax for matching inclusive ranges in patterns has changed
from
0..3to0...4to be consistent with the exclusive range syntax for slicing. - Matching of sub-slices in non-tail positions (e.g.
[a.., b, c]) has been put behind the 'advanced_slice_patterns' feature gate and may be removed in the future. - Components of tuples and tuple structs can be extracted using
the
value.0syntax, currently behind thetuple_indexingfeature gate. - The
#[crate_id]attribute is no longer supported; versioning is handled by the package manager. - Renaming crate imports are now written
extern crate foo as barinstead ofextern crate bar = foo. - Renaming use statements are now written
use foo as barinstead ofuse bar = foo. letandmatchbindings and argument names in macros are now hygienic.- The new, more efficient, closure types ('unboxed closures') have been added under a feature gate, 'unboxed_closures'. These will soon replace the existing closure types, once higher-ranked trait lifetimes are added to the language.
movehas been added as a keyword, for indicating closures that capture by value.- Mutation and assignment is no longer allowed in pattern guards.
- Generic structs and enums can now have trait bounds.
- The
Sharetrait is now calledSyncto free up the term 'shared' to refer to 'shared reference' (the default reference type. - Dynamically-sized types have been mostly implemented, unifying the behavior of fat-pointer types with the rest of the type system.
- As part of dynamically-sized types, the
Sizedtrait 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 areSized, notable exceptions being unsized arrays ([T]) and trait types. - Closures can return
!, as in|| -> !orproc() -> !. - Lifetime bounds can now be applied to type parameters and object types.
- The old, reference counted GC type,
Gc<T>which was once denoted by the@sigil, has finally been removed. GC will be revisited in the future.
- Indexing can be overloaded with the
-
Libraries
- Library documentation has been improved for a number of modules.
- Bit-vectors, collections::bitv has been modernized.
- The url crate is deprecated in favor of http://github.com/servo/rust-url, which can be installed with Cargo.
- Most I/O stream types can be cloned and subsequently closed from a different thread.
- A
std::time::Durationtype has been added for use in I/O methods that rely on timers, as well as in the 'time' crate'sTimespecarithmetic. - The runtime I/O abstraction layer that enabled the green thread scheduler to do non-thread-blocking I/O has been removed, along with the libuv-based implementation employed by the green thread scheduler. This will greatly simplify the future I/O work.
collections::btreehas been rewritten to have a more idiomatic and efficient design.
-
Tooling
- rustdoc output now indicates the stability levels of API's.
- The
--crate-nameflag can specify the name of the crate being compiled, like#[crate_name]. - The
-C metadataspecifies additional metadata to hash into symbol names, and-C extra-filenamespecifies additional information to put into the output filename, for use by the package manager for versioning. - debug info generation has continued to improve and should be more reliable under both gdb and lldb.
- rustc has experimental support for compiling in parallel
using the
-C codegen-unitsflag. - rustc no longer encodes rpath information into binaries by default.
-
Misc
- Stack usage has been optimized with LLVM lifetime annotations.
- Official Rust binaries on Linux are more compatible with older kernels and distributions, built on CentOS 5.10.
-
-
0.11.329 Dec 2020Release notes
Open source →Changed
- Made
Vec3repr(simd)forspirvtargets.
Added
- Added
From<(Vec2, f32)>forVec3andFrom<(Vec3, f32)forVec4.
- Made
-
0.11.203 Dec 2020