vek/lib.rs
1//! Generic 2D-3D math swiss army knife for game engines, with SIMD support and focus on convenience.
2//!
3//! See [the wiki](https://github.com/yoanlcq/vek/wiki) for an overview, FAQ, guides, and other info.
4//!
5//! Issues and bug reports are very welcome!
6//!
7//! # Cargo features
8//!
9//! - `vec8`, `vec16`, `vec32`, `vec64`, `rgba`, `rgb`, `uvw`, `uv`
10//! Enable these types.
11//! Other types are always enabled for the sake of doc-tests.
12//! - `repr_simd` enables Nightly Rust's `repr_simd` and `simd_ffi` features, and unlock
13//! SIMD versions of all appropriate types (though `repr_simd` modules).
14//! On Stable, this feature has no effect.
15//! - `serde` makes vectors and matrices derive `Serialize` and `Deserialize`.
16//! - `image` makes color vectors implement the `Pixel` trait from the `image` crate.
17//! - `mint` enables conversion to the `mint` crate's types.
18//! `mint` is an interoperability layer for math libraries.
19//!
20//! # `#![no_std]`
21//! This crate is `#![no_std]`.
22
23#![no_std]
24#![doc(
25 test(attr(deny(warnings))),
26 html_root_url = "https://docs.rs/vek/0.17.2",
27 //html_logo_url = "https://yoanlcq.github.io/vek/logo.png",
28 //html_favicon_url = "https://yoanlcq.github.io/vek/favicon.ico",
29)]
30#![warn(missing_docs)]
31#![allow(stable_features)]
32#![deny(unconditional_recursion)]
33//#![deny(warnings)]
34//#![allow(unknown_lints)]
35//#![deny(incoherent_fundamental_impls)]
36//#![cfg_attr(all(nightly, feature="repr_simd" ), feature(cfg_target_feature))]
37#![cfg_attr(all(nightly, feature = "repr_simd"), feature(repr_simd, simd_ffi))]
38#![cfg_attr(all(nightly, feature = "platform_intrinsics"), allow(internal_features))] // We're not scared of core_intrinsics aye... They keep moving around but have actually been there since the dawn of time and not changed much.
39#![cfg_attr(all(nightly, feature = "platform_intrinsics"), feature(portable_simd, core_intrinsics))]
40//#![cfg_attr(feature="repr_simd", allow(improper_ctypes)]
41//#![cfg_attr(feature="repr_simd", feature(link_llvm_intrinsics)]
42#![cfg_attr(all(nightly, test), feature(test))]
43
44// See https://github.com/yoanlcq/vek/pull/84
45// Rust 1.59 was complaining: "error: recursion limit reached while expanding reduce_fn! in src/vec.rs:47:69"
46#![recursion_limit = "256"]
47
48extern crate core as std;
49
50#[cfg(test)]
51mod vtest;
52
53#[cfg(feature = "serde")]
54#[macro_use]
55pub extern crate serde;
56
57#[cfg(feature = "mint")]
58pub extern crate mint;
59
60#[cfg(feature = "bytemuck")]
61pub extern crate bytemuck;
62
63#[cfg(feature = "az")]
64pub extern crate az;
65
66pub extern crate num_integer;
67pub extern crate num_traits;
68
69// NOTE: Allow unused imports here, because usage depends on which features are enabled.
70#[allow(unused_imports)]
71#[macro_use]
72pub extern crate approx;
73
74pub mod ops;
75pub use crate::ops::*;
76pub mod vec;
77pub use crate::vec::repr_c::*;
78pub mod mat;
79pub use crate::mat::repr_c::*;
80pub mod quaternion;
81pub use crate::quaternion::repr_c::*;
82pub mod transition;
83pub use crate::transition::*;
84pub mod transform;
85pub use crate::transform::*;
86pub mod bezier;
87pub use crate::bezier::repr_c::*;
88pub mod geom;
89pub use crate::geom::{repr_c::*, FrustumPlanes};