Kale
Loading...
Searching...
No Matches
Circle.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 Circle : public Geometry {
27
32
36 float radius;
37
41 Circle();
42
48 Circle(const Vector2f& center, float radius);
49
54 Rect getBoundingBox() const override;
55
61 bool pointCollision(Vector2f point) const override;
62
68 bool rectCollision(RotatedRect rect) const override;
69
75 bool rectCollision(Rect rect) const override;
76
82 bool circleCollision(Circle circle) const override;
83
89 bool rayCollision(Ray ray) const override;
90
96 bool lineCollision(Line line) const override;
97
98 };
99}
bool rectCollision(RotatedRect rect) const override
Definition Circle.cpp:67
Rect getBoundingBox() const override
Definition Circle.cpp:48
Vector2f center
Definition Circle.hpp:31
bool lineCollision(Line line) const override
Definition Circle.cpp:109
bool circleCollision(Circle circle) const override
Definition Circle.cpp:87
bool rayCollision(Ray ray) const override
Definition Circle.cpp:97
bool pointCollision(Vector2f point) const override
Definition Circle.cpp:57
float radius
Definition Circle.hpp:36