#include <H3DNetworkingUtils/VecFilter.h>
Public Member Functions | |
VecFilter (int sample_sz) | |
Constructor = the sample_sz is the number of past samples to average over. | |
H3DUtil::ArithmeticTypes::Vec3f | filter (H3DUtil::ArithmeticTypes::Vec3f const &raw_value, double time) |
Returns the filtered average of the values in raw_vals The parameters to filter() are deque's to enable a sliding window of raw_values to be used, by popping a value off the start and adding one on to the end before each call. | |
virtual void | resetValue (int sample_sz) |
Reset all historical values to start sampling a fresh, with a new sample size. | |
int | sampleSize () const |
Returns the sample size. |
It takes a moving Vec3f, (represented by a number of Vec3f / time pairs), and filters it with a sin(t)/t function. The number of samples averaged is the number of samples in the array passed to filter.
H3DUtil::ArithmeticTypes::Vec3f H3DNetworkingUtils::VecFilter::filter | ( | H3DUtil::ArithmeticTypes::Vec3f const & | raw_value, | |
double | time | |||
) |
Returns the filtered average of the values in raw_vals
The parameters to filter() are deque's to enable a sliding window of raw_values to be used, by popping a value off the start and adding one on to the end before each call.
Referenced by H3DNetworkingUtils::FilteredSFVec3f::update().