header_utils
Loading...
Searching...
No Matches
ghassanpl::geometry::tcapsule< T > Struct Template Reference

Represents a 2D capsule area_shape. More...

#include <capsule.h>

Public Member Functions

auto centroid () const
bool contains (glm::tvec2< T > pt) const
T edge_length () const
glm::tvec2< T > edge_point_alpha (T t) const
T calculate_area () const
glm::tvec2< T > edge_point (T t) const
trec2< T > bounding_box () const
glm::tvec2< T > closest_point_to (glm::tvec2< T > pt) const

Public Attributes

tsegment< T > axis
T radius

Detailed Description

template<std::floating_point T>
struct ghassanpl::geometry::tcapsule< T >

Represents a 2D capsule area_shape.

Definition at line 16 of file capsule.h.

Member Function Documentation

◆ bounding_box()

template<std::floating_point T>
trec2< T > ghassanpl::geometry::tcapsule< T >::bounding_box ( ) const
inline

Definition at line 37 of file capsule.h.

◆ calculate_area()

template<std::floating_point T>
T ghassanpl::geometry::tcapsule< T >::calculate_area ( ) const
inline

Definition at line 35 of file capsule.h.

◆ centroid()

template<std::floating_point T>
auto ghassanpl::geometry::tcapsule< T >::centroid ( ) const
inline

Definition at line 21 of file capsule.h.

◆ closest_point_to()

template<std::floating_point T>
glm::tvec2< T > ghassanpl::geometry::tcapsule< T >::closest_point_to ( glm::tvec2< T > pt) const
inline

Definition at line 39 of file capsule.h.

◆ contains()

template<std::floating_point T>
bool ghassanpl::geometry::tcapsule< T >::contains ( glm::tvec2< T > pt) const
inline

Definition at line 23 of file capsule.h.

◆ edge_length()

template<std::floating_point T>
T ghassanpl::geometry::tcapsule< T >::edge_length ( ) const
inline

Definition at line 28 of file capsule.h.

◆ edge_point()

template<std::floating_point T>
glm::tvec2< T > ghassanpl::geometry::tcapsule< T >::edge_point ( T t) const
inline

Definition at line 36 of file capsule.h.

Member Data Documentation

◆ axis

template<std::floating_point T>
tsegment<T> ghassanpl::geometry::tcapsule< T >::axis

Definition at line 18 of file capsule.h.

◆ radius

template<std::floating_point T>
T ghassanpl::geometry::tcapsule< T >::radius

Definition at line 19 of file capsule.h.