Files
Oxide/engine/src/math/mod.rs
T
Homer Simpson f56a1eea3b Import Oxide engine (Stages 0–10) under MIT license
Full project snapshot migrated to new Gitea remote without history:
engine, editor, physics, script, examples, tests, docs, and assets.
Relicensed from GPLv3 to MIT and updated repo URLs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-05 20:41:02 +02:00

40 lines
1.3 KiB
Rust

//! Math and core geometric primitives.
//!
//! This module is the foundation every other Oxide system depends on. It builds
//! on [`glam`] for vectors, quaternions, and matrices, and adds the engine's own
//! higher-level types:
//!
//! - [`Transform`] — decomposed translation/rotation/scale, the unit of placement
//! - [`Aabb`] — axis-aligned bounding box for bounds and culling
//! - [`Ray`] — origin + direction, for picking and queries
//! - [`Plane`] — infinite plane in Hessian normal form
//! - [`Frustum`] — six-plane view volume for visibility culling
//! - [`Color`] — linear RGBA color with sRGB conversion
//! - [`Rect`] — 2D rectangle for UI and viewports
//! - [`Range3`] — 3D value range for clamping and remapping
//!
//! `glam`'s own types are re-exported so downstream crates have a single import
//! site for all math.
mod aabb;
mod color;
mod frustum;
mod plane;
mod range3;
mod ray;
mod rect;
mod transform;
pub use aabb::Aabb;
pub use color::Color;
pub use frustum::Frustum;
pub use plane::Plane;
pub use range3::Range3;
pub use ray::Ray;
pub use rect::Rect;
pub use transform::Transform;
// Re-export the most commonly used `glam` types so consumers don't need a
// separate dependency on `glam` for everyday math.
pub use glam::{EulerRot, Mat3, Mat4, Quat, Vec2, Vec3, Vec4};