1 #ifndef BLOBS_WORLD_CREATURECREATURECOLLISION_HPP_
2 #define BLOBS_WORLD_CREATURECREATURECOLLISION_HPP_
4 #include "../math/glm.hpp"
13 class CreatureCreatureCollision {
16 CreatureCreatureCollision(
17 creature::Creature &a,
18 creature::Creature &b,
21 ) : a(&a), b(&b), normal(n), depth(depth) {
22 if (dot(normal, BPos() - APos()) < 0.0) {
23 // make sure normal always is in direction from A to B
27 ~CreatureCreatureCollision();
30 creature::Creature &A() noexcept { return *a; }
31 const creature::Creature &A() const noexcept { return *a; }
32 const glm::dvec3 &APos() const noexcept;
34 creature::Creature &B() noexcept { return *b; }
35 const creature::Creature &B() const noexcept { return *b; }
36 const glm::dvec3 &BPos() const noexcept;
38 const glm::dvec3 &Normal() const noexcept { return normal; }
39 double Depth() const noexcept { return depth; }
42 creature::Creature *a;
43 creature::Creature *b;