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

◆ assemble_from_components()

template<typename T >
T MayaFlux::Kinesis::assemble_from_components ( const std::array< double, estimate_component_count_v< T > > &  components)
inlinenoexcept

Assemble a scalar or vector T from N doubles.

Inverse of reading T's components. Plain arithmetic T constructs directly from components[0]. glm vector T constructs component-wise.

Definition at line 40 of file MotionChannel.hpp.

41{
42 if constexpr (GlmType<T>) {
43 using Comp = glm_component_type<T>;
44 T result {};
45 for (size_t i = 0; i < estimate_component_count_v<T>; ++i)
46 result[static_cast<glm::length_t>(i)] = static_cast<Comp>(components[i]);
47 return result;
48 } else {
49 return static_cast<T>(components[0]);
50 }
51}