glam v0.13.0 Release Notes
Release Date: 2021-03-04 // about 3 years ago-
๐ฅ 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_vec3a
andmul_vec3_as_vec3a
were unintentionallypub
and are no longer publicly accessible.
โ Added
- โ Added
Vec2::X
,Vec4::W
etc constants as a shorter versions ofunit_x()
and friends. - โ Added
ONE
constants for vectors. - โ Added
IDENTITY
constants forMat2
,Mat3
,Mat4
andQuat
. - โ Added
ZERO
constant for vectors and matrices. - Added
clamp_length()
,clamp_length_max()
, andclamp_length_min
methods forf32
andf64
vector 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
Eq
andHash
impls 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