MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Kinesis::Lattice3D Struct Reference

A regular subdivision of an AABB3D into a cell count per axis. More...

#include <Lattice.hpp>

+ Collaboration diagram for MayaFlux::Kinesis::Lattice3D:

Public Member Functions

glm::uvec3 cell_at (const glm::vec3 &p) const noexcept
 Cell containing a world position, clamped to the lattice.
 
glm::vec3 cell_center (const glm::uvec3 &c) const noexcept
 World position of a cell's centre.
 
size_t cell_count () const noexcept
 Total cell count.
 
glm::vec3 cell_size () const noexcept
 Edge length of one cell along each axis.
 
size_t corner_count () const noexcept
 Corner count, one greater than the cell count on each axis.
 
glm::vec3 corner_position (const glm::uvec3 &c) const noexcept
 World position of a lattice corner.
 
bool in_bounds (const glm::uvec3 &c) const noexcept
 Whether a cell coordinate lies inside the lattice.
 
size_t index (const glm::uvec3 &c) const noexcept
 Linear index of a cell, x-major.
 
Lattice3D resampled (const glm::uvec3 &res) const noexcept
 A lattice over the same bounds at a different resolution.
 

Public Attributes

AABB3D bounds { .min = glm::vec3(-1.0F), .max = glm::vec3(1.0F) }
 Continuous extent subdivided.
 
glm::uvec3 resolution { 1U }
 Cell count per axis. Zero on any axis is invalid.
 

Detailed Description

A regular subdivision of an AABB3D into a cell count per axis.

Pairs the continuous extent AABB3D describes with the discrete resolution a sampled field, a simulation grid, or an extraction pass imposes on it. Everything else is derived: cell size, cell centre, corner position, linear index.

Indexing is x-major, y next, z outermost, matching the layout volume_common.glsl assumes and the order VolumeGridBuffer allocates in. A different traversal order is a different type, not a flag on this one.

Cell-centred and corner-sampled are both expressed here rather than chosen at construction: marching cubes reads corners of the same lattice whose centres a simulation writes, and forcing that choice into the type would require two lattices where one describes the geometry.

Definition at line 25 of file Lattice.hpp.


The documentation for this struct was generated from the following file: