18 #ifndef HEADER_SUPERTUX_COLLISION_COLLISION_OBJECT_HPP 19 #define HEADER_SUPERTUX_COLLISION_COLLISION_OBJECT_HPP 23 #include <unordered_set> 25 #include "collision/collision_group.hpp" 26 #include "collision/collision_hit.hpp" 27 #include "math/rectf.hpp" 59 void set_ground_movement_manager(
const std::shared_ptr<CollisionGroundMovementManager>& movement_manager)
61 m_ground_movement_manager = movement_manager;
64 void clear_bottom_collision_list();
66 bool is_unisolid()
const {
return m_unisolid; }
67 void set_unisolid(
bool unisolid) { m_unisolid = unisolid; }
75 void set_movement(
const Vector& movement)
77 m_movement = movement;
80 void propagate_movement(
const Vector& movement);
82 const Vector& get_movement()
const 92 m_dest.move(pos - get_pos());
96 Vector get_pos()
const 101 Vector get_pressure()
const 128 m_dest.set_size(w, h);
132 CollisionGroup get_group()
const 137 bool is_valid()
const;
179 std::unordered_set<CollisionObject*> m_objects_hit_bottom;
181 std::shared_ptr<CollisionGroundMovementManager> m_ground_movement_manager;
HitResponse collision(CollisionObject &other, const CollisionHit &hit)
this function is called when the object collided with any other object
Definition: collision_object.cpp:50
void collision_moving_object_bottom(CollisionObject &other)
called when this object, if (moving) static, has collided on its top with a moving object ...
Definition: collision_object.cpp:62
CollisionGroup m_group
The collision group.
Definition: collision_object.hpp:153
void set_size(float w, float h)
sets the moving object's bbox to a specific size.
Definition: collision_object.hpp:126
bool collides(CollisionObject &other, const CollisionHit &hit) const
when 2 objects collided, we will first call the pre_collision_check functions of both objects that ca...
Definition: collision_object.cpp:44
Definition: collision_listener.hpp:23
void set_width(float w)
sets the moving object's bbox to a specific width.
Definition: collision_object.hpp:117
const Rectf & get_bbox() const
returns the bounding box of the Object
Definition: collision_object.hpp:70
void move_to(const Vector &pos)
moves entire object to a specific position, including all points those the object has...
Definition: collision_object.hpp:109
Definition: collision_system.hpp:36
Rectf m_bbox
The bounding box of the object (as used for collision detection, this isn't necessarily the bounding ...
Definition: collision_object.hpp:150
void set_pos(const Vector &pos)
places the moving object at a specific position.
Definition: collision_object.hpp:90
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
This class is responsible for: Updating and drawing the object.
Definition: game_object.hpp:83
void collision_solid(const CollisionHit &hit)
this function is called when the object collided with something solid
Definition: collision_object.cpp:38
void collision_tile(uint32_t tile_attributes)
called when tiles with special attributes have been touched
Definition: collision_object.cpp:56
Definition: collision_object.hpp:33
This class collects data about a collision.
Definition: collision_hit.hpp:44