Expand description
glam-based math foundation: cameras, projections, bounds, splines, transport frames.
Conventions carried by every type here: the world unit is the Ångström, all spaces are right-handed with +X right, +Y up and +Z toward the viewer, the camera looks down −Z, and clip depth uses the reversed [0, 1] range (near maps to 1.0, far to 0.0) so floating-point depth precision spreads evenly across a molecular scene.
Re-exports§
pub use parallel::BLOCK;pub use parallel::map_zip_blocks_into;
Modules§
- parallel
- Threshold-guarded data parallelism with a thread-count-independent shape.
- simd
- Width-agnostic kernels over the columns the load path sweeps.
Structs§
- Aabb
- An axis-aligned bounding box in whichever space its points came from.
- Bounding
Sphere - A sphere enclosing a set of geometry; the shape cameras frame against.
- Bvh
- Flat hierarchy and stable source-primitive permutation.
- BvhBuild
Error - A hierarchy offset cannot be represented by the GPU node layout.
- BvhBuild
Scratch - Reusable construction workspace. Keeping it beside a dynamic structure makes trajectory-driven hierarchy rebuilds allocation-free after warmup.
- BvhNode
- One compact BVH node. Internal children are adjacent; leaves address the hierarchy’s primitive-index array.
- Camera
- A look-at camera in world space (right-handed, +Y up, looking down −Z in its own view space).
- Curve
Sample - One sampled point and unit tangent along a spline.
- Mat3
- A column-major 3×3 matrix.
- Mat4
- A SIMD-aligned column-major 4×4 matrix.
- Quat
- A SIMD-aligned quaternion stored as
(x, y, z, w). - Rgba8
- A color packed as four 8-bit channels, in memory order red, green, blue, alpha. Exactly four bytes, so a per-atom color column stays compact and uploads without conversion.
- Sphere
Bounds - Bounds derived from a position column and a radius column.
- Swept
Sphere Bounds - Bounds swept between two position columns sharing one radius column.
- Transport
Frame - Orthonormal frame carried along a curve.
- Vec2
- A two-component single-precision vector.
- Vec3
- A three-component single-precision vector.
- Vec4
- A four-component SIMD-aligned single-precision vector.
Enums§
- Projection
- How a camera maps view space to clip space.
Traits§
- BvhSource
- A random-access supply of primitive bounds.
Functions§
- parallel_
transport - Builds minimal-rotation frames into caller-owned storage. The initial axis is selected deterministically to avoid degeneracy near a world axis.
- round_
u8 - Rounds a value already expressed in
0..=255units, ties upward. - sample_
catmull_ rom - Samples a centripetal-looking uniform Catmull-Rom trace with more samples
where midpoint deviation and tangent change are high. Output storage is
caller-owned and reused; work and output are bounded by
max_steps. - sample_
catmull_ rom_ demanding - Adaptive sampling with one extra per-interval demand the curve cannot see.
- sample_
catmull_ rom_ fixed - Fixed-step Catmull-Rom sampling: the form a GPU kernel evaluates in
parallel, one invocation per sample. The basis is identical to
sample_catmull_rom— only the per-segment step count is a constant instead of curvature-adaptive — so this doubles as the CPU parity reference for thesplinecompute shader. Output storage is caller-owned and reused. - sample_
cubic_ bezier - Samples a cubic Bezier segment, including both endpoints.
- truncate_
u16 - Truncates a non-negative value to
u16, saturating at the maximum. - unit_
to_ grid - Truncates a unit value onto a grid of
levels + 1steps. - unorm8
- Rounds a unit value to unorm8 with ties resolved upward.