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
PhysicsHelper.hpp
Go to the documentation of this file.
1 #ifndef RADIX_PHYSICS_HELPER_HPP
2 #define RADIX_PHYSICS_HELPER_HPP
3 
4 #include <bullet/LinearMath/btVector3.h>
5 #include <bullet/BulletCollision/Gimpact/btBoxCollision.h>
6 #include <bullet/BulletCollision/CollisionDispatch/btCollisionObject.h>
7 #include <bullet/BulletCollision/CollisionDispatch/btCollisionWorld.h>
8 
9 namespace radix {
10 
12 private:
13  PhysicsHelper();
14 
15 public:
16  class ContactResultHolder : public btCollisionWorld::ContactResultCallback {
17  public:
18  bool collides = false;
19  btScalar addSingleResult(btManifoldPoint&, const btCollisionObjectWrapper*, int, int,
20  const btCollisionObjectWrapper*, int, int) {
21  collides = true;
22  return 1;
23  }
24  };
25 
26  static bool pointInAABB(const btVector3 &p, const btVector3 &min, const btVector3 &max);
27  static inline bool pointInAABB(const btVector3 &p, const btAABB &aabb) {
28  return pointInAABB(p, aabb.m_min, aabb.m_max);
29  }
30 
31  static bool pointInVolume(const btVector3&, const btCollisionObject&);
32  static inline bool pointInVolume(const btVector3 &v, const btCollisionObject *o) {
33  return pointInVolume(v, *o);
34  }
35 };
36 
37 } /* namespace radix */
38 
39 #endif /* RADIX_PHYSICS_HELPER_HPP */
Definition: GameController.hpp:7
Definition: PhysicsHelper.hpp:11
static bool pointInVolume(const btVector3 &, const btCollisionObject &)
Definition: PhysicsHelper.cpp:14
static bool pointInAABB(const btVector3 &p, const btVector3 &min, const btVector3 &max)
Definition: PhysicsHelper.cpp:8
Definition: PhysicsHelper.hpp:16
bool collides
Definition: PhysicsHelper.hpp:18
static bool pointInAABB(const btVector3 &p, const btAABB &aabb)
Definition: PhysicsHelper.hpp:27
static bool pointInVolume(const btVector3 &v, const btCollisionObject *o)
Definition: PhysicsHelper.hpp:32
btScalar addSingleResult(btManifoldPoint &, const btCollisionObjectWrapper *, int, int, const btCollisionObjectWrapper *, int, int)
Definition: PhysicsHelper.hpp:19