macaw/
lib.rs

1//! A friendly opinionated game math library built on top the excellent lower-level [`glam`](https://github.com/bitshifter/glam-rs).
2
3#![cfg_attr(target_arch = "spirv", feature(repr_simd, core_intrinsics))]
4#![cfg_attr(target_arch = "spirv", no_std)]
5
6mod affine3;
7mod bounding_box;
8#[cfg(not(target_arch = "spirv"))]
9mod color_rgba8;
10mod conformal;
11mod dual_quat;
12mod fixed;
13mod float_ext;
14mod iso_transform;
15mod mat3_ext;
16#[cfg(not(target_arch = "spirv"))]
17mod mesh_gen;
18mod plane3;
19#[cfg(not(target_arch = "spirv"))]
20mod quat_ext;
21mod ray3;
22mod utils;
23mod vec2_ext;
24mod vec3_ext;
25mod vec4_ext;
26
27pub use self::affine3::*;
28pub use self::bounding_box::*;
29pub use self::conformal::*;
30pub use self::dual_quat::*;
31pub use self::fixed::*;
32pub use self::float_ext::*;
33pub use self::iso_transform::*;
34pub use self::mat3_ext::*;
35pub use self::plane3::*;
36pub use self::ray3::*;
37pub use self::utils::*;
38pub use self::vec2_ext::*;
39pub use self::vec3_ext::*;
40pub use self::vec4_ext::*;
41
42#[cfg(not(target_arch = "spirv"))]
43pub use color_rgba8::*;
44#[cfg(not(target_arch = "spirv"))]
45pub use mesh_gen::*;
46#[cfg(not(target_arch = "spirv"))]
47pub use quat_ext::*;
48
49/// Prelude module with extension traits
50pub mod prelude {
51    pub use crate::FloatExt;
52    pub use crate::Vec2Ext;
53    pub use crate::Vec2Swizzles;
54    pub use crate::Vec3Ext;
55    pub use crate::Vec3Swizzles;
56    pub use crate::Vec4Ext;
57    pub use crate::Vec4Swizzles;
58
59    #[cfg(not(target_arch = "spirv"))]
60    pub use crate::QuatExt;
61}
62
63// Re-export main glam types.
64// i32
65pub use glam::IVec2;
66pub use glam::IVec3;
67pub use glam::IVec4;
68pub use glam::ivec2;
69pub use glam::ivec3;
70// u32
71pub use glam::UVec2;
72pub use glam::UVec3;
73pub use glam::UVec4;
74pub use glam::uvec2;
75pub use glam::uvec3;
76pub use glam::uvec4;
77// f32
78pub use glam::Affine3A;
79pub use glam::Mat2;
80pub use glam::Mat3;
81pub use glam::Mat3A;
82pub use glam::Mat4;
83pub use glam::Quat;
84pub use glam::Vec2;
85pub use glam::Vec3;
86pub use glam::Vec3A;
87pub use glam::Vec4;
88pub use glam::mat2;
89pub use glam::mat3;
90pub use glam::mat3a;
91pub use glam::mat4;
92pub use glam::quat;
93pub use glam::vec2;
94pub use glam::vec3;
95pub use glam::vec3a;
96pub use glam::vec4;
97// f64
98pub use glam::DAffine2;
99pub use glam::DAffine3;
100pub use glam::DMat2;
101pub use glam::DMat3;
102pub use glam::DMat4;
103pub use glam::DQuat;
104pub use glam::DVec2;
105pub use glam::DVec3;
106pub use glam::DVec4;
107pub use glam::dmat2;
108pub use glam::dmat3;
109pub use glam::dmat4;
110pub use glam::dquat;
111pub use glam::dvec2;
112pub use glam::dvec3;
113pub use glam::dvec4;
114// other
115pub use glam::EulerRot;
116pub use glam::Vec2Swizzles;
117pub use glam::Vec3Swizzles;
118pub use glam::Vec4Swizzles;