Skip to content

Commit

Permalink
checker and getter
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerboa-app committed Mar 13, 2024
1 parent 8fefa29 commit ed735e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion include/Collision/collisionDetector.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ namespace Hop::System::Physics
bool world;
};

virtual std::pair<std::multimap<Id, CollisionType>::iterator, std::multimap<Id, CollisionType>::iterator> objectHasCollided(Id & id) { return collided.equal_range(id); }
virtual std::pair<std::multimap<Id, CollisionType>::iterator, std::multimap<Id, CollisionType>::iterator> objectCollisions(Id & id) { return collided.equal_range(id); }
virtual bool objectHasCollided(Id & id) { collided.find(id) != collided.end(); }

protected:

Expand Down
3 changes: 2 additions & 1 deletion include/System/Physics/sCollision.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ namespace Hop::System::Physics
resolver = std::move(r);
}

std::pair<std::multimap<Id, CollisionDetector::CollisionType>::iterator, std::multimap<Id, CollisionDetector::CollisionType>::iterator> objectHasCollided(Id & id) { return detector->objectHasCollided(id); }
std::pair<std::multimap<Id, CollisionDetector::CollisionType>::iterator, std::multimap<Id, CollisionDetector::CollisionType>::iterator> objectCollisions(Id & id) { return detector->objectCollisions(id); }
bool objectHasCollided(Id & id) { detector->objectHasCollided(id); }

void centreOn(std::pair<float,float> p){centreOn(p.first,p.second);}

Expand Down

0 comments on commit ed735e0

Please sign in to comment.