Skip to main content

molgfx_math/
lib.rs

1//! glam-based math foundation: cameras, projections, bounds, splines,
2//! transport frames.
3//!
4//! Conventions carried by every type here: the world unit is the Ångström,
5//! all spaces are right-handed with +X right, +Y up and +Z toward the viewer,
6//! the camera looks down −Z, and clip depth uses the reversed [0, 1] range
7//! (near maps to 1.0, far to 0.0) so floating-point depth precision spreads
8//! evenly across a molecular scene.
9
10#![forbid(unsafe_code)]
11
12mod bounds;
13mod camera;
14mod curves;
15pub mod parallel;
16mod quantize;
17pub mod simd;
18mod types;
19
20pub(crate) use bounds::aabb;
21pub(crate) use camera::projection;
22
23pub use bounds::{
24    Aabb, BoundingSphere, Bvh, BvhBuildError, BvhBuildScratch, BvhNode, BvhSource, SphereBounds,
25    SweptSphereBounds,
26};
27pub use camera::{Camera, Projection};
28pub use curves::{
29    CurveSample, TransportFrame, parallel_transport, sample_catmull_rom,
30    sample_catmull_rom_demanding, sample_catmull_rom_fixed, sample_cubic_bezier,
31};
32pub use parallel::{BLOCK, map_zip_blocks_into};
33pub use quantize::{round_u8, truncate_u16, unit_to_grid, unorm8};
34pub use types::{Mat3, Mat4, Quat, Rgba8, Vec2, Vec3, Vec4};