MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / movingCollision

Method movingCollision

source/game/StarActorMovementController.cpp:1456–1467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1454}
1455
1456bool PathController::movingCollision(ActorMovementController& movementController, PolyF const& collisionPoly) {
1457 bool collided = false;
1458 movementController.forEachMovingCollision(collisionPoly.boundBox(), [&](MovingCollisionId, PhysicsMovingCollision, PolyF poly, RectF) {
1459 if (poly.intersects(collisionPoly)) {
1460 // set collided and stop iterating
1461 collided = true;
1462 return false;
1463 }
1464 return true;
1465 });
1466 return collided;
1467}
1468
1469bool PathController::onGround(ActorMovementController const& movementController, Vec2F const& position, CollisionSet const& collisionSet) const {
1470 auto bounds = RectI::integral(movementController.localBoundBox().translated(position));

Callers

nothing calls this directly

Calls 3

boundBoxMethod · 0.45
intersectsMethod · 0.45

Tested by

no test coverage detected