MeshLib
 
Loading...
Searching...
No Matches
MR::Sphere< V > Struct Template Reference

#include <MRSphere.h>

Public Types

using T = typename V::ValueType
 

Public Member Functions

constexpr Sphere () noexcept=default
 
constexpr Sphere (const V &c, T r) noexcept
 
template<typename U >
constexpr Sphere (const Sphere< U > &l) noexcept
 
project (const V &x) const
 finds the closest point on sphere
 
T distance (const V &x) const
 
T distanceSq (const V &x) const
 returns squared distance from given point to this sphere
 

Public Attributes

center
 
T radius = 0
 

Friends

bool operator== (const Sphere &a, const Sphere &b)=default
 

Member Typedef Documentation

◆ T

template<typename V >
using MR::Sphere< V >::T = typename V::ValueType

Constructor & Destructor Documentation

◆ Sphere() [1/3]

template<typename V >
MR::Sphere< V >::Sphere ( )
constexprdefaultnoexcept

◆ Sphere() [2/3]

template<typename V >
MR::Sphere< V >::Sphere ( const V & c,
T r )
inlineconstexprnoexcept

◆ Sphere() [3/3]

template<typename V >
template<typename U >
MR::Sphere< V >::Sphere ( const Sphere< U > & l)
inlineexplicitconstexprnoexcept

Member Function Documentation

◆ distance()

template<typename V >
T MR::Sphere< V >::distance ( const V & x) const
inlinenodiscard

returns signed distance from given point to this sphere: positive - outside, zero - on sphere, negative - inside

◆ distanceSq()

template<typename V >
T MR::Sphere< V >::distanceSq ( const V & x) const
inlinenodiscard

returns squared distance from given point to this sphere

◆ project()

template<typename V >
V MR::Sphere< V >::project ( const V & x) const
inlinenodiscard

finds the closest point on sphere

Friends And Related Symbol Documentation

◆ operator==

template<typename V >
bool operator== ( const Sphere< V > & a,
const Sphere< V > & b )
friend

Member Data Documentation

◆ center

template<typename V >
V MR::Sphere< V >::center

◆ radius

template<typename V >
T MR::Sphere< V >::radius = 0

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