libdonut  2.3.2
Application framework for cross-platform game development in C++20
Public Member Functions | Public Attributes | List of all members
donut::Circle< T > Struct Template Reference

Flat 2D circle shape with a center and radius. More...

#include <donut/shapes.hpp>

Public Member Functions

constexpr operator Sphere< 2, T > () const noexcept
 Convert this circle to an equivalent 2D sphere. More...
 
constexpr bool contains (const Point< 2, T > &point) const noexcept
 Check if a given point is contained within the extents of this circle. More...
 

Public Attributes

Point< 2, T > center
 Position of the center of the circle. More...
 
radius
 Radius of the circle. More...
 

Detailed Description

template<typename T>
struct donut::Circle< T >

Flat 2D circle shape with a center and radius.

Template Parameters
Tcomponent type for vector coordinates.

Member Function Documentation

◆ operator Sphere< 2, T >()

template<typename T >
constexpr donut::Circle< T >::operator Sphere< 2, T > ( ) const
inlineconstexprnoexcept

Convert this circle to an equivalent 2D sphere.

Returns
the circle as a sphere.

◆ contains()

template<typename T >
constexpr bool donut::Circle< T >::contains ( const Point< 2, T > &  point) const
constexprnoexcept

Check if a given point is contained within the extents of this circle.

Returns
true if the circle contains the given point, false otherwise.

Member Data Documentation

◆ center

template<typename T >
Point<2, T> donut::Circle< T >::center

Position of the center of the circle.

◆ radius

template<typename T >
T donut::Circle< T >::radius

Radius of the circle.


The documentation for this struct was generated from the following files: