]> git.localhorst.tv Git - blobs.git/blobdiff - src/world/world.cpp
aggression
[blobs.git] / src / world / world.cpp
index c22434a47c754b8f3b028bcbabcb8888c04d7671..1758c5e431ea4ebfb862dde58b4290408b5dd0e5 100644 (file)
@@ -208,11 +208,12 @@ void Body::CheckCollision() noexcept {
                }
        }
        for (auto &c : collisions) {
+               c.A().OnCollide(c.B());
+               c.B().OnCollide(c.A());
                c.A().GetSituation().Move(c.Normal() * (c.Depth() * -0.5));
                c.B().GetSituation().Move(c.Normal() * (c.Depth() * 0.5));
                c.A().GetSituation().Accelerate(c.Normal() * -glm::dot(c.Normal(), c.AVel()));
                c.B().GetSituation().Accelerate(c.Normal() * -glm::dot(c.Normal(), c.BVel()));
-               // TODO: notify participants so they can be annoyed
        }
 }
 
@@ -694,7 +695,9 @@ void GenerateTest(const Set<TileType> &tiles, Planet &p) noexcept {
 
 
 Sun::Sun()
-: Body() {
+: Body()
+, color(1.0)
+, luminosity(1.0) {
 }
 
 Sun::~Sun() {