Dauphine  0.1
A platforming/stealth game in a medieval fantasy setting, developed with SDL2.
Public Types | Static Public Member Functions | List of all members
Collision Class Reference

Simple collision detection. More...

#include <Collision.h>

Public Types

enum  RectangleSide : uint8_t {
  TOP = 0, BOTTOM, LEFT, RIGHT,
  NONE
}
 Possible sides a rectangle can collide.
 

Static Public Member Functions

static bool rectsCollided (const SDL_Rect &a_, const SDL_Rect &b_)
 
static RectangleSide rectsCollidedSide (const SDL_Rect &a_, const SDL_Rect &b_)
 

Detailed Description

Simple collision detection.

Member Function Documentation

bool Collision::rectsCollided ( const SDL_Rect &  a_,
const SDL_Rect &  b_ 
)
static
Returns
Whether two SDL_Rects collided.
Parameters
a_,b_: The rectangles to check.
Collision::RectangleSide Collision::rectsCollidedSide ( const SDL_Rect &  a_,
const SDL_Rect &  b_ 
)
static
Returns
The side (RectangleSide) which two SDL_Rects collided on.
Parameters
a_,b_: The rectangles to check.

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