Collision detection system. More...
Functions | |
| void | Collider_Start () |
| [Start] Initializes the Colliders array. | |
| void | Collider_Register (Collider *collider, void *owner) |
| [Start] Registers a collider to the Colliders array. | |
| bool | Collider_Check (Collider *collider, ColliderCheckResult *checkResult) |
| [PostUpdate] Checks if a collider is intersecting with any of its collider layers. | |
| void | Collider_Reset (Collider *collider) |
| Deactivates a collider and resets its properties. | |
Variables | |
| Collider * | ColliderList [MAX_COLLIDABLES] |
| int | ColliderCount = 0 |
Collision detection system.
Provides functionality for hitbox-based collision detection between game objects with layer-based filtering.
| bool Collider_Check | ( | Collider * | collider, |
| ColliderCheckResult * | checkResult | ||
| ) |
[PostUpdate] Checks if a collider is intersecting with any of its collider layers.
Check for collisions with a collider.
This function checks for collision between a collider and everything else in the ColliderList array. Any colliders whose layer is not in the input collider's collidesWith section will be ignored.
| collider | The input collider |
| checkResult | The checkResult of the collider, which includes 2 members: checkResult.objects: an array of detected colliders checkResult.count: number of collisions detected |
| void Collider_Register | ( | Collider * | collider, |
| void * | owner | ||
| ) |
[Start] Registers a collider to the Colliders array.
Register a collider with the collision manager.
This is so that every colliders can be checked by each other.
| collider | A pointer to the collider struct. For example: &player.state.collider |
| owner | A pointer to the owner of the collider. For example: &player |
| void Collider_Reset | ( | Collider * | collider | ) |
Deactivates a collider and resets its properties.
Deactivates a collider.
| collider | The collider to reset |
| void Collider_Start | ( | ) |
[Start] Initializes the Colliders array.
Initialize the collision manager.
| int ColliderCount = 0 |
| Collider* ColliderList[MAX_COLLIDABLES] |