18 #ifndef HEADER_SUPERTUX_COLLISION_COLLISION_SYSTEM_HPP 19 #define HEADER_SUPERTUX_COLLISION_COLLISION_SYSTEM_HPP 26 #include "collision/collision.hpp" 27 #include "supertux/tile.hpp" 28 #include "math/fwd.hpp" 42 std::variant<const Tile*, CollisionObject*>
hit;
60 const std::shared_ptr<CollisionGroundMovementManager>& get_ground_movement_manager()
62 return m_ground_movement_manager;
65 bool is_free_of_tiles(
const Rectf& rect,
const bool ignoreUnisolid =
false, uint32_t tiletype =
Tile::SOLID)
const;
66 bool is_free_of_statics(
const Rectf& rect,
const CollisionObject* ignore_object,
const bool ignoreUnisolid)
const;
68 bool is_free_of_specifically_movingstatics(
const Rectf& rect,
const CollisionObject* ignore_object)
const;
71 RaycastResult get_first_line_intersection(
const Vector& line_start,
72 const Vector& line_end,
75 bool free_line_of_sight(
const Vector& line_start,
const Vector& line_end,
bool ignore_objects,
const CollisionObject* ignore_object)
const;
77 std::vector<CollisionObject*> get_nearby_objects(
const Vector& center,
float max_distance)
const;
89 const Vector& movement,
const Rectf& dest,
93 const Vector& movement,
const Rectf& dest,
96 uint32_t collision_tile_attributes(
const Rectf& dest,
const Vector& mov)
const;
108 std::vector<CollisionObject*> m_objects;
110 std::shared_ptr<CollisionGroundMovementManager> m_ground_movement_manager;
solid tile that is indestructible by Tux
Definition: tile.hpp:41
Definition: collision_system.hpp:39
void draw(DrawingContext &context)
Draw collision shapes for debugging.
Definition: collision_system.cpp:71
bool is_valid
true if raycast hit something
Definition: collision_system.hpp:41
std::variant< const Tile *, CollisionObject * > hit
tile/object that the raycast hit
Definition: collision_system.hpp:42
Definition: collision_system.hpp:36
Represents one of (potentially) multiple, separate parts of a Level.
Definition: sector.hpp:61
void update()
Checks for all possible collisions.
Definition: collision_system.cpp:568
This class takes care of moving objects that have collided on top of other moving objects or on top o...
Definition: collision_movement_manager.hpp:32
Definition: collision.hpp:31
Rectf box
hitbox of tile/object
Definition: collision_system.hpp:43
Definition: collision_object.hpp:33
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42
This class collects data about a collision.
Definition: collision_hit.hpp:44