Crates.io | vector-traits |
lib.rs | vector-traits |
version | 0.3.4 |
source | src |
created_at | 2023-10-22 13:30:05.452595 |
updated_at | 2023-12-08 19:27:24.358946 |
description | Rust traits for 2D and 3D vector types. |
homepage | |
repository | https://codeberg.org/eadf/vector_traits_rs |
max_upload_size | |
id | 1010589 |
size | 66,706 |
vector-traits
is a Rust crate designed to provide a set of traits for abstracting over different vector
implementations and scalar types, offering a unified interface for a basic set of vector operations. This crate facilitates
seamless transitions between different vector libraries and scalar precisions (e.g., f32
and f64
) without
requiring significant code modifications.
GenericVector2
and GenericVector3
traits.GenericScalar
for a flexible scalar type handling.HasXY
and HasXYZ
for custom vector storage types, e.g., FFI types.cgmath
and glam
.f32
, f64
) effortlessly.Currently, the following vector types from cgmath
and glam
libraries are supported:
glam::Vec2
,glam::DVec2
,glam::Vec3
,glam::Vec3A
and glam::DVec3
cgmath::Vector2
andcgmath::Vector3
(for f32
and f64
)Add vector-traits
to your Cargo.toml
dependencies along with the desired features:
[dependencies]
vector-traits = { version = "0.3.4", features = ["glam", "cgmath"] } # only use what you need
For a deeper dive into vector-traits functionality, check the documentation generated by cargo doc or browse it online here.
We welcome contributions from the community. Feel free to submit pull requests or report issues on our GitHub repository. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Licensed under either of
at your option.