Go to the source code of this file.
|
| bool | detectCollision (const Physics &obj1, const Physics &obj2) |
| | Detects whether a collision has occurred between two objects given their Physics structs; this is done by checking for overlap between the two object's surfaces (defined by their positions + dimensions + collider shape) More...
|
| |
| bool | detectCollisionSphere (const Physics &sphere, const Physics &obj) |
| | Detects whether a collision has occurred between two objects given their Physics structs and that the first object is a sphere. More...
|
| |
| bool | detectCollisionBox (const Physics &box, const Physics &obj) |
| | Detects whether a collision has occurred between two objects given their Physics structs and that the first object is a box. More...
|
| |
◆ Collider
Enumeration to identify collider shape.
| Enumerator |
|---|
| None | |
| Box | |
| Sphere | |
◆ detectCollision()
Detects whether a collision has occurred between two objects given their Physics structs; this is done by checking for overlap between the two object's surfaces (defined by their positions + dimensions + collider shape)
- Parameters
-
| obj1 | Reference to the first object's Physics struct. |
| obj2 | Reference to the second object's Physics struct. |
- Returns
- true if a collision (overlap) is detected between the two objects' surfaces, and false otherwise.
◆ detectCollisionBox()
Detects whether a collision has occurred between two objects given their Physics structs and that the first object is a box.
- Parameters
-
| box | Reference to the box object's Physics struct. |
| obj | Reference to the second object's Physics struct. |
- Returns
- true if a collision is detected between the box and the second object, and false otherwise.
◆ detectCollisionSphere()
| bool detectCollisionSphere |
( |
const Physics & |
sphere, |
|
|
const Physics & |
obj |
|
) |
| |
Detects whether a collision has occurred between two objects given their Physics structs and that the first object is a sphere.
- Parameters
-
| sphere | Reference to the sphere object's Physics struct. |
| obj | Reference to the second object's Physics struct. |
- Returns
- true if a collision is detected between the sphere and the second object, and false otherwise.