DubiousEngine
0.2.0
Simple Game Engine
|
Interface for finding collisions between all objects. More...
#include <Collision_strategy.h>
Public Types | |
typedef std::tuple< Physics_object *, Physics_object * > | Physics_object_pair |
Public Member Functions | |
Collision_strategy (const Collision_strategy &)=delete | |
Collision_strategy & | operator= (const Collision_strategy &)=delete |
~Collision_strategy ()=default | |
virtual void | find_contacts (const std::vector< std::shared_ptr< Physics_object >> &objects, std::map< Physics_object_pair, Contact_manifold > &manifolds)=0 |
Find contacts between objects. More... | |
Protected Member Functions | |
Collision_strategy ()=default | |
Interface for finding collisions between all objects.
The job of the collision strategy is to take in all of the objects in the world and find all contact points. The output from this needs to be contact manifolds between all colliding pairs. This is a separate interface because there are a number of ways to do this work. Currently I've implemented a single threaded solver, a multi-threaded solver, and one that uses OpenCL.
typedef std::tuple<Physics_object*, Physics_object*> Dubious::Physics::Collision_strategy::Physics_object_pair |
|
delete |
|
default |
|
protecteddefault |
|
pure virtual |
Find contacts between objects.
This is the main point of the Collision Strategy implementations. Given a vector of all of the objects in the universe, create (or update) contacts manifolds for each colliding pair.
objects | - [in] All of the objects to compare |
manifolds | - [in,out] contact information between each pair |
Implemented in Dubious::Physics::Collision_strategy_open_cl, Dubious::Physics::Collision_strategy_multi_threaded, and Dubious::Physics::Collision_strategy_simple.
|
delete |