GlPortal Class Reference  0.1.1
Source code documentation of the free and open 3D action puzzle game.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Uncollider.hpp
Go to the documentation of this file.
1 #ifndef RADIX_UNCOLLIDER_HPP
2 #define RADIX_UNCOLLIDER_HPP
3 
4 #include <list>
5 #include <unordered_set>
6 
7 #include <bullet/BulletCollision/btBulletCollisionCommon.h>
8 #include <bullet/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h>
9 
10 namespace std {
11 template<typename T1, typename T2>
12 struct hash<std::pair<T1*, T2*>> {
13  std::size_t operator()(std::pair<T1*, T2*> const &p) const {
14  return (std::size_t)((p.second - p.first) * ((intptr_t)p.first ^ 0x412c765140f2fa32) + (intptr_t)p.second);
15  }
16 };
17 }
18 
19 namespace radix {
20 
21 class World;
22 
23 class Uncollider : public btOverlapFilterCallback {
24 private:
26 
27 public:
28  static std::list<btCollisionObject*> volumes;
29  static std::unordered_set<std::pair<btCollisionObject*, btCollisionObject*>>
31  static void addCollisonPairExclusion(btCollisionObject*, btCollisionObject*);
32  static void removeCollisonPairExclusion(btCollisionObject*, btCollisionObject*);
33  static bool isPointInUncollideVolume(const btVector3 &p);
34 
35  Uncollider(World&);
36  void beforePhysicsStep();
37  bool needBroadphaseCollision(btBroadphaseProxy *proxy0, btBroadphaseProxy *proxy1) const;
38  static void nearCallback(btBroadphasePair&, btCollisionDispatcher&, const btDispatcherInfo&);
39 };
40 
41 } /* namespace radix */
42 
43 #endif /* RADIX_UNCOLLIDER_HPP */
static std::unordered_set< std::pair< btCollisionObject *, btCollisionObject * > > collisonPairExclusions
Definition: Uncollider.hpp:30
Definition: GameController.hpp:7
static bool isPointInUncollideVolume(const btVector3 &p)
Definition: Uncollider.cpp:19
static void removeCollisonPairExclusion(btCollisionObject *, btCollisionObject *)
Definition: Uncollider.cpp:45
Uncollider(World &)
Definition: Uncollider.cpp:15
Definition: Uncollider.hpp:23
Definition: Uncollider.hpp:10
static void nearCallback(btBroadphasePair &, btCollisionDispatcher &, const btDispatcherInfo &)
Definition: Uncollider.cpp:70
bool needBroadphaseCollision(btBroadphaseProxy *proxy0, btBroadphaseProxy *proxy1) const
Definition: Uncollider.cpp:50
static void addCollisonPairExclusion(btCollisionObject *, btCollisionObject *)
Definition: Uncollider.cpp:40
std::size_t operator()(std::pair< T1 *, T2 * > const &p) const
Definition: Uncollider.hpp:13
World & world
Definition: Uncollider.hpp:25
void beforePhysicsStep()
Definition: Uncollider.cpp:30
Definition: World.hpp:32
static std::list< btCollisionObject * > volumes
Definition: Uncollider.hpp:28