Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
SpringBoneSolver.cpp File Reference
#include "SpringBoneSolver.hpp"
#include <algorithm>
#include <cmath>
Include dependency graph for SpringBoneSolver.cpp:

Go to the source code of this file.

Namespaces

namespace  esengine
namespace  esengine::springbone

Functions

void esengine::springbone::reset (std::vector< Particle > &chain)
 Sets every particle to rest at its target: the state a chain starts in and the one it is put back in after a teleport.
glm::quat esengine::springbone::shortestArc (const glm::vec3 &from, const glm::vec3 &to)
 The shortest rotation that turns direction from onto direction to; identity when either has no length.
bool esengine::springbone::pushOut (glm::vec3 &p, const Collider &c, f32 extra)
 Moves p out of c if it is inside (radius widened by extra), returning whether it moved.
f32 esengine::springbone::gustFactor (f32 time, f32 frequency, f32 gust, i32 index)
 The factor gusts put on the wind's strength for a particle at a moment: a travelling wave down the chain, so the strand ripples instead of swaying as one.
void esengine::springbone::step (std::vector< Particle > &chain, const StepParams &params, const std::vector< Collider > &colliders, f32 dt)
 Advances the chain by dt seconds.