Collision management system using Quad Tree Collision.
More...
#include <VCollision.h>
Collision management system using Quad Tree Collision.
◆ AddToList()
- Parameters
-
item | The object to add to the list. It could be anything as long as it eventually inherits from VBase. |
list | The list the object should specifically add to. |
◆ Initialise()
void VCollision::Initialise |
( |
const sf::FloatRect & |
initialRect | ) |
|
Initialises the Collision Handling System.
- Parameters
-
initialRect | The initial large area to perform a Quad Tree collision on (typically the value in WorldBounds). |
◆ Run()
bool VCollision::Run |
( |
std::function< bool(VObject *, VObject *)> |
testOverlap, |
|
|
std::function< void(VObject *, VObject *)>const & |
response = nullptr , |
|
|
std::function< bool(VObject *, VObject *)>const & |
process = nullptr |
|
) |
| |
Runs the collision testing and handling process. This will iterate through all quads to test all collisions.
- Parameters
-
testOverlap | The method to testing a collision, such as Rectangle or Circle based collision testing. |
response | An optional response callback if an overlap is found. Only gets called if an overlap is true. |
process | An optional process callback if an overlap is found and there is a need to handle further tests and changes to the objects. Only gets called if an overlap is true, and should return true further collision tests are true. |
- Returns
- Function returns true if at least one overlap has been found to be true.
The documentation for this class was generated from the following file:
- D:/Development/Libs/Vigilante-Game-Framework/VFrame/VCollision.h