1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
//! Math for game engines: vectors, matrices, quaternions, geometry.
//!
//! SIMD is used when the `simd` feature is on and the target is x86_64 or aarch64;
//! otherwise scalar. Column vectors; multiply by matrices on the left. See README for feature flags.
//!
//! # Modules
//!
//! Vectors: `vec2`, `vec3`, `vec4`, `ivec2`–`ivec4`, `uvec2`–`uvec4`, `bvec`, `dvec3`.
//! Matrices: `mat2`, `mat3`, `mat4`, `dmat4`. Quaternions: `quat`, `dquat`.
//! Transforms: `affine2`, `affine3`. Geometry: `geometry` (plane, ray, AABB, frustum).
//! Angles: `angle` (Rad, Deg, EulerRot). Utilities: `utils`. Optional interop: `compat`.
//!
//! # Examples
//!
//! Vectors and normalization:
//!
//! ```rust
//! use algebrix::{Vec3, Rad, Deg};
//!
//! let v = Vec3::new(3.0, 4.0, 0.0);
//! assert!((v.length() - 5.0).abs() < 1e-5);
//! let u = v.normalize();
//! let half_turn = Rad::from(Deg::new(90.0));
//! ```
//!
//! Transform and quaternion:
//!
//! ```rust
//! use algebrix::{Mat4, Quat, Vec3};
//!
//! let t = Mat4::from_translation(Vec3::new(1.0, 0.0, 0.0));
//! let p = t.transform_point3(Vec3::ZERO);
//! assert_eq!(p, Vec3::new(1.0, 0.0, 0.0));
//!
//! let q = Quat::from_axis_angle(Vec3::Z, std::f32::consts::FRAC_PI_2);
//! let x_rotated = q * Vec3::X;
//! assert!((x_rotated - Vec3::Y).length() < 1e-5);
//! ```
pub use Vec2;
pub use Vec3;
pub use Vec4;
pub use IVec2;
pub use IVec3;
pub use IVec4;
pub use UVec2;
pub use UVec3;
pub use UVec4;
pub use ;
pub use ;
pub use Mat2;
pub use Mat3;
pub use Mat4;
pub use DMat4;
pub use Quat;
pub use DQuat;
pub use DVec3;
pub use Affine2;
pub use Affine3;
pub use ;
pub use ;
pub use *;