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

◆ path_length() [1/2]

float MayaFlux::Kinesis::path_length ( const Memory::HistoryBuffer< glm::vec2 > &  history,
size_t  window 
)
inlinenoexcept

Path length accumulated across the newest window positions.

Parameters
historyBuffer of positions, capacity >= window
windowNumber of samples spanning window - 1 segments, minimum 2
Returns
Sum of consecutive segment lengths

Definition at line 453 of file Differential.hpp.

454{
455 window = window < 2 ? 2 : window;
456 float len = 0.0F;
457 for (size_t i = 0; i + 1 < window; ++i)
458 len += glm::length(history[i] - history[i + 1]);
459 return len;
460}

Referenced by path_length(), and straightness().

+ Here is the caller graph for this function: