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

Generic capsule shape with a center line segment 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 capsule. More...
 

Public Attributes

LineSegment< L, T > centerLine
 Center line of the capsule. More...
 
radius
 Radius of the capsule from the center line. More...
 

Detailed Description

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

Generic capsule shape with a center line segment 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::Capsule< L, T >::contains ( const Point< L, T > &  point) const
constexprnoexcept

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

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

Member Data Documentation

◆ centerLine

template<length_t L, typename T >
LineSegment<L, T> donut::Capsule< L, T >::centerLine

Center line of the capsule.

◆ radius

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

Radius of the capsule from the center line.


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