]> git.localhorst.tv Git - sdl-test7.git/blob - src/geometry/FakeLens.h
imported current version
[sdl-test7.git] / src / geometry / FakeLens.h
1 /*
2  * FakeLens.h
3  *
4  *  Created on: Apr 24, 2012
5  *      Author: holy
6  */
7
8 #ifndef GEOMETRY_FAKELENS_H_
9 #define GEOMETRY_FAKELENS_H_
10
11 #include "AABB.h"
12
13
14 namespace geometry {
15
16 class FakeLens
17 : public AABB {
18
19         public:
20                 FakeLens(void) : AABB(), bendFactor(0.22f) { };
21                 explicit FakeLens(const Vector &size) : AABB(size), bendFactor(0.22f) { };
22                 FakeLens(const Vector &position, const Vector &size, float bendFactor = 0.22f) : AABB(position, size), bendFactor(bendFactor) { };
23
24         public:
25                 void SetBendFactor(float b) { bendFactor = b; };
26
27         public:
28                 virtual bool Overlaps(const Shape &, Vector &normal) const;
29
30                 virtual bool Overlaps(const AABB &, Vector &normal) const;
31                 virtual bool Overlaps(const Circle &, Vector &normal) const;
32                 virtual bool Overlaps(const FakeLens &, Vector &normal) const;
33
34         public:
35                 virtual std::ostream &Write(std::ostream &out) const;
36
37         private:
38                 void MessUpNormal(Vector &normal, const Shape &other) const;
39
40         private:
41                 float bendFactor;
42
43 };
44
45 }
46
47 #endif /* GEOMETRY_FAKELENS_H_ */