Kale
Loading...
Searching...
No Matches
Rect.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 Rect : public Geometry {
27
32
37
41 Rect();
42
49
54 Vector2f center() const;
55
60 Vector2f topRight() const;
61
66 Vector2f bottomLeft() const;
67
72 Rect getBoundingBox() const override;
73
79 bool pointCollision(Vector2f point) const override;
80
86 bool rectCollision(RotatedRect rect) const override;
87
93 bool rectCollision(Rect rect) const override;
94
100 bool circleCollision(Circle circle) const override;
101
107 bool rayCollision(Ray ray) const override;
108
114 bool lineCollision(Line line) const override;
115
116 };
117}
Vector2f center() const
Definition Rect.cpp:48
bool pointCollision(Vector2f point) const override
Definition Rect.cpp:81
Vector2f bottomRight
Definition Rect.hpp:36
Vector2f topRight() const
Definition Rect.cpp:56
bool rayCollision(Ray ray) const override
Definition Rect.cpp:118
bool rectCollision(RotatedRect rect) const override
Definition Rect.cpp:90
bool lineCollision(Line line) const override
Definition Rect.cpp:127
Rect getBoundingBox() const override
Definition Rect.cpp:72
Vector2f bottomLeft() const
Definition Rect.cpp:64
bool circleCollision(Circle circle) const override
Definition Rect.cpp:108
Vector2f topLeft
Definition Rect.hpp:31