18 #ifndef HEADER_SUPERTUX_COLLISION_COLLISION_OBJECT_HPP 19 #define HEADER_SUPERTUX_COLLISION_COLLISION_OBJECT_HPP 23 #include "collision/collision_group.hpp" 24 #include "collision/collision_hit.hpp" 25 #include "math/rectf.hpp" 57 const Vector& get_movement()
const 67 m_dest.move(pos - get_pos());
98 m_dest.set_size(w, h);
102 CollisionGroup get_group()
const 107 bool is_valid()
const;
HitResponse collision(CollisionObject &other, const CollisionHit &hit)
this function is called when the object collided with any other object
Definition: collision_object.cpp:45
CollisionGroup m_group
The collision group.
Definition: collision_object.hpp:126
void set_size(float w, float h)
sets the moving object's bbox to a specific size.
Definition: collision_object.hpp:96
Vector m_movement
The movement that will happen till next frame.
Definition: collision_object.hpp:123
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:39
Simple two dimensional vector.
Definition: vector.hpp:24
Definition: collision_listener.hpp:23
void set_width(float w)
sets the moving object's bbox to a specific width.
Definition: collision_object.hpp:87
const Rectf & get_bbox() const
returns the bounding box of the Object
Definition: collision_object.hpp:52
void move_to(const Vector &pos)
moves entire object to a specific position, including all points those the object has...
Definition: collision_object.hpp:79
Definition: collision_system.hpp:32
Rectf m_bbox
The bounding box of the object (as used for collision detection, this isn't necessarily the bounding ...
Definition: collision_object.hpp:120
void set_pos(const Vector &pos)
places the moving object at a specific position.
Definition: collision_object.hpp:65
Base class for all the things that make up Levels' Sectors.
Definition: game_object.hpp:46
void collision_solid(const CollisionHit &hit)
this function is called when the object collided with something solid
Definition: collision_object.cpp:33
void collision_tile(uint32_t tile_attributes)
called when tiles with special attributes have been touched
Definition: collision_object.cpp:51
Definition: collision_object.hpp:30
This class collects data about a collision.
Definition: collision_hit.hpp:44