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. The project_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. The from_diagonal() method can be used to create a 3x3 scale matrix.
    • The 3x3 matrix methods transform_point2_as_vec3a, transform_vector2_as_vec3a and mul_vec3_as_vec3a were unintentionally pub and are no longer publicly accessible.

    โž• Added

    • โž• Added Vec2::X, Vec4::W etc constants as a shorter versions of unit_x() and friends.
    • โž• Added ONE constants for vectors.
    • โž• Added IDENTITY constants for Mat2, Mat3, Mat4 and Quat.
    • โž• Added ZERO constant for vectors and matrices.
    • Added clamp_length(), clamp_length_max(), and clamp_length_min methods for f32 and f64 vector types.
    • Added try_normalize() and normalize_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() and from_rotation_arc_colinear() to quaternion types.
    • โž• Added quaternion inverse() which assumes the quaternion is already normalized and returns the conjugate.
    • ๐ŸŒ Added from_translation() and from_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 and Hash impls for integer vector types.

    ๐Ÿ”„ Changed

    • ๐Ÿ—„ Deprecated ::unit_x/y/z(), ::zero(), ::one(), ::identity() functions in favor of constants.