supertux
Public Member Functions | Public Attributes | Friends | List of all members
CollisionObject Class Reference
Collaboration diagram for CollisionObject:
Collaboration graph
[legend]

Public Member Functions

 CollisionObject (CollisionGroup group, CollisionListener &parent)
 
void collision_solid (const CollisionHit &hit)
 this function is called when the object collided with something solid
 
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 can decide on how to react to the collision. More...
 
HitResponse collision (CollisionObject &other, const CollisionHit &hit)
 this function is called when the object collided with any other object
 
void collision_tile (uint32_t tile_attributes)
 called when tiles with special attributes have been touched
 
void collision_moving_object_bottom (CollisionObject &other)
 called when this object, if (moving) static, has collided on its top with a moving object
 
void notify_object_removal (CollisionObject *other)
 
void set_ground_movement_manager (const std::shared_ptr< CollisionGroundMovementManager > &movement_manager)
 
void clear_bottom_collision_list ()
 
bool is_unisolid () const
 
void set_unisolid (bool unisolid)
 
const Rectfget_bbox () const
 returns the bounding box of the Object
 
void set_movement (const Vector &movement)
 
void propagate_movement (const Vector &movement)
 
const Vector & get_movement () const
 
void set_pos (const Vector &pos)
 places the moving object at a specific position. More...
 
Vector get_pos () const
 
Vector get_pressure () const
 
void move_to (const Vector &pos)
 moves entire object to a specific position, including all points those the object has, exactly like the object has spawned in that given pos instead. More...
 
void set_width (float w)
 sets the moving object's bbox to a specific width. More...
 
void set_size (float w, float h)
 sets the moving object's bbox to a specific size. More...
 
CollisionGroup get_group () const
 
bool is_valid () const
 
CollisionListenerget_listener ()
 

Public Attributes

Rectf m_bbox
 The bounding box of the object (as used for collision detection, this isn't necessarily the bounding box for graphics)
 
CollisionGroup m_group
 The collision group.
 

Friends

class CollisionSystem
 

Member Function Documentation

◆ collides()

bool CollisionObject::collides ( CollisionObject other,
const CollisionHit hit 
) const

when 2 objects collided, we will first call the pre_collision_check functions of both objects that can decide on how to react to the collision.

◆ move_to()

void CollisionObject::move_to ( const Vector &  pos)
inline

moves entire object to a specific position, including all points those the object has, exactly like the object has spawned in that given pos instead.

◆ set_pos()

void CollisionObject::set_pos ( const Vector &  pos)
inline

places the moving object at a specific position.

Be careful when using this function. There are no collision detection checks performed here so bad things could happen.

◆ set_size()

void CollisionObject::set_size ( float  w,
float  h 
)
inline

sets the moving object's bbox to a specific size.

Be careful when using this function. There are no collision detection checks performed here so bad things could happen.

◆ set_width()

void CollisionObject::set_width ( float  w)
inline

sets the moving object's bbox to a specific width.

Be careful when using this function. There are no collision detection checks performed here so bad things could happen.


The documentation for this class was generated from the following files: