Kale
Loading...
Searching...
No Matches
RotatedRect.hpp
Go to the documentation of this file.
1/*
2 Copyright 2022 Rishi Challa
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17#pragma once
18
20
21namespace Kale {
22
26 struct RotatedRect : public Geometry {
27
32
37
42
47
52
60 RotatedRect(const Vector2f& point1, const Vector2f& point2, const Vector2f& point3, const Vector2f& point4);
61
67 RotatedRect(const Vector2f& topLeft, const Vector2f& bottomRight);
68
73 Vector2f center() const;
74
79 Rect getBoundingBox() const override;
80
86 bool pointCollision(Vector2f point) const override;
87
93 bool rectCollision(RotatedRect rect) const override;
94
100 bool rectCollision(Rect rect) const override;
101
107 bool circleCollision(Circle circle) const override;
108
114 bool rayCollision(Ray ray) const override;
115
121 bool lineCollision(Line line) const override;
122
123 };
124}
bool circleCollision(Circle circle) const override
bool pointCollision(Vector2f point) const override
Vector2f center() const
bool rayCollision(Ray ray) const override
Rect getBoundingBox() const override
bool lineCollision(Line line) const override
bool rectCollision(RotatedRect rect) const override