All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.10.0 - 2020-10-31
- Added
From
implementations to truncate to narrower vector types, e.g.Vec4
toVec3A
,Vec3
andVec2
and fromVec3A
andVec3
toVec2
. - Added swizzles for
Vec4
,Vec3A
,Vec3
andVec2
. These can be used to reorder elements in the same type and also to create larger or smaller vectors from the given vectors elements. - Added
Quat
operatorsAdd<Quat>
,Sub<Quat>
,Mul<f32>
andDiv<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 otherQuat
operations. - Added
Mat4::transform_point3a
andMat4::transform_vector3a
. - Added
AsRef<[f32; 9]>
andAsMut<[f32; 9]>
trait implementations toMat3
. - Added optional
bytemuck
support primarily for casting types to&[u8]
. - Added support for compiling with
no_std
by disabling the defaultstd
feature and adding thelibm
feature. - Added
distance
anddistance_squared
methods toVec2
,Vec3
,Vec3A
andVec4
.
- Changed the return type of
Vec4::truncate
fromVec3A
toVec3
. This is a breaking change.
0.9.5 - 2020-10-10
glam
uses SSE2 for some types which prevents constructor functions can not be madeconst fn
. To work around this limitation the following macro functions have been added to support creatingconst
values ofglam
types:const_mat2
,const_mat3
,const_mat4
,const_quat
,const_vec2
,const_vec3
,const_vec3a
andconst_vec4
.- Added
is_nan
methods toVec2
,Vec3
,Vec3A
andVec4
which return a mask.
- Renamed the vector
reciprocal
andlength_reciprocal
methods torecip
andlength_recip
to match the Rust standard library naming. The old methods have been deprecated. - Renamed the vector
sign
methods tosignum
match the Rust standard library naming. The new methods now check forNAN
. The old methods have been deprecated. - Added SSE2 optimized implementations of
Mat4::determinant
andMat4::inverse
.
- Removed deprecated function
Mat4::perspective_glu_rh
.
0.9.4 - 2020-08-31
- Fixed
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. - Fixed
Mat3::transform_point2
to account for homogeneous z coordinate.
0.9.3 - 2020-08-11
- Added
Mat4::perspective_rh
.
0.9.2 - 2020-07-09
- Added
Mat3::mul_vec3a
andQuat::mul_vec3a
.
- Changed
Quat::mul_vec3
to accept and returnVec3
instead ofVec3A
.
0.9.1 - 2020-07-01
- Added
Mat3 * Vec3A
implementation. - Added
Vec3A
benches.
- Some documentation improvements around the new
Vec3A
type.
0.9.0 - 2020-06-28
Vec3
has been split into scalarVec3
and 16 byte alignedVec3A
types. Only theVec3A
type currently uses SIMD optimizations.Vec3Mask
has been split into scalarVec3Mask
and 16 byte alignedVec3AMask
types.- Added
mut
column accessors to all matrix types, e.g.Mat2::x_axis_mut()
. - Added
From
trait implementations forVec3AMask
andVec4Mask
to__m128
.
- The
Mat3
type is using the scalarVec3
type for storage. - Simplified
Debug
trait output forQuat
,Vec4
andVec3A
.
- Removed the
packed-vec3
feature flag as it is now redundant.
0.8.7 - 2020-04-28
- Added
Quat::slerp
- note that this uses asin
approximation. - Added
angle_between
method forVec2
andVec3
. - Implemented
Debug
,Display
,PartialEq
,Eq
,PartialOrd
,Ord
,Hash
, andAsRef
traits forVec2Mask
,Vec3Mask
andVec4Mask
. - Added conversion functions from
Vec2Mask
,Vec3Mask
andVec4Mask
to an array of[u32]
. - Added
build.rs
to simplify conditional feature compilation.
- Increased test coverage.
- Removed
cfg-if
dependency.
0.8.6 - 2020-02-18
- Added the
packed-vec3
feature flag to disable using SIMD types forVec3
andMat3
types. This avoids wasting some space due to 16 byte alignment at the cost of some performance. - Added
x_mut
,y_mut
,z_mut
,w_mut
where appropriate toVec2
,Vec3
andVec4
. - Added implementation of
core::ops::Index
andcore::ops::IndexMut
forVec2
,Vec3
andVec4
.
- Merged SSE2 and scalar
Vec3
andVec4
implementations into single files using thecfg-if
crate.
0.8.5 - 2020-01-02
- Added projection functions
Mat4::perspective_lh
,Mat4::perspective_infinite_lh
,Mat4::perspective_infinite_reverse_lh
,Mat4::orthgraphic_lh
andMat4::orthographic_rh
. - Added
round
,ceil
andfloor
methods toVec2
,Vec3
andVec4
.
0.8.4 - 2019-12-17
- Added
Mat4::to_scale_rotation_translation
for extracting scale, rotation and translation from a 4x4 homogeneous transformation matrix. - Added
cargo-deny
GitHub Action.
- Renamed
Quat::new
toQuat::from_xyzw
.
0.8.3 - 2019-11-27
- Added
Mat4::orthographic_rh_gl
.
- Renamed
Mat4::perspective_glu_rh
toMat4::perspective_rh_gl
. - SSE2 optimizations for
Mat2::determinant
,Mat2::inverse
,Mat2::transpose
,Mat3::transpose
,Quat::conjugate
,Quat::lerp
,Quat::mul_vec3
,Quat::mul_quat
andQuat::from_rotation_ypr
. - Disabled optimizations to
Mat4::transform_point3
andMat4::transform_vector3
as they are probably incorrect and need investigating. - Added missing
#[repr(C)]
toMat2
,Mat3
andMat4
. - Benchmarks now store output of functions to better estimate the cost of a function call.
- Removed deprecated functions
Mat2::new
,Mat3::new
andMat4::new
.
0.8.2 - 2019-11-06
glam_assert!
is no longer enabled by default in debug builds, it can be enabled in any configuration using theglam-assert
feature or in debug builds only using thedebug-glam-assert
feature.
glam_assert!
's checkinglerp
is bounded between 0.0 and 1.0 and that matrix scales are non-zero have been removed.
0.8.1 - 2019-11-03
- Added
Display
trait implementations forMat2
,Mat3
andMat4
.
- Disabled
glam
's SSE2sin_cos
implementation - it became less precise for large angle values. - Reduced the default epsilon used by the
is_normalized!
macro fromstd::f32::EPSILON
to1e-6
.
0.8.0 - 2019-10-14
- Removed the
approx
crate dependency. Eachglam
type has anabs_diff_eq
method added which is used by unit tests for approximate floating point comparisons. - Removed the
Angle
type. All angles are nowf32
and are expected to be in radians. - Removed the deprecated
Vec2b
,Vec3b
andVec4b
types and themask
methods onVec2Mask
,Vec3Mask
andVec4Mask
.
- The
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 benchessupport
module instead. - The
From
trait implementation converting between 1D and 2Df32
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 methodsfrom_cols_array
andfrom_cols_array_2d
. - Matrix
new
methods have been renamed tofrom_cols
to be consistent with the other methods that create matrices from data. - Renamed
Mat4::perspective_glu
toMat4::perspective_glu_rh
.
0.7.2 - 2019-09-22
- Fixed incorrect projection matrix methods
Mat4::look_at_lh
andMat4::look_at_rh
.
- Added support for building infinite projection matrices, including both
standard and reverse depth
Mat4::perspective_infinite_rh
andMat4::perspective_infinite_rh
. - Added
Vec2Mask::new
,Vec3Mask::new
andVec4Mask::new
methods. - Implemented
std::ops
BitAnd
,BitAndAssign
,BitOr
,BitOrAssign
andNot
traits forVec2Mask
,Vec3Mask
andVec4Mask
. - Added method documentation for
Vec4
andVec4Mask
types. - Added missing
serde
implementations forMat2
,Mat3
andMat4
. - Updated
rand
andcriterion
versions.
0.7.1 - 2019-07-08
- The SSE2 implementation of
Vec4
dot
was missing a shuffle, meaning thedot
,length
,length_squared
,length_reciprocal
andnormalize
methods were sometimes incorrect.
- Added the
glam_assert
macro which behaves like Rust'sdebug_assert
but can be enabled separately todebug_assert
. This is used to perform asserts on correctness. - Added
is_normalized
method toVec2
,Vec3
andVec4
.
- Replaced usage of
std::mem::uninitialized
withstd::mem::MaybeUninit
. This change requires stable Rust 1.36. - Renamed
Vec2b
toVec2Mask
,Vec3b
toVec3Mask
andVec4b
toVec4Mask
. Old names are aliased to the new name and deprecated. - Deprecate
VecNMask
mask
method, use newbitmask
method instead - Made fallback version of
VecNMask
types the same size and alignment as the SIMD versions. - Added
Default
support toVecNMask
types, will add more common traits in the future. - Added
#[inline]
tomat2
,mat3
andmat4
functions.
0.7.0 - 2019-06-28
- Added
Mat2
into[f32; 4]
,Mat3
into[f32; 9]
andMat4
into[f32; 16]
.
- Removed
impl Mul<&Vec2> for Mat2
andimpl Mul<&Vec3> for Vec3
as these don't exist for any other types.
0.6.1 - 2019-06-22
Mat2
now uses aVec4
internally which gives it some performance improvements when SSE2 is available.
- Switched from row vectors to column vectors
- Vectors are now on the right of multiplications with matrices and quaternions.