Gamedev Framework (gf)  0.3.0
A C++11 framework for 2D games
Public Attributes | Related Functions | List of all members
gf::Penetration Struct Reference

Data about the collision between two objects. More...

#include <gf/Collision.h>

Public Attributes

Vector2f normal
 Collision normal. More...
 
float depth
 Penetration depth. More...
 

Related Functions

(Note that these are not member functions.)

bool collides (const CircF &lhs, const CircF &rhs, Penetration &p)
 Check if two circles collides. More...
 
bool collides (const RectF &lhs, const CircF &rhs, Penetration &p)
 Check if a rectangle collides with a circle. More...
 
bool collides (const CircF &lhs, const RectF &rhs, Penetration &p)
 Check if a circle collides with a rectangle. More...
 
bool collides (const RectF &lhs, const RectF &rhs, Penetration &p)
 Check if two rectangles collides. More...
 
bool collides (const Polygon &lhs, const Polygon &rhs, Penetration &p)
 Check if two polygons collides. More...
 

Detailed Description

Data about the collision between two objects.

See also
How to Create a Custom Physics Engine

Friends And Related Function Documentation

bool collides ( const CircF lhs,
const CircF rhs,
Penetration p 
)
related

Check if two circles collides.

Parameters
lhsFirst circle
rhsSecond circle
pData to fill if there is a collision
Returns
True if there is a collision
bool collides ( const RectF lhs,
const CircF rhs,
Penetration p 
)
related

Check if a rectangle collides with a circle.

Parameters
lhsThe rectangle
rhsThe circle
pData to fill if there is a collision
Returns
True if there is a collision
bool collides ( const CircF lhs,
const RectF rhs,
Penetration p 
)
related

Check if a circle collides with a rectangle.

Parameters
lhsThe circle
rhsThe rectangle
pData to fill if there is a collision
Returns
True if there is a collision
bool collides ( const RectF lhs,
const RectF rhs,
Penetration p 
)
related

Check if two rectangles collides.

Parameters
lhsFirst rectangle
rhsSecond rectangle
pData to fill if there is a collision
Returns
True if there is a collision
bool collides ( const Polygon lhs,
const Polygon rhs,
Penetration p 
)
related

Check if two polygons collides.

Parameters
lhsFirst polygon
rhsSecond polygon
pData to fill if there is a collision
Returns
True if there is a collision

Member Data Documentation

float gf::Penetration::depth

Penetration depth.

Vector2f gf::Penetration::normal

Collision normal.