![]() |
Gamedev Framework (gf)
0.14.0
A C++14 framework for 2D games
|
A n-dimension ball. More...
#include <gf/Ball.h>
Public Member Functions | |
| constexpr | Ball () noexcept |
| Default constructor. More... | |
| constexpr | Ball (const Vector< T, N > &ballCenter, T ballRadius) noexcept |
| Construct the ball from center and radius. More... | |
| constexpr Vector< T, N > | getCenter () const noexcept |
| Get the center of the ball. More... | |
| constexpr T | getRadius () const noexcept |
| Get the radius of the ball. More... | |
| constexpr bool | isEmpty () const noexcept |
| Check if the ball is empty. More... | |
| bool | contains (const Vector< T, N > &point) const noexcept |
| Check if a point is insied a ball's area. More... | |
| bool | intersects (const Ball< T, N > &other) const noexcept |
| Check the intersection between two balls. More... | |
Public Attributes | |
| Vector< T, N > | center |
| Center of the ball. More... | |
| T | radius |
| Radius of the ball. More... | |
Related Functions | |
(Note that these are not member functions.) | |
| template<typename T , std::size_t N> | |
| constexpr bool | operator== (const Ball< T, N > &lhs, const Ball< T, N > &rhs) |
| Equality operator. More... | |
| template<typename T , std::size_t N> | |
| constexpr bool | operator!= (const Ball< T, N > &lhs, const Ball< T, N > &rhs) |
| Inequality operator. More... | |
| template<typename Archive , typename T , std::size_t N> | |
| Archive & | operator| (Archive &ar, Ball< T, N > &ball) |
| Serialize a ball. More... | |
A n-dimension ball.
A ball is defined by its center and its radius. It is a very simple class defined for convenience, so its member variables (center and radius) are public and can be accessed directly.
Default constructor.
Creates an empty ball.
|
inlinenoexcept |
Construct the ball from center and radius.
| ballCenter | Center of the ball |
| ballRadius | Radius of the ball |
|
inlinenoexcept |
Check if a point is insied a ball's area.
| point | The point to test |
|
inlinenoexcept |
Get the center of the ball.
It is a synonym for the center member
|
inlinenoexcept |
Get the radius of the ball.
It is a synonym for the radius member
|
inlinenoexcept |
Check the intersection between two balls.
| other | The ball to test |
|
inlinenoexcept |
Check if the ball is empty.
An empty ball is a ball with a zero radius.
|
related |
Inequality operator.
| lhs | First ball |
| rhs | Second ball |
|
related |
Equality operator.
| lhs | First ball |
| rhs | Second ball |
|
related |
Serialize a ball.
| ar | The archive |
| ball | The ball to serialize |
1.8.13