4 * Created on: Apr 24, 2012
19 bool FakeLens::Overlaps(const Shape &other, Vector &normal) const {
20 if (other.Overlaps(*this, normal)) {
28 bool FakeLens::Overlaps(const AABB &other, Vector &normal) const {
29 if (AABB::Overlaps(other, normal)) {
30 MessUpNormal(normal, other);
37 bool FakeLens::Overlaps(const Circle &other, Vector &normal) const {
38 if (AABB::Overlaps(other, normal)) {
39 MessUpNormal(normal, other);
46 bool FakeLens::Overlaps(const FakeLens &other, Vector &normal) const {
47 if (AABB::Overlaps(static_cast<const AABB &>(other), normal)) {
48 MessUpNormal(normal, other);
56 std::ostream &FakeLens::Write(std::ostream &out) const {
57 return out << "FakeLens(" << Width() << 'x' << Height() << '+' << X() << '+' << Y() << ')';
61 void FakeLens::MessUpNormal(Vector &normal, const Shape &other) const {
62 Vector direction((Center() - other.Center()).Unify());
63 normal = ((1 - bendFactor) * normal) + (bendFactor* direction);