hx3d  1
2D/3D Simple Game Framework
Public Member Functions | List of all members
hx3d::physics2d::CollisionMatrix Class Reference

Collision matrix with masks and category. More...

#include <collision_matrix.hpp>

Public Member Functions

void addCategory (std::string name)
 Add a category. More...
 
template<class... Categories>
void addMask (std::string name, std::string category, Categories...others)
 Add a mask for a category from multiple categories. More...
 
unsigned int getCategory (std::string category)
 Get a category bit from a name. More...
 
unsigned int getMask (std::string category)
 Get a mask bit from a name. More...
 

Detailed Description

Collision matrix with masks and category.

Definition at line 33 of file collision_matrix.hpp.

Member Function Documentation

void hx3d::physics2d::CollisionMatrix::addCategory ( std::string  name)

Add a category.

Parameters
nameName

Definition at line 32 of file collision_matrix.cpp.

template<class... Categories>
void hx3d::physics2d::CollisionMatrix::addMask ( std::string  name,
std::string  category,
Categories...  others 
)

Add a mask for a category from multiple categories.

Parameters
nameCategory name
categoryFirst category
othersOther categories

Definition at line 23 of file collision_matrix.hpp.

unsigned int hx3d::physics2d::CollisionMatrix::getCategory ( std::string  category)

Get a category bit from a name.

Parameters
categoryCategory name
Returns
Category bit

Definition at line 66 of file collision_matrix.cpp.

unsigned int hx3d::physics2d::CollisionMatrix::getMask ( std::string  category)

Get a mask bit from a name.

Parameters
categoryCategory name
Returns
Category mask

Definition at line 75 of file collision_matrix.cpp.


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