]> git.localhorst.tv Git - gong.git/blob - src/physics/Sphere.hpp
half-{complete,assed} sphere collision detection
[gong.git] / src / physics / Sphere.hpp
1 #ifndef GONG_PHYSICS_SPHERE_HPP_
2 #define GONG_PHYSICS_SPHERE_HPP_
3
4 #include "Object.hpp"
5 #include "../geometry/primitive.hpp"
6
7
8 namespace gong {
9 namespace physics {
10
11 class Sphere
12 : public Object {
13
14 public:
15         explicit Sphere(float radius);
16
17         /// Get geometric description of shape in world coordinates
18         geometry::Sphere Shape() {
19                 return geometry::Sphere{ state.pos, radius };
20         }
21
22 private:
23         void ReverseCollisionTest(Object &, std::vector<Contact> &) override;
24         void ActualCollisionTest(Sphere &, std::vector<Contact> &) override;
25
26 private:
27         float radius;
28
29 };
30
31 }
32 }
33
34 #endif