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

Generic sphere shape with a center and radius. More...

#include <donut/shapes.hpp>

Public Member Functions

constexpr bool contains (const Point< L, T > &point) const noexcept
 Check if a given point is contained within the extents of this sphere. More...
 

Public Attributes

Point< L, T > center
 Position of the center of the sphere. More...
 
radius
 Radius of the sphere. More...
 

Detailed Description

template<length_t L, typename T>
struct donut::Sphere< L, T >

Generic sphere shape with a center and radius.

Template Parameters
Lnumber of vector dimensions.
Tcomponent type for vector coordinates.

Member Function Documentation

◆ contains()

template<length_t L, typename T >
constexpr bool donut::Sphere< L, T >::contains ( const Point< L, T > &  point) const
constexprnoexcept

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

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

Member Data Documentation

◆ center

template<length_t L, typename T >
Point<L, T> donut::Sphere< L, T >::center

Position of the center of the sphere.

◆ radius

template<length_t L, typename T >
T donut::Sphere< L, T >::radius

Radius of the sphere.


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