Debian Codegraph @

debian/missing-sources/glam-0.28.0/CHANGELOG.md

raw symbols SCIP
1 # Changelog
2
3 All notable changes to this project will be documented in this file.
4
5 The format is based on [Keep a Changelog], and this project adheres to
6 [Semantic Versioning].
7
8 ## [0.28.0] - 2024-06-10
9
10 ### Breaking changes
11
12 * Removed derives from `glam::deref` types used by `Deref` on SIMD vector
13 types. These unintentionally added support for traits like `PartialOrd` to
14 SIMD vector types. This may break existing code that was depending on this.
15 Please use `cmple().all()` etc. instead of `PartialOrd` methods.
16
17 * Removed `impl From<Vec4> for Vec3A` as this violated the `From` trait
18 contract that conversions should be lossless. Please use the explicit
19 `Vec3A::from_vec4` method instead.
20
21 * Renamed 2D vector `angle_between` to `angle_to` to differentiate from the 3D
22 `angle_between` which has different semantics to the 2D version.
23
24 ### Added
25
26 * Added aarch64 neon support.
27
28 * Added `rotate_towards` methods for 2D vectors and quaternions.
29
30 * Added `Vec3A::from_vec4` method which can perform a no-op conversion when
31 SIMD is used. This replaces the `impl From<Vec4> for Vec3A` implementation.
32
33 ## [0.27.0] - 2024-03-23
34
35 ### Breaking changes
36
37 * Changed implementation of vector `fract` method to match the Rust
38 implementation instead of the GLSL implementation, that is `self -
39 self.trunc()` instead of `self - self.floor()`.
40
41 ### Added
42
43 * Added vector `fract_gl` which uses the GLSL specification of fract,
44 `self - self.floor()`.
45
46 ## [0.26.0] - 2024-03-18
47
48 ### Breaking changes
49
50 * Minimum Supported Rust Version bumped to 1.68.2 for
51 `impl From<bool> for {f32,f64}` support.
52
53 ### Fixed
54
55 * Respect precision format specifier in Display implementations. Previously it
56 was ignored.
57
58 * Corrected precision documentation for vector `is_normalized` methods and
59 changed the internal check to use `2e-4` to better match the documented
60 precision value of `1e-4`.
61
62 ### Added
63
64 * Added `with_x`, `with_y`, etc. to vector types which returns a copy of
65 the vector with the new component value.
66
67 * Added `midpoint` method to vector types that returns the point between two
68 points.
69
70 * Added `move_towards` for float vector types.
71
72 * Added saturating add and sub methods for signed and unsigned integer vector
73 types.
74
75 * Added element wise sum and product methods for vector types.
76
77 * Added element wise absolute values method for matrix types.
78
79 * Added `from_array` method for boolean vector types.
80
81 * Added `normalize_or` method to vector types that returns the specified value
82 if normalization failed.
83
84 * Added `From<BVecN>` support for all vector types.
85
86 * Added `Div` and `DivAssign` by scalar implementations to matrix types.
87
88 ## [0.25.0] - 2023-12-19
89
90 ### Breaking changes
91
92 * Changed `Vec4` to always used `BVec4A` as a mask type, regardless if the
93 target architecture has SIMD support in glam. Previously this was inconsistent
94 on different hardware like ARM. This will have a slight performance cost when
95 SIMD is not available. `Vec4` will continue to use `BVec4` as a mask type when
96 the `scalar-math` feature is used.
97
98 ### Fixed
99
100 * Made `Affine2` implement the `bytemuck::AnyBitPattern` trait instead of
101 `bytemuck::Pod` as it contains internal padding due to `Mat2` being 16 byte
102 aligned.
103
104 * Updated the `core-simd` implementation to build on latest nightly.
105
106 ### Added
107
108 * Added `to_angle` method to 2D vectors.
109
110 * Added `FloatExt` trait which adds `lerp`, `inverse_lerp` and `remap` methods
111 to `f32` and `f64` types.
112
113 * Added `i16` and `u16` vector types, `I16Vec2`, `I16Vec3`, `I16Vec4`,
114 `U16Vec2`, `U16Vec3` and `U16Vec4`.
115
116 ### Changed
117
118 * Renamed `Quat::as_f64()` to `Quat::as_dquat()` and `DQuat::as_f32()` to
119 `DQuat::as_quat()` to be consistent with other types. The old methods have
120 been deprecated.
121
122 * Added the `#[must_use]` attribute to all pure functions following the
123 guidelines for the Rust standard library.
124
125 ## [0.24.2] - 2023-09-23
126
127 ### Fixed
128
129 * Fixed singularities in `Quat::to_euler`.
130
131 ### Added
132
133 * Added `div_euclid` and `rem_euclid` to integer vector types.
134
135 * Added wrapping and saturating arithmetic operations to integer vector types.
136
137 * Added `to_scale_angle_translation` to 2D affine types.
138
139 * Added `mul_assign` ops to affine types.
140
141 ### Changed
142
143 * Disable default features on optional `rkyv` dependency.
144
145 ## [0.24.1] - 2023-06-24
146
147 ### Added
148
149 * Implemented missing `bytemuck`, `mint`, `rand`, `rkyv` and `serde` traits for
150 `i64` and `u64` types.
151
152 * Added missing safe `From` conversions from `f32` vectors to `f64` vectors.
153
154 * Added `TryFrom` implementations between different vector types.
155
156 * Added `test` and `set` methods to `bool` vector types for testing and setting
157 individual mask elements.
158
159 * Added `MIN`, `MAX`, `INFINITY` and `NEG_INFINITY` vector constants.
160
161 ## [0.24.0] - 2023-04-24
162
163 ### Breaking changes
164
165 * Enabling `libm` in a `std` build now overrides the `std` math functions. This
166 is unlikely to break anything but it is a change in behavior.
167
168 ### Added
169
170 * Added `i64` and `u64` vector types; `I64Vec2`, `I64Vec3`, `I64Vec4`,
171 `U64Vec2`, `U64Vec3` and `U64Vec4`.
172
173 * Added `length_squared` method on signed and unsigned integer vector types.
174
175 * Added `distance_squared` method on signed integer vector types.
176
177 * Implemented the `bytemuck` `AnyBitPattern` trait on `Vec3A`, `Mat3A` and
178 `Affine3A`.
179
180 ### Changed
181
182 * Changed quaternion `to_axis_angle` for improved numerical stability.
183
184 ### Removed
185
186 * Removed dependency on `serde_derive` for improved compile times when using
187 `serde`.
188
189 ## [0.23.0] - 2023-02-22
190
191 ### Breaking changes
192
193 * When the `scalar-math` feature is enabled the vector mask type for `Vec3A` was
194 changed from `BVec3` to `BVec3A`.
195
196 ### Added
197
198 * Added `copysign` method to signed vector types.
199
200 ## [0.22.0] - 2022-10-24
201
202 ### Breaking changes
203
204 * Added `u32` implementation of `BVec3A` and `BVec4` when SIMD is not available.
205 These are used instead of aliasing to the `bool` implementations.
206
207 * Removed `Add`, `Sub`, and scalar `Mul` implementations from affine types as
208 they didn't make sense on these types.
209
210 * Removed deprecated `const_*` macros. These have been replaced by `const fn`
211 methods.
212
213 ### Fixed
214
215 * Fixed `neg` and `signum` to consistently handle negative zero across multiple
216 platforms.
217
218 * Removed `register_attr` feature usage for SPIR-V targets.
219
220 ### Added
221
222 * Added missing `Serialize`, `Deserialize` and `PartialEq` implementations.
223
224 * Added `Sum<Self>` and `Product<Self>` implementations for all vector, matrix
225 and quaternion types.
226
227 * Added 4x4 matrix methods `look_to_lh` and `look_to_rh`. These were previously
228 private.
229
230 * Added `dot_into_vec` methods to vector which returns the result of the dot
231 product splatted to all vector lanes.
232
233 * Added `is_negative_bitmask` to vector types which returns a `u32` of bits for
234 each negative vector lane.
235
236 * Added `splat` method and `TRUE` and `FALSE` constants to all `BVec` types.
237
238 * Added `from_mat3a` methods to `Affine2`, `Mat2`, `Mat4` and `Quat` types.
239
240 ### Changed
241
242 * Disable `serde` default features.
243
244 * Made `to_cols_array`, `to_cols_array_2d`, and `from_diagonal` methods
245 `const fn`.
246
247 ## [0.21.3] - 2022-08-02
248
249 ### Fixed
250
251 * Fixed `glam_assert` being too restrictive in matrix transform point and
252 transform vector methods.
253
254 ### Added
255
256 * Added experimental `core-simd` feature which enables SIMD support via the
257 unstable `core::simd` module.
258
259 ### Changed
260
261 * Derive from `PartialEq` and `Eq` instead of providing a trait implementation
262 for all non SIMD types.
263
264 ## [0.21.2] - 2022-06-25
265
266 ### Fixed
267
268 * Restore missing `$crate::` prefix in deprecated `const_*` macros.
269
270 * Fixed some performance regressions in affine and matrix determinant and
271 inverses due to lack of inlining.
272
273 * Fixed some performance regressions in the SSE2 `Vec3A` to `Vec3` from
274 conversion.
275
276 ### Added
277
278 * Implemented `BitXor` and `BitXorAssign` traits for `bool` vectors.
279
280 ## [0.21.1] - 2022-06-22
281
282 ### Fixed
283
284 * Fix compilation when FMA support is enabled.
285
286 ## [0.21.0] - 2022-06-22
287
288 ### Breaking changes
289
290 * Minimum Supported Version of Rust bumped to 1.58.1 to allow `const` pointer
291 dereferences in constant evaluation.
292
293 * The `abs_diff_eq` method on `Mat2` and `DMat2` now takes `other` by value
294 instead of reference. This is consistent with the other matrix types.
295
296 * The `AsMut` and `Deref` trait implementations on `Quat` and `DQuat` was
297 removed. Quaternion fields are now public.
298
299 * The `AsRef` trait implementations were removed from `BVec2`, `BVec3`,
300 `BVec3A`, `BVec4` and `BVec4A`.
301
302 ### Added
303
304 * `NEG_ONE` constant was added to all signed vector types.
305
306 * `NEG_X`, `NEG_Y`, `NEG_Z` and `NEG_W` negative axis vectors were added to
307 signed vector types.
308
309 * The `rotate` and `from_angle` methods were added to `Vec2` and `DVec2`.
310 `from_angle` returns a 2D vector containing `[angle.cos(), angle.sin()]` that
311 can be used to `rotate` another 2D vector.
312
313 * The `from_array` `const` function was added to all vector types.
314
315 ### Changed
316
317 * Source code is now largely generated. This removes most usage of macros
318 internally to improve readability. There should be no change in API or
319 behavior other than what is documented here.
320
321 * Many methods have been made `const fn`:
322 * `new`, `splat`, `from_slice`, `to_array` and `extend` on vector types
323 * `from_cols`, `from_cols_array`, `from_cols_array_2d`, `from_cols_slice` on
324 matrix types
325 * `from_xyzw` and `from_array` on quaternion types
326 * `from_cols` on affine types
327
328 * The `const` new macros where deprecated.
329
330 ### Removed
331
332 * Deleted deprecated `TransformRT` and `TransformSRT` types.
333
334 ## [0.20.5] - 2022-04-12
335
336 ### Fixed
337
338 * Fixed a bug in the scalar implementation of 4D vector `max_element` method
339 where the `w` element check was incorrect.
340
341 ## [0.20.4] - 2022-04-11
342
343 ### Fixed
344
345 * Fixed a bug with quaternion `slerp` with a rotation of tau.
346
347 ## [0.20.3] - 2022-03-28
348
349 ### Added
350
351 * Added `to_array()` to `Quat` and `DQuat`.
352 * Added `mul_add` method to all vector types - note that this will be slower
353 without hardware support enabled.
354 * Added the `fast-math` flag which will sacrifice some float determinism for
355 speed.
356
357 ### Fixed
358
359 * Fixed a bug in the `sse2` and `wasm32` implementations of
360 `Mat4::determinant()`.
361
362 ## [0.20.2] - 2021-12-20
363
364 ### Fixed
365
366 * Fixed SPIR-V build which was broken due to a typo.
367
368 ## [0.20.1] - 2021-11-23
369
370 ### Added
371
372 * Added the `from_rotation_arc_2d()` method to `Quat` and `DQuat` which will
373 return a rotation between two 2D vectors around the z axis.
374 * Added impl of `Neg` operator for matrix types.
375 * Added `cuda` feature which forces `glam` types to match cuda's alignment
376 requirements.
377
378 ### Changed
379
380 * The `Quat` and `DQuat` methods `from_rotation_arc()` and
381 `from_rotation_arc_colinear()` are now available in `no_std`.
382 * The `Vec3` and `DVec3` methods `any_orthogonal_vector()`,
383 `any_orthonormal_vector()` and `any_orthonormal_pair()` are now available in
384 `no_std`.
385 * Added `repr(C)` attribute to affine types.
386
387 ### Removed
388
389 * Removed deprecated `as_f32()`, `as_f64()`, `as_i32()` and `as_u32()` methods.
390
391 ## [0.20.0] - 2021-11-01
392
393 ### Breaking changes
394
395 * Minimum Supported Version of Rust bumped to 1.52.1 for an update to the `mint`
396 crate.
397
398 ### Added
399
400 * Added implementations for new `IntoMint` trait from the `mint` crate.
401 * Added `mint` conversions for `Mat3A`.
402 * Added `as_vec3a` cast methods to vector types.
403
404 ## [0.19.0] - 2021-10-05
405
406 ### Breaking changes
407
408 * Removed truncating vector `From` implementations. Use `.truncate()` or swizzle
409 methods instead.
410
411 ### Added
412
413 * Added `Not`, `Shl`, `Shr`, `BitAnd`, `BitOr` and `BitXor` implementations for
414 all `IVec` and `UVec` vector types.
415 * Added `NAN` constant for all types.
416 * Documented `glam`'s [architecture](ARCHITECTURE.md).
417
418 ### Changed
419
420 * `Sum` and `Product` traits are now implemented in `no_std` builds.
421
422 ## [0.18.0] - 2021-08-26
423
424 ### Breaking changes
425
426 * Minimum Supported Version of Rust bumped to 1.51.0 for `wasm-bindgen-test`
427 and `rustdoc` `alias` support.
428
429 ### Added
430
431 * Added `wasm32` SIMD intrinsics support.
432 * Added optional support for the `rkyv` serialization crate.
433 * Added `Rem` and `RemAssign` implementations for all vector types.
434 * Added quaternion `xyz()` method for returning the vector part of the
435 quaternion.
436 * Added `From((Scalar, Vector3))` for 4D vector types.
437
438 ### Changed
439
440 * Deprecated `as_f32()`, `as_f64()`, `as_i32()` and `as_u32()` methods in favor
441 of more specific methods such as `as_vec2()`, `as_dvec2()`, `as_ivec2()` and
442 `as_uvec2()` and so on.
443
444 ## [0.17.3] - 2021-07-18
445
446 ### Fixed
447
448 * Fix alignment unit tests on non x86 platforms.
449
450 ## [0.17.2] - 2021-07-15
451
452 ### Fixed
453
454 * Fix alignment unit tests on i686 and S390x.
455
456 ## [0.17.1] - 2021-06-29
457
458 ### Added
459
460 * Added `serde` support for `Affine2`, `DAffine2`, `Affine3A` and `DAffine3`.
461
462 ## [0.17.0] - 2021-06-26
463
464 ### Breaking changes
465
466 * The addition of `Add` and `Sub` implementations of scalar values for vector
467 types may create ambiguities with existing calls to `add` and `sub`.
468 * Removed `From<Mat3>` implementation for `Mat2` and `From<DMat3>` for `DMat2`.
469 These have been replaced by `Mat2::from_mat3()` and `DMat2::from_mat3()`.
470 * Removed `From<Mat4>` implementation for `Mat3` and `From<DMat4>` for `DMat3`.
471 These have been replaced by `Mat3::from_mat4()` and `DMat3::from_mat4()`.
472 * Removed deprecated `from_slice_unaligned()`, `write_to_slice_unaligned()`,
473 `from_rotation_mat4` and `from_rotation_ypr()` methods.
474
475 ### Added
476
477 * Added `col_mut()` method which returns a mutable reference to a matrix column
478 to all matrix types.
479 * Added `AddAssign`, `MulAssign` and `SubAssign` implementations for all matrix
480 types.
481 * Added `Add` and `Sub` implementations of scalar values for vector types.
482 * Added more `glam_assert!` checks and documented methods where they are used.
483 * Added vector projection and rejection methods `project_onto()`,
484 `project_onto_normalized()`, `reject_from()` and `reject_from_normalized()`.
485 * Added `Mat2::from_mat3()`, `DMat2::from_mat3()`, `Mat3::from_mat4()`,
486 `DMat3::from_mat4()` which create a smaller matrix from a larger one,
487 discarding a final row and column of the input matrix.
488 * Added `Mat3::from_mat2()`, `DMat3::from_mat2()`, `Mat4::from_mat3()` and
489 `DMat4::from_mat3()` which create an affine transform from a smaller linear
490 transform matrix.
491
492 ### Changed
493
494 * Don't support `AsRef` and `AsMut` on SPIR-V targets. Also removed SPIR-V
495 support for some methods that used `as_ref()`, including `hash()`. Not a
496 breaking change as these methods would not have worked anyway.
497
498 ### Fixed
499
500 * Fixed compile time alignment checks failing on i686 targets.
501
502 ## [0.16.0] - 2021-06-06
503
504 ### Breaking changes
505
506 * `sprirv-std` dependency was removed, rust-gpu depends on glam internally
507 again for now.
508 * Added `must_use` attribute to all `inverse()`, `normalize()`,
509 `try_normalize()`, `transpose()` and `conjugate()` methods.
510
511 ### Added
512
513 * Added `fract()` method to float vector types which return a vector containing
514 `self - self.floor()`.
515 * Added optional support for the `approx` crate. Note that all glam types
516 implement their own `abs_diff_eq()` method without requiring the `approx`
517 dependency.
518
519 ## [0.15.2] - 2021-05-20
520
521 ### Added
522
523 * Added `from_cols()` methods to affine types.
524 * Added methods for reading and writing affine types from and to arrays and
525 slices, including `from_cols_array()`, `to_cols_array()`,
526 `from_cols_array_2d()`, `to_cols_array_2d()`, `from_cols_slice()` and
527 `write_cols_to_slice()`.
528 * Added `core::fmt::Display` trait implementations for affine types.
529 * Added `core::ops::Add`, `core::ops::Mul` scalar and `core::ops::Sub` trait
530 implementations for affine types.
531 * Added `from_array()` methods to quaternion types.
532
533 ### Changed
534
535 * Renamed vector and quaternion `from_slice_unaligned()` and
536 `write_to_slice_unaligned()` methods to `from_slice()` and
537 `write_to_slice()`.
538 * Removed usage of `_mm_rcp_ps` from SSE2 implementation of `Quat::slerp` as
539 this instruction is not deterministic between Intel and AMD chips.
540
541 ## [0.15.1] - 2021-05-14
542
543 ### Changed
544
545 * Disable `const_assert_eq!` size and alignment checks for SPIR-V targets.
546
547 ## [0.15.0] - 2021-05-14
548
549 ### Breaking changes
550
551 * Removed `PartialOrd` and `Ord` trait implementations for all `glam` types.
552 * Removed deprecated `zero()`, `one()`, `unit_x()`, `unit_y()`, `unit_z()`,
553 `unit_w()`, `identity()` and `Mat2::scale()` methods.
554 * Remove problematic `Quat` `From` trait conversions which would allow creating
555 a non-uniform quaternion without necessarily realizing, including from
556 `Vec4`, `(x, y, z, w)` and `[f32; 4]`.
557
558 ### Added
559
560 * Added `EulerRot` enum for specifying Euler rotation order and
561 `Quat::from_euler()`, `Mat3::from_euler()` and `Mat4::from_euler()` which
562 support specifying a rotation order and angles of rotation.
563 * Added `Quat::to_euler()` method for extracting Euler angles.
564 * Added `Quat::from_vec4()` which is an explicit method for creating a
565 quaternion from a 4D vector. The method does not normalize the resulting
566 quaternion.
567 * Added `Mat3A` type which uses `Vec3A` columns. It is 16 byte aligned and
568 contains internal padding but it generally faster than `Mat3` for most
569 operations if SIMD is available.
570 * Added 3D affine transform types `Affine3A` and `DAffine3`. These are more
571 efficient than using `Mat4` and `DMat4` respectively when working with 3D
572 affine transforms.
573 * Added 2D affine transform types `Affine2` and `DAffine2`. These are more
574 efficient than using `Mat3` and `DMat3` respectively when working with 2D
575 affine transforms.
576 * Added `Quat::from_affine3()` to create a quaternion from an affine transform
577 rotation.
578 * Added explicit `to_array()` method to vector types to better match the matrix
579 methods.
580
581 ### Changed
582
583 * Deprecated `Quat::from_rotation_ypr()`, `Mat3::from_rotation_ypr()` and
584 `Mat4::from_rotation_ypr()` in favor of new `from_euler()` methods.
585 * Deprecated `Quat::from_rotation_mat3()` and `Quat::from_rotation_mat4()` in
586 favor of new `from_mat3` and `from_mat4` methods.
587 * Deprecated `TransformSRT` and `TransformRT` which are under the
588 `transform-types` feature. These will be moved to a separate experimental
589 crate.
590 * Updated `spirv-std` dependency version to `0.4.0-alpha7`.
591
592 ## [0.14.0] - 2021-04-09
593
594 ### Breaking changes
595
596 * Minimum Supported Version of Rust bumped to 1.45.0 for the `spirv-std`
597 dependency.
598
599 ### Added
600
601 * Added `AXES[]` constants to all vector types. These are arrays containing the
602 unit vector for each axis.
603 * Added quaternion `from_scaled_axis` and `to_scaled_axis` methods.
604
605 ### Changed
606
607 * Updated dependency versions of `bytemuck` to `1.5`, `rand` to `0.8`,
608 `rand_xoshiro` to `0.6` and `spirv-std` to `0.4.0-alpha4`.
609
610 ## [0.13.1] - 2021-03-24
611
612 ### Added
613
614 * Added vector `clamp()` functions.
615 * Added matrix column and row accessor methods, `col()` and `row()`.
616 * Added SPIR-V module and dependency on `spirv-std` for the SPIR-V target.
617 * Added matrix truncation from 4x4 to 3x3 and 3x3 to 2x2 via `From` impls.
618
619 ### Changed
620
621 * Documentation corrections and improvements.
622
623 ## [0.13.0] - 2021-03-04
624
625 ### Breaking Changes
626
627 * The behavior of the 4x4 matrix method `transform_point3()` was changed to not
628 perform the perspective divide. This is an optimization for use with affine
629 transforms where perspective correction is not required. The
630 `project_point3()` method was added for transforming points by perspective
631 projections.
632 * The 3x3 matrix `from_scale()` method was changed to
633 create a affine transform containing a 2-dimensional non-uniform scale to be
634 consistent with the 4x4 matrix version. The
635 `from_diagonal()` method can be used to create a 3x3 scale matrix.
636 * The 3x3 matrix methods `transform_point2_as_vec3a`,
637 `transform_vector2_as_vec3a` and `mul_vec3_as_vec3a` were unintentionally
638 `pub` and are no longer publicly accessible.
639
640 ### Added
641
642 * Added `Vec2::X`, `Vec4::W` etc constants as a shorter versions of `unit_x()`
643 and friends.
644 * Added `ONE` constants for vectors.
645 * Added `IDENTITY` constants for `Mat2`, `Mat3`, `Mat4` and `Quat`.
646 * Added `ZERO` constant for vectors and matrices.
647 * Added `clamp_length()`, `clamp_length_max()`, and `clamp_length_min` methods
648 for `f32` and `f64` vector types.
649 * Added `try_normalize()` and `normalize_or_zero()` for all real vector types.
650 * Added `from_diagonal()` methods to all matrix types for creating diagonal
651 matrices from a vector.
652 * Added `angle_between()`, `from_rotation_arc()` and
653 `from_rotation_arc_colinear()` to quaternion types.
654 * Added quaternion `inverse()` which assumes the quaternion is already
655 normalized and returns the conjugate.
656 * Added `from_translation()` and `from_angle()` methods to 3x3 matrix types.
657 * Added `project_point3()` method to 4x4 matrix types. This method is for
658 transforming 3D vectors by perspective projection transforms.
659 * Added `Eq` and `Hash` impls for integer vector types.
660
661 ### Changed
662
663 * Deprecated `::unit_x/y/z()`, `::zero()`, `::one()`, `::identity()` functions
664 in favor of constants.
665
666 ## [0.12.0] - 2021-01-15
667
668 ### Breaking Changes
669
670 * `Vec2Mask`, `Vec3Mask` and `Vec4Mask` have been replaced by `BVec2`, `BVec3`,
671 `BVec3A`, `BVec4` and `BVec4A`. These types are used by some vector methods
672 and are not typically referenced directly.
673
674 ### Added
675
676 * Added `f64` primitive type support
677 * vectors: `DVec2`, `DVec3` and `DVec4`
678 * square matrices: `DMat2`, `DMat3` and `DMat4`
679 * a quaternion type: `DQuat`
680 * Added `i32` primitive type support
681 * vectors: `IVec2`, `IVec3` and `IVec4`
682 * Added `u32` primitive type support
683 * vectors: `UVec2`, `UVec3` and `UVec4`
684 * Added `bool` primitive type support
685 * vectors: `BVec2`, `BVec3` and `BVec4`
686
687 ### Removed
688
689 * `build.rs` has been removed.
690
691 ## [0.11.3] - 2020-12-29
692
693 ### Changed
694
695 * Made `Vec3` `repr(simd)` for `spirv` targets.
696
697 ### Added
698
699 * Added `From<(Vec2, f32)>` for `Vec3` and `From<(Vec3, f32)` for `Vec4`.
700
701 ## [0.11.2] - 2020-12-04
702
703 ### Changed
704
705 * Compilation fixes for Rust 1.36.0.
706
707 ## [0.11.1] - 2020-12-03
708
709 ### Added
710
711 * Added support for the [Rust GPU](https://github.com/EmbarkStudios/rust-gpu)
712 SPIR-V target architecture.
713
714 ## [0.11.0] - 2020-11-26
715
716 ### Added
717
718 * Added `is_finite` method to all types which returns `true` if, and only if,
719 all contained elements are finite.
720 * Added `exp` and `powf` methods for all vector types.
721
722 ### Changed
723
724 * The `is_nan` method now returns a `bool` to match the new `is_finite` method
725 and to be consistent with the same methods on the `f32` and `f64` primitive
726 types.
727 * Renamed `is_nan` which returns a vector mask to `is_nan_mask`.
728 * Don't use the `cfg` definitions added by `build.rs` for defining structs as
729 `rust-analyzer` is not aware of them.
730
731 ### Removed
732
733 * Removed deprecated accessor methods.
734
735 ## [0.10.2] - 2020-11-17
736
737 ### Changed
738
739 * Deprecated element accessor members `.x()`, `.x_mut()`, `.set_x()`, etc. on
740 vector and quaternion types.
741 * Deprecated column accessor members `.x_axis()`, `.x_axis_mut()`,
742 `.set_x_axis()`, etc. on matrix types.
743
744 ## [0.10.1] - 2020-11-15
745
746 ### Added
747
748 * Added the `Vec2::perp` method which returns a `Vec2` perpendicular to `self`.
749
750 ### Changed
751
752 * `Vec2` and `Vec3` types were changed to use public named fields for `.x`,
753 `.y`, and `.z` instead of accessors.
754 * `Quat`, `Vec3A` and `Vec4` implement `Deref` and `DerefMut` for the new `XYZ`
755 and `XYZW` structs to emulate public named field access.
756 * `Mat3` and `Mat4` had their axis members made public instead of needing
757 accessors.
758 * `Mat2` implements `Deref` and `DerefMut` for the new `XYAxes` struct to
759 emulate public named field access.
760
761 ### Removed
762
763 * Removed deprecated `length_reciprocal` and `sign` methods.
764
765 ### Fixed
766
767 * Adding `glam` as a `no_std` dependency should now work as expected.
768
769 ## [0.10.0] - 2020-10-31
770
771 ### Breaking Changes
772
773 * Changed the return type of `Vec4::truncate` from `Vec3A` to `Vec3`.
774
775 ### Added
776
777 * Added `From` implementations to truncate to narrower vector types, e.g.
778 `Vec4` to `Vec3A`, `Vec3` and `Vec2` and from `Vec3A` and `Vec3` to `Vec2`.
779 * Added swizzles for `Vec4`, `Vec3A`, `Vec3` and `Vec2`. These can be used to
780 reorder elements in the same type and also to create larger or smaller
781 vectors from the given vectors elements.
782 * Added `Quat` operators `Add<Quat>`, `Sub<Quat>`, `Mul<f32>` and `Div<f32`.
783 These are used by other crates for interpolation quaternions along splines.
784 Note that these operations will not return unit length quaternions, thus the
785 results must be normalized before performing other `Quat` operations.
786 * Added `Mat4::transform_point3a` and `Mat4::transform_vector3a`.
787 * Added `AsRef<[f32; 9]>` and `AsMut<[f32; 9]>` trait implementations to `Mat3`.
788 * Added optional `bytemuck` support primarily for casting types to `&[u8]`.
789 * Added support for compiling with `no_std` by disabling the default `std`
790 feature and adding the `libm` feature.
791 * Added `distance` and `distance_squared` methods to `Vec2`, `Vec3`, `Vec3A`
792 and `Vec4`.
793
794 ## [0.9.5] - 2020-10-10
795
796 ### Added
797
798 * `glam` uses SSE2 for some types which prevents constructor functions can not
799 be made `const fn`. To work around this limitation the following macro
800 functions have been added to support creating `const` values of `glam` types:
801 `const_mat2`, `const_mat3`, `const_mat4`, `const_quat`, `const_vec2`,
802 `const_vec3`, `const_vec3a` and `const_vec4`.
803 * Added `is_nan` methods to `Vec2`, `Vec3`, `Vec3A` and `Vec4` which return a
804 mask.
805
806 ## Changed
807
808 * Renamed the vector `reciprocal` and `length_reciprocal` methods to `recip`
809 and `length_recip` to match the Rust standard library naming. The old methods
810 have been deprecated.
811 * Renamed the vector `sign` methods to `signum` match the Rust standard library
812 naming. The new methods now check for `NAN`. The old methods have been
813 deprecated.
814 * Added SSE2 optimized implementations of `Mat4::determinant` and
815 `Mat4::inverse`.
816
817 ### Removed
818
819 * Removed deprecated function `Mat4::perspective_glu_rh`.
820
821 ## [0.9.4] - 2020-08-31
822
823 ### Fixed
824
825 * Fixed `Mat4::transform_point3` to account for homogeneous w coordinate.
826 Previously this would have been incorrect when the resulting homogeneous
827 coordinate was not 1.0, e.g. when transforming by a perspective projection.
828 * Fixed `Mat3::transform_point2` to account for homogeneous z coordinate.
829
830 ## [0.9.3] - 2020-08-11
831
832 ### Added
833
834 * Added `Mat4::perspective_rh`.
835
836 ## [0.9.2] - 2020-07-09
837
838 ### Added
839
840 * Added `Mat3::mul_vec3a` and `Quat::mul_vec3a`.
841
842 ### Changed
843
844 * Changed `Quat::mul_vec3` to accept and return `Vec3` instead of `Vec3A`.
845
846 ## [0.9.1] - 2020-07-01
847
848 ### Added
849
850 * Added `Mat3 * Vec3A` implementation.
851 * Added `Vec3A` benches.
852
853 ### Changed
854
855 * Some documentation improvements around the new `Vec3A` type.
856
857 ## [0.9.0] - 2020-06-28
858
859 ### Added
860
861 * `Vec3` has been split into scalar `Vec3` and 16 byte aligned `Vec3A` types.
862 Only the `Vec3A` type currently uses SIMD optimizations.
863 * `Vec3Mask` has been split into scalar `Vec3Mask` and 16 byte aligned
864 `Vec3AMask` types.
865 * Added `mut` column accessors to all matrix types, e.g. `Mat2::x_axis_mut()`.
866 * Added `From` trait implementations for `Vec3AMask` and `Vec4Mask` to `__m128`.
867
868 ### Changed
869
870 * The `Mat3` type is using the scalar `Vec3` type for storage.
871 * Simplified `Debug` trait output for `Quat`, `Vec4` and `Vec3A`.
872
873 ## Removed
874
875 * Removed the `packed-vec3` feature flag as it is now redundant.
876
877 ## [0.8.7] - 2020-04-28
878
879 ### Added
880
881 * Added `Quat::slerp` - note that this uses a `sin` approximation.
882 * Added `angle_between` method for `Vec2` and `Vec3`.
883 * Implemented `Debug`, `Display`, `PartialEq`, `Eq`, `PartialOrd`, `Ord`,
884 `Hash`, and `AsRef` traits for `Vec2Mask`, `Vec3Mask` and `Vec4Mask`.
885 * Added conversion functions from `Vec2Mask`, `Vec3Mask` and `Vec4Mask` to an
886 array of `[u32]`.
887 * Added `build.rs` to simplify conditional feature compilation.
888
889 ### Changed
890
891 * Increased test coverage.
892
893 ### Removed
894
895 * Removed `cfg-if` dependency.
896
897 ## [0.8.6] - 2020-02-18
898
899 ### Added
900
901 * Added the `packed-vec3` feature flag to disable using SIMD types for `Vec3`
902 and `Mat3` types. This avoids wasting some space due to 16 byte alignment at
903 the cost of some performance.
904 * Added `x_mut`, `y_mut`, `z_mut`, `w_mut` where appropriate to `Vec2`, `Vec3`
905 and `Vec4`.
906 * Added implementation of `core::ops::Index` and `core::ops::IndexMut` for
907 `Vec2`, `Vec3` and `Vec4`.
908
909 ### Changed
910
911 * Merged SSE2 and scalar `Vec3` and `Vec4` implementations into single files
912 using the `cfg-if` crate.
913
914 ## [0.8.5] - 2020-01-02
915
916 ### Added
917
918 * Added projection functions `Mat4::perspective_lh`,
919 `Mat4::perspective_infinite_lh`, `Mat4::perspective_infinite_reverse_lh`,
920 `Mat4::orthgraphic_lh` and `Mat4::orthographic_rh`.
921 * Added `round`, `ceil` and `floor` methods to `Vec2`, `Vec3` and `Vec4`.
922
923 ## [0.8.4] - 2019-12-17
924
925 ### Added
926
927 * Added `Mat4::to_scale_rotation_translation` for extracting scale, rotation and
928 translation from a 4x4 homogeneous transformation matrix.
929 * Added `cargo-deny` GitHub Action.
930
931 ### Changed
932
933 * Renamed `Quat::new` to `Quat::from_xyzw`.
934
935 ## [0.8.3] - 2019-11-27
936
937 ### Added
938
939 * Added `Mat4::orthographic_rh_gl`.
940
941 ### Changed
942
943 * Renamed `Mat4::perspective_glu_rh` to `Mat4::perspective_rh_gl`.
944 * SSE2 optimizations for `Mat2::determinant`, `Mat2::inverse`,
945 `Mat2::transpose`, `Mat3::transpose`, `Quat::conjugate`, `Quat::lerp`,
946 `Quat::mul_vec3`, `Quat::mul_quat` and `Quat::from_rotation_ypr`.
947 * Disabled optimizations to `Mat4::transform_point3` and
948 `Mat4::transform_vector3` as they are probably incorrect and need
949 investigating.
950 * Added missing `#[repr(C)]` to `Mat2`, `Mat3` and `Mat4`.
951 * Benchmarks now store output of functions to better estimate the cost of a
952 function call.
953
954 ### Removed
955
956 * Removed deprecated functions `Mat2::new`, `Mat3::new` and `Mat4::new`.
957
958 ## [0.8.2] - 2019-11-06
959
960 ### Changed
961
962 * `glam_assert!` is no longer enabled by default in debug builds, it can be
963 enabled in any configuration using the `glam-assert` feature or in debug
964 builds only using the `debug-glam-assert` feature.
965
966 ### Removed
967
968 * `glam_assert!`'s checking `lerp` is bounded between 0.0 and 1.0 and that
969 matrix scales are non-zero have been removed.
970
971 ## [0.8.1] - 2019-11-03
972
973 ### Added
974
975 * Added `Display` trait implementations for `Mat2`, `Mat3` and `Mat4`.
976
977 ### Changed
978
979 * Disabled `glam`'s SSE2 `sin_cos` implementation - it became less precise for
980 large angle values.
981 * Reduced the default epsilon used by the `is_normalized!` macro from
982 `std::f32::EPSILON` to `1e-6`.
983
984 ## [0.8.0] - 2019-10-14
985
986 ### Removed
987
988 * Removed the `approx` crate dependency. Each `glam` type has an `abs_diff_eq`
989 method added which is used by unit tests for approximate floating point
990 comparisons.
991 * Removed the `Angle` type. All angles are now `f32` and are expected to
992 be in radians.
993 * Removed the deprecated `Vec2b`, `Vec3b` and `Vec4b` types and the `mask`
994 methods on `Vec2Mask`, `Vec3Mask` and `Vec4Mask`.
995
996 ### Changed
997
998 * The `rand` crate dependency has been removed from default features. This was
999 required for benchmarking but a simple random number generator has been added
1000 to the benches `support` module instead.
1001 * The `From` trait implementation converting between 1D and 2D `f32` arrays and
1002 matrix types have been removed. It was ambiguous how array data would map to
1003 matrix columns so these have been replaced with explicit methods
1004 `from_cols_array` and `from_cols_array_2d`.
1005 * Matrix `new` methods have been renamed to `from_cols` to be consistent with
1006 the other methods that create matrices from data.
1007 * Renamed `Mat4::perspective_glu` to `Mat4::perspective_glu_rh`.
1008
1009 ## [0.7.2] - 2019-09-22
1010
1011 ### Fixed
1012
1013 * Fixed incorrect projection matrix methods `Mat4::look_at_lh`
1014 and `Mat4::look_at_rh`.
1015
1016 ### Added
1017
1018 * Added support for building infinite projection matrices, including both
1019 standard and reverse depth `Mat4::perspective_infinite_rh` and
1020 `Mat4::perspective_infinite_rh`.
1021 * Added `Vec2Mask::new`, `Vec3Mask::new` and `Vec4Mask::new` methods.
1022 * Implemented `std::ops` `BitAnd`, `BitAndAssign`, `BitOr`, `BitOrAssign`
1023 and `Not` traits for `Vec2Mask`, `Vec3Mask` and `Vec4Mask`.
1024 * Added method documentation for `Vec4` and `Vec4Mask` types.
1025 * Added missing `serde` implementations for `Mat2`, `Mat3` and `Mat4`.
1026 * Updated `rand` and `criterion` versions.
1027
1028 ## [0.7.1] - 2019-07-08
1029
1030 ### Fixed
1031
1032 * The SSE2 implementation of `Vec4` `dot` was missing a shuffle, meaning the
1033 `dot`, `length`, `length_squared`, `length_reciprocal` and `normalize`
1034 methods were sometimes incorrect.
1035
1036 ### Added
1037
1038 * Added the `glam_assert` macro which behaves like Rust's `debug_assert` but
1039 can be enabled separately to `debug_assert`. This is used to perform
1040 asserts on correctness.
1041 * Added `is_normalized` method to `Vec2`, `Vec3` and `Vec4`.
1042
1043 ### Changed
1044
1045 * Replaced usage of `std::mem::uninitialized` with `std::mem::MaybeUninit`. This
1046 change requires stable Rust 1.36.
1047 * Renamed `Vec2b` to `Vec2Mask`, `Vec3b` to `Vec3Mask` and `Vec4b` to
1048 `Vec4Mask`. Old names are aliased to the new name and deprecated.
1049 * Deprecate `VecNMask` `mask` method, use new `bitmask` method instead
1050 * Made fallback version of `VecNMask` types the same size and alignment as the
1051 SIMD versions.
1052 * Added `Default` support to `VecNMask` types, will add more common traits in
1053 the future.
1054 * Added `#[inline]` to `mat2`, `mat3` and `mat4` functions.
1055
1056 ## [0.7.0] - 2019-06-28
1057
1058 ### Added
1059
1060 * Added `Mat2` into `[f32; 4]`, `Mat3` into `[f32; 9]` and `Mat4` into
1061 `[f32; 16]`.
1062
1063 ### Removed
1064
1065 * Removed `impl Mul<&Vec2> for Mat2` and `impl Mul<&Vec3> for Vec3` as these
1066 don't exist for any other types.
1067
1068 ## [0.6.1] - 2019-06-22
1069
1070 ### Changed
1071
1072 * `Mat2` now uses a `Vec4` internally which gives it some performance
1073 improvements when SSE2 is available.
1074
1075 ## 0.6.0 - 2019-06-13
1076
1077 ### Changed
1078
1079 * Switched from row vectors to column vectors
1080 * Vectors are now on the right of multiplications with matrices and quaternions.
1081
1082 [Keep a Changelog]: https://keepachangelog.com/
1083 [Semantic Versioning]: https://semver.org/spec/v2.0.0.html
1084 [Unreleased]: https://github.com/bitshifter/glam-rs/compare/0.28.0...HEAD
1085 [0.28.0]: https://github.com/bitshifter/glam-rs/compare/0.27.0...0.28.0
1086 [0.27.0]: https://github.com/bitshifter/glam-rs/compare/0.26.0...0.27.0
1087 [0.26.0]: https://github.com/bitshifter/glam-rs/compare/0.25.0...0.26.0
1088 [0.25.0]: https://github.com/bitshifter/glam-rs/compare/0.24.2...0.25.0
1089 [0.24.2]: https://github.com/bitshifter/glam-rs/compare/0.24.1...0.24.2
1090 [0.24.1]: https://github.com/bitshifter/glam-rs/compare/0.24.0...0.24.1
1091 [0.24.0]: https://github.com/bitshifter/glam-rs/compare/0.23.0...0.24.0
1092 [0.23.0]: https://github.com/bitshifter/glam-rs/compare/0.22.0...0.23.0
1093 [0.22.0]: https://github.com/bitshifter/glam-rs/compare/0.21.3...0.22.0
1094 [0.21.3]: https://github.com/bitshifter/glam-rs/compare/0.21.2...0.21.3
1095 [0.21.2]: https://github.com/bitshifter/glam-rs/compare/0.21.1...0.21.2
1096 [0.21.1]: https://github.com/bitshifter/glam-rs/compare/0.21.0...0.21.1
1097 [0.21.0]: https://github.com/bitshifter/glam-rs/compare/0.20.5...0.21.0
1098 [0.20.5]: https://github.com/bitshifter/glam-rs/compare/0.20.4...0.20.5
1099 [0.20.4]: https://github.com/bitshifter/glam-rs/compare/0.20.3...0.20.4
1100 [0.20.3]: https://github.com/bitshifter/glam-rs/compare/0.20.2...0.20.3
1101 [0.20.2]: https://github.com/bitshifter/glam-rs/compare/0.20.1...0.20.2
1102 [0.20.1]: https://github.com/bitshifter/glam-rs/compare/0.20.0...0.20.1
1103 [0.20.0]: https://github.com/bitshifter/glam-rs/compare/0.19.0...0.20.0
1104 [0.19.0]: https://github.com/bitshifter/glam-rs/compare/0.18.0...0.19.0
1105 [0.18.0]: https://github.com/bitshifter/glam-rs/compare/0.17.3...0.18.0
1106 [0.17.3]: https://github.com/bitshifter/glam-rs/compare/0.17.2...0.17.3
1107 [0.17.2]: https://github.com/bitshifter/glam-rs/compare/0.17.1...0.17.2
1108 [0.17.1]: https://github.com/bitshifter/glam-rs/compare/0.17.0...0.17.1
1109 [0.17.0]: https://github.com/bitshifter/glam-rs/compare/0.16.0...0.17.0
1110 [0.16.0]: https://github.com/bitshifter/glam-rs/compare/0.15.2...0.16.0
1111 [0.15.2]: https://github.com/bitshifter/glam-rs/compare/0.15.1...0.15.2
1112 [0.15.1]: https://github.com/bitshifter/glam-rs/compare/0.15.0...0.15.1
1113 [0.15.0]: https://github.com/bitshifter/glam-rs/compare/0.14.0...0.15.0
1114 [0.14.0]: https://github.com/bitshifter/glam-rs/compare/0.13.1...0.14.0
1115 [0.13.1]: https://github.com/bitshifter/glam-rs/compare/0.13.0...0.13.1
1116 [0.13.0]: https://github.com/bitshifter/glam-rs/compare/0.12.0...0.13.0
1117 [0.12.0]: https://github.com/bitshifter/glam-rs/compare/0.11.3...0.12.0
1118 [0.11.3]: https://github.com/bitshifter/glam-rs/compare/0.11.2...0.11.3
1119 [0.11.2]: https://github.com/bitshifter/glam-rs/compare/0.11.1...0.11.2
1120 [0.11.1]: https://github.com/bitshifter/glam-rs/compare/0.11.0...0.11.1
1121 [0.11.0]: https://github.com/bitshifter/glam-rs/compare/0.10.2...0.11.0
1122 [0.10.2]: https://github.com/bitshifter/glam-rs/compare/0.10.1...0.10.2
1123 [0.10.1]: https://github.com/bitshifter/glam-rs/compare/0.10.0...0.10.1
1124 [0.10.0]: https://github.com/bitshifter/glam-rs/compare/0.9.5...0.10.0
1125 [0.9.5]: https://github.com/bitshifter/glam-rs/compare/0.9.4...0.9.5
1126 [0.9.4]: https://github.com/bitshifter/glam-rs/compare/0.9.3...0.9.4
1127 [0.9.3]: https://github.com/bitshifter/glam-rs/compare/0.9.2...0.9.3
1128 [0.9.2]: https://github.com/bitshifter/glam-rs/compare/0.9.1...0.9.2
1129 [0.9.1]: https://github.com/bitshifter/glam-rs/compare/0.9.0...0.9.1
1130 [0.9.0]: https://github.com/bitshifter/glam-rs/compare/0.8.7...0.9.0
1131 [0.8.7]: https://github.com/bitshifter/glam-rs/compare/0.8.6...0.8.7
1132 [0.8.6]: https://github.com/bitshifter/glam-rs/compare/0.8.5...0.8.6
1133 [0.8.5]: https://github.com/bitshifter/glam-rs/compare/0.8.4...0.8.5
1134 [0.8.4]: https://github.com/bitshifter/glam-rs/compare/0.8.3...0.8.4
1135 [0.8.3]: https://github.com/bitshifter/glam-rs/compare/0.8.2...0.8.3
1136 [0.8.2]: https://github.com/bitshifter/glam-rs/compare/0.8.1...0.8.2
1137 [0.8.1]: https://github.com/bitshifter/glam-rs/compare/0.8.0...0.8.1
1138 [0.8.0]: https://github.com/bitshifter/glam-rs/compare/0.7.2...0.8.0
1139 [0.7.2]: https://github.com/bitshifter/glam-rs/compare/0.7.1...0.7.2
1140 [0.7.1]: https://github.com/bitshifter/glam-rs/compare/0.7.0...0.7.1
1141 [0.7.0]: https://github.com/bitshifter/glam-rs/compare/0.6.1...0.7.0
1142 [0.6.1]: https://github.com/bitshifter/glam-rs/compare/0.6.0...0.6.1