MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ cell_at()

glm::uvec3 MayaFlux::Kinesis::Lattice3D::cell_at ( const glm::vec3 &  p) const
inlinenoexcept

Cell containing a world position, clamped to the lattice.

Parameters
pWorld position. Points outside bounds clamp to the edge cell.

Definition at line 88 of file Lattice.hpp.

89 {
90 const glm::vec3 local = (p - bounds.min) / cell_size();
91 const glm::vec3 clamped = glm::clamp(
92 glm::floor(local), glm::vec3(0.0F), glm::vec3(resolution) - 1.0F);
93 return glm::uvec3(clamped);
94 }
glm::vec3 cell_size() const noexcept
Edge length of one cell along each axis.
Definition Lattice.hpp:30
AABB3D bounds
Continuous extent subdivided.
Definition Lattice.hpp:27
glm::uvec3 resolution
Cell count per axis. Zero on any axis is invalid.
Definition Lattice.hpp:26

References bounds, cell_size(), MayaFlux::Kinesis::AABB3D::min, and resolution.

+ Here is the call graph for this function: