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

◆ position_at()

std::optional< glm::vec3 > MayaFlux::Kinesis::position_at ( std::span< const std::byte >  bytes,
size_t  stride,
size_t  offset,
size_t  index 
)
inlinenoexcept

Position of one record in interleaved vertex bytes.

Parameters
bytesInterleaved records.
strideBytes per record.
offsetByte offset of the vec3 position within a record.
indexRecord index.
Returns
The position, or nullopt when the position does not lie inside bytes or stride is too small to hold it.

Definition at line 147 of file Morphology.hpp.

152{
153 if (stride < offset + sizeof(glm::vec3)
154 || index * stride + offset + sizeof(glm::vec3) > bytes.size())
155 return std::nullopt;
156 glm::vec3 p;
157 std::memcpy(&p, bytes.data() + index * stride + offset, sizeof(glm::vec3));
158 return p;
159}
uint64_t offset
Definition Composite.cpp:10
uint32_t index
Definition VKDevice.cpp:122

References index, and offset.

Referenced by centroid(), and surface_centroid().

+ Here is the caller graph for this function: