avila-vec3d
3D Mathematics Library - 100% Rust, Zero Dependencies
Foundational 3D math types for graphics, games, and BIM applications.
Features
- Vec2, Vec3, Vec4: 2D/3D/4D vectors with complete operations
- Mat4: 4x4 transformation matrices (translation, rotation, scale, perspective)
- Quaternion: Rotation quaternions with slerp interpolation
- AABB: Axis-aligned bounding boxes with collision detection
- Ray: Ray casting with AABB intersection tests
Example
use ;
// Vector operations
let v1 = new;
let v2 = new;
let dot = v1.dot;
let cross = v1.cross;
// Matrix transformations
let translation = translation;
let rotation = rotation_y;
let transform = translation * rotation;
// Quaternions
let q = from_axis_angle;
let rotated = q.rotate_vec3;
// Bounding boxes
let mut aabb = EMPTY;
aabb.expand_point;
aabb.expand_point;
println!;
Zero Dependencies
Only uses serde for serialization (optional feature).
License
MIT OR Apache-2.0