8#include "system/physics/solver/solver.h"
9#include "system/physics/solver/solver_math.h"
11namespace Vkm::Engine {
34 float stiffness = 1.0f;
43 glm::mat3
mass = glm::mat3(0.0f);
44 glm::vec3
bias = {0.0f, 0.0f, 0.0f};
85 const std::vector<PhysicsBody>& bodies,
86 std::vector<JointConstraint>& joints,
99void warmStartJoints(std::vector<PhysicsBody>& bodies,
const std::vector<JointConstraint>& joints);
114 std::vector<PhysicsBody>& bodies,
115 std::vector<JointConstraint>& joints,
One joint, resolved to the two solver bodies it constrains.
Definition joint_solver.h:19
glm::vec3 impulse
Accumulated over this tick's passes from last tick's final value, world space.
Definition joint_solver.h:49
glm::vec3 anchorA
World, relative to A's origin.
Definition joint_solver.h:23
bool solvable
The solve's working state, built once per tick by prepareJoints.
Definition joint_solver.h:42
glm::vec3 holdImpulse
Accumulated like impulse, world space, within holdLimit.
Definition joint_solver.h:58
glm::vec3 anchorB
World, relative to B's origin.
Definition joint_solver.h:24
glm::quat heldRotation
B's rotation in A's frame that the hold keeps.
Definition joint_solver.h:52
glm::mat3 holdMass
Angular impulse per unit of relative spin.
Definition joint_solver.h:56
glm::vec3 bias
Relative velocity that closes the drift, stiffness applied.
Definition joint_solver.h:44
glm::vec3 holdBias
Relative spin that turns the pair back.
Definition joint_solver.h:57
bool holdSolvable
False when free, or nothing can turn.
Definition joint_solver.h:55
glm::mat3 mass
Impulse per unit of relative anchor velocity.
Definition joint_solver.h:43
float holdLimit
Most angular impulse it carries this tick.
Definition joint_solver.h:53
float holdTorque
Joint::holdTorque; 0 leaves the rotation free.
Definition joint_solver.h:51
float distance
Distance the anchors are held at; negative for a point joint.
Definition joint_solver.h:32
The two springs a joint solves with: the anchors', and the softer hold on the angle.
Definition joint_solver.h:64
The three numbers that make a correction a stiff, damped spring.
Definition solver_math.h:70