It contains all utilities to retrieve, handle and update mesh ColliderComponent.
More...
|
void | updateParentCollider (const unsigned int &id) |
| Updates the collider of a parent mesh.
|
void | updateCollider (const unsigned int &id) |
| Updates the collider of the given entity. If this entity is a parent entity (an entity with a ParentComponent), it will call systems::collision::updateParentCollider() instead.
|
void | updateAllColliders () |
| Updates all the entities collider by calling systems::collision::updateCollider().
|
ColliderType | getColliderType (const unsigned int &id) |
| Retrieves the type of the entity collider.
|
void | updateColliderType (const unsigned int &id, const ColliderType &type) |
| Updates the collider type of the given entity.
|
void | updateSimulated (const unsigned int &id, const bool &simulated) |
| Updates the simulation of the entity in a PhysicWorld.
|
void | compressBoundingBox () |
| This method optimize children bounding box of all parent entities in a single square/cube bounding box.
|
Pair< glm::vec3 > | getCollider (const unsigned int &id) |
| Retrieves the collider corners of the entity given.
|
bool | isColliding (const unsigned int &first, const unsigned int &second) |
| Calculate if two entities are colliding or not.
|
std::vector< Pair< unsigned int > > | getCollisions () |
| Retrieves all entities overlapping each other using simple AABB detection.
|
It contains all utilities to retrieve, handle and update mesh ColliderComponent.
- See also
- ColliderComponent
◆ getCollider()
Pair< glm::vec3 > systems::collision::getCollider |
( |
const unsigned int & | id | ) |
|
Retrieves the collider corners of the entity given.
- Parameters
-
- Returns
- a pair of (botLeft, topRight) corner
◆ getColliderType()
ColliderType systems::collision::getColliderType |
( |
const unsigned int & | id | ) |
|
Retrieves the type of the entity collider.
- Parameters
-
- Returns
- the collider type
◆ getCollisions()
std::vector< Pair< unsigned int > > systems::collision::getCollisions |
( |
| ) |
|
Retrieves all entities overlapping each other using simple AABB detection.
- Returns
- a std::vector<Pair<unsigned int>> containing all overlapping entities
◆ isColliding()
bool systems::collision::isColliding |
( |
const unsigned int & | first, |
|
|
const unsigned int & | second ) |
Calculate if two entities are colliding or not.
- Parameters
-
first | the first entity id |
second | the second entity id |
- Returns
- true if the two entities are colliding
◆ updateCollider()
void systems::collision::updateCollider |
( |
const unsigned int & | id | ) |
|
◆ updateColliderType()
void systems::collision::updateColliderType |
( |
const unsigned int & | id, |
|
|
const ColliderType & | type ) |
Updates the collider type of the given entity.
- Parameters
-
id | the entity id |
type | the collider type |
◆ updateParentCollider()
void systems::collision::updateParentCollider |
( |
const unsigned int & | id | ) |
|
Updates the collider of a parent mesh.
- Note
- This method only updates the collider of the father entity and not his children.
- Parameters
-
◆ updateSimulated()
void systems::collision::updateSimulated |
( |
const unsigned int & | id, |
|
|
const bool & | simulated ) |
Updates the simulation of the entity in a PhysicWorld.
- Note
- If an entity is not simulated means that it's a static entity.
- Parameters
-
id | the entity id |
simulated | if true the entity is simulated |