Gamedev Framework (gf)  0.11.0
A C++14 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 Transform &lhsTrans, const CircF &rhs, const Transform &rhsTrans, Penetration &p)
 Check if two circles collides. More...
 
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 CircF &lhs, const Transform &lhsTrans, const Polygon &rhs, const Transform &rhsTrans, Penetration &p)
 Check if a circle collides with a polygon. More...
 
bool collides (const CircF &lhs, const Polygon &rhs, Penetration &p)
 Check if a circle collides with a polygon. More...
 
bool collides (const Polygon &lhs, const Transform &lhsTrans, const CircF &rhs, const Transform &rhsTrans, Penetration &p)
 Check if a polygon collides with a circle. More...
 
bool collides (const Polygon &lhs, const CircF &rhs, Penetration &p)
 Check if a polygon collides with a circle. More...
 
bool collides (const Polygon &lhs, const Transform &lhsTrans, const Polygon &rhs, const Transform &rhsTrans, Penetration &p)
 Check if two polygons 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

◆ collides() [1/11]

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

Check if two circles collides.

Parameters
lhsFirst circle
lhsTransTransformation of the first circle
rhsSecond circle
rhsTransTransformation of the second circle
pData to fill if there is a collision
Returns
True if there is a collision

◆ collides() [2/11]

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

◆ collides() [3/11]

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

◆ collides() [4/11]

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

◆ collides() [5/11]

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

◆ collides() [6/11]

bool collides ( const CircF lhs,
const Transform lhsTrans,
const Polygon rhs,
const Transform rhsTrans,
Penetration p 
)
related

Check if a circle collides with a polygon.

Parameters
lhsThe circle
lhsTransTransformation of the circle
rhsThe polygon
rhsTransTransformation of the polygon
pData to fill if there is a collision
Returns
True if there is a collision

◆ collides() [7/11]

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

Check if a circle collides with a polygon.

Parameters
lhsThe circle
rhsThe polygon
pData to fill if there is a collision
Returns
True if there is a collision

◆ collides() [8/11]

bool collides ( const Polygon lhs,
const Transform lhsTrans,
const CircF rhs,
const Transform rhsTrans,
Penetration p 
)
related

Check if a polygon collides with a circle.

Parameters
lhsThe polygon
lhsTransTransformation of the polygon
rhsThe circle
rhsTransTransformation of the circle
pData to fill if there is a collision
Returns
True if there is a collision

◆ collides() [9/11]

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

Check if a polygon collides with a circle.

Parameters
lhsThe polygon
rhsThe circle
pData to fill if there is a collision
Returns
True if there is a collision

◆ collides() [10/11]

bool collides ( const Polygon lhs,
const Transform lhsTrans,
const Polygon rhs,
const Transform rhsTrans,
Penetration p 
)
related

Check if two polygons collides.

Parameters
lhsFirst polygon
lhsTransTransformation of the first polygon
rhsSecond polygon
rhsTransTransformation of the second polygon
pData to fill if there is a collision
Returns
True if there is a collision

◆ collides() [11/11]

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

◆ depth

float gf::Penetration::depth

Penetration depth.

◆ normal

Vector2f gf::Penetration::normal

Collision normal.