44 Method method,
const F& interrupt);
64 solve(data, result, size, spring_constant, mass, damping_constant, inc,
65 method, []() {
return false; });
76 Method method,
const F& interrupt);
84 solve(data, result, size, spring_constant, mass, damping_constant, inc,
85 initial_displacement, initial_velocity, method, []() {
return false; });
106 f *= spring_constant;
108 fpreal vel = (d1 - d2) / inc;
110 fpreal acc = (f - vel * damping_constant - d1 * spring_constant) / mass;
112 fpreal d = d1 + vel * inc;
127 Method method,
const F& interrupt)
129 fpreal d1 = initial_displacement;
130 fpreal d2 = d1 - initial_velocity * inc;
137 result[
j] = doSolve(data[
j], spring_constant, mass, damping_constant, inc, method, d1, d2);
147 Method method,
const F& interrupt)
156 fpreal initial_displacement = data[0];
157 fpreal initial_velocity = data[1] - initial_displacement;
159 solve(data, result, size, spring_constant, mass,
160 damping_constant, inc, initial_displacement, initial_velocity,
177 fpreal d = doSolve(f, spring_constant, mass, damping_constant, inc, method, d1, d2);
180 f /= spring_constant;
Method
Method used to compute the spring filter. Either position or force.
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
**But if you need a result
static void solve(const fpreal *data, fpreal *result, int size, fpreal spring_constant, fpreal mass, fpreal damping_constant, fpreal inc, fpreal initial_displacement, fpreal initial_velocity, Method method)
auto get_data(std::basic_string< Char > &s) -> Char *
static void solve(const fpreal *data, fpreal *result, int size, fpreal spring_constant, fpreal mass, fpreal damping_constant, fpreal inc, Method method, const F &interrupt)
GA_API const UT_StringHolder mass
static void solve(const fpreal *data, fpreal *result, int size, fpreal spring_constant, fpreal mass, fpreal damping_constant, fpreal inc, Method method)
static bool solveRealtime(const F &get_data, fpreal *result, int size, fpreal spring_constant, fpreal mass, fpreal damping_constant, fpreal inc, fpreal &d1, fpreal &d2, Method method)