Toast Engine
Loading...
Searching...
No Matches
constraint.hpp
Go to the documentation of this file.
1
7
8#pragma once
9
10#include "collision.hpp"
11#include "material_defaults.hpp"
12
13#include <glm/vec2.hpp>
14#include <glm/vec3.hpp>
15
16namespace physics {
17
18struct Constraint {
19 BroadPhasePair pair;
20 uint8_t normal_index = k_primitive_manifold_normal_index;
21 ContactFeatureID feature_a = {};
22 ContactFeatureID feature_b = {};
23 BodyID body_a;
24 BodyID body_b;
25 glm::vec3 contact_point = {};
26 glm::vec3 normal = {};
27 glm::vec3 tangent_1 = {};
28 glm::vec3 tangent_2 = {};
29 glm::vec3 r_a = {};
30 glm::vec3 r_b = {};
31 float penetration = 0.0f;
32
33 float normal_mass = 0.0f;
34 float tangent_mass_1 = 0.0f;
35 float tangent_mass_2 = 0.0f;
36 float restitution_bias = 0.0f;
37
38 float static_friction = material_defaults::k_static_friction;
39 float dynamic_friction = material_defaults::k_dynamic_friction;
40 float accumulated_normal_impulse = 0.0f;
41 glm::vec2 accumulated_tangent_impulse = {};
42 float rolling_friction = 0.0f;
43 float spin_friction = 0.0f;
44 float rolling_mass_1 = 0.0f;
45 float rolling_mass_2 = 0.0f;
46 float spin_mass = 0.0f;
47 glm::vec2 accumulated_rolling_impulse = {};
48 float accumulated_spin_impulse = 0.0f;
49};
50
51}
Canonical collision-pair records shared by broad and narrow phases.
The values a material has when nothing sets them.
Definition body.hpp:20
Definition collision.hpp:24
Definition constraint.hpp:18
Definition shape.hpp:48