[package]
name = "gemath"
version = "0.1.0"
edition = "2024"
description = "Type-safe game math with type-level units/spaces, typed angles, and explicit fallible ops (plus optional geometry/collision)."
license = "MIT OR Apache-2.0"
readme = "README.md"
documentation = "https://docs.rs/gemath"
repository = "https://github.com/bogwi/gemath"
homepage = "https://github.com/bogwi/gemath"
keywords = ["math", "gamedev", "linear-algebra", "collision", "no-std"]
categories = ["mathematics", "game-development", "no-std"]
rust-version = "1.85"
exclude = ["dev/**"]
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[dependencies]
half = "2.6.0"
libm = { version = "0.2", optional = true }
mint = { version = "0.5.9", optional = true }
serde = { version = "1.0", optional = true, features = ["derive"] }
[dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }
glam = "0.30.3"
proptest = "1"
serde_json = "1.0"
[features]
default = ["std", "full"]
std = ["math"]
alloc = []
libm = ["dep:libm", "math"]
math = []
scalar = ["math"]
angle = ["scalar"]
half_float = []
vec2 = ["angle"]
vec3 = ["angle"]
vec4 = ["vec3", "math"]
mat2 = ["vec2"]
mat3 = ["vec3", "math"]
mat4 = ["vec4", "math"]
quat = ["vec4", "math"]
unit_vec = ["vec2", "vec3", "vec4"]
rect2 = ["vec2"]
rect3 = ["vec3"]
aabb2 = ["vec2"]
aabb3 = ["vec3"]
geometry = ["vec2", "vec3"]
collision = ["geometry", "rect2", "rect3", "aabb2", "aabb3"]
spatial = ["geometry", "aabb2", "aabb3"]
polygon2 = ["vec2"]
full = [
"half_float",
"angle",
"scalar",
"vec2",
"vec3",
"vec4",
"mat2",
"mat3",
"mat4",
"quat",
"unit_vec",
"rect2",
"rect3",
"aabb2",
"aabb3",
"geometry",
"collision",
"spatial",
"polygon2",
]
mint = ["dep:mint", "vec2", "vec3", "vec4", "mat2", "mat3", "mat4", "quat"]
serde = ["dep:serde", "half/serde"]
[[bench]]
name = "math_benchmarks"
path = "benches/math_benchmarks.rs"
harness = false
[[bench]]
name = "spatial_benchmarks"
path = "benches/spatial_benchmarks.rs"
harness = false