|
VEGO-Engine
0.1
|
Class responsible for collision detection and handling. More...
#include <CollisionHandler.h>
Public Member Functions | |
| template<typename T> | |
| T | getAnyIntersection (Entity *entity, Vector2D posMod={}, std::initializer_list< Entity::GroupLabel > const &groupLabels={}, std::initializer_list< Entity * > const &excludedEntities={}) |
| Tests entity against all entities with the specified labels for a collision. | |
| template<> | |
| IntersectionBitSet | getAnyIntersection (Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities) |
| template<> | |
| Entity * | getAnyIntersection (Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities) |
| template<> | |
| bool | getAnyIntersection (Entity *entity, Vector2D posMod, std::initializer_list< Entity::GroupLabel > const &groupLabels, std::initializer_list< Entity * > const &excludedEntities) |
Static Public Member Functions | |
| static IntersectionBitSet | getIntersection (Entity *entityA, Entity *entityB, Vector2D posModA=Vector2D(0, 0), Vector2D posModB=Vector2D(0, 0)) |
| Checks for intersections relative to entityA. | |
Class responsible for collision detection and handling.
| IntersectionBitSet CollisionHandler::getAnyIntersection | ( | Entity * | entity, |
| Vector2D | posMod, | ||
| std::initializer_list< Entity::GroupLabel > const & | groupLabels, | ||
| std::initializer_list< Entity * > const & | excludedEntities ) |
Refer to getAnyIntersection() for more details
Direction in bitset true if edge in that direction collides Example usage for IntersectionBitSet (TransformComponent::update()):
| Entity * CollisionHandler::getAnyIntersection | ( | Entity * | entity, |
| Vector2D | posMod, | ||
| std::initializer_list< Entity::GroupLabel > const & | groupLabels, | ||
| std::initializer_list< Entity * > const & | excludedEntities ) |
Refer to getAnyIntersection() for more details
| bool CollisionHandler::getAnyIntersection | ( | Entity * | entity, |
| Vector2D | posMod, | ||
| std::initializer_list< Entity::GroupLabel > const & | groupLabels, | ||
| std::initializer_list< Entity * > const & | excludedEntities ) |
Refer to getAnyIntersection() for more details
| T CollisionHandler::getAnyIntersection | ( | Entity * | entity, |
| Vector2D | posMod = {}, | ||
| std::initializer_list< Entity::GroupLabel > const & | groupLabels = {}, | ||
| std::initializer_list< Entity * > const & | excludedEntities = {} ) |
Tests entity against all entities with the specified labels for a collision.
Tests the given entity against every other entity with the specified labels for intersections between their collison boxes. If the primary entity has no ColliderComponent, the equivalent of no collision is returned immediately, other entities are skipped if they don't have a ColliderComponent
| entity | The primary entity to check against. Return values will be relative to this entity |
| posMod | Modifier to apply toposition before checking collisions. |
| groupLabels | Entities need to have at least one listed GroupLabels to get checked against |
| teamLabels | Entities need to have one of the specified TeamLabels to get checked against |
| negateTeam | If set to true, entities will only be checked against if they don't have one of the specified TeamLabels |
|
static |
Checks for intersections relative to entityA.
| entityA | The first entity to check against |
| entityB | The second entity to check against |
| posModA | Modifier to apply to entityA's position before checking collisions |