CubbyFlow::Sphere< N > Class Template Referencefinal

N-D sphere geometry. More...

#include <Core/Geometry/Sphere.hpp>

Inheritance diagram for CubbyFlow::Sphere< N >:
CubbyFlow::Surface< N >

Classes

class  Builder
 Front-end to create Sphere objects step by step. More...
 

Public Member Functions

 Sphere (const Transform< N > &_transform=Transform< N >{}, bool _isNormalFlipped=false)
 Constructs a sphere with center at the origin and radius of 1. More...
 
 Sphere (const Vector< double, N > &center, double radius, const Transform< N > &_transform=Transform< N >{}, bool _isNormalFlipped=false)
 Constructs a sphere with center and radius. More...
 
 ~Sphere () override=default
 Default virtual destructor. More...
 
 Sphere (const Sphere &other)
 Copy constructor. More...
 
 Sphere (Sphere &&other) noexcept
 Move constructor. More...
 
Sphereoperator= (const Sphere &other)
 Copy assignment operator. More...
 
Sphereoperator= (Sphere &&other) noexcept
 Move assignment operator. More...
 
- Public Member Functions inherited from CubbyFlow::Surface< N >
 Surface (const Transform< N > &transform=Transform< N >(), bool isNormalFlipped=false)
 Constructs a surface with normal direction. More...
 
virtual ~Surface ()=default
 Default virtual destructor. More...
 
 Surface (const Surface &other)
 Copy constructor. More...
 
 Surface (Surface &&other) noexcept
 Move constructor. More...
 
Surfaceoperator= (const Surface &other)
 Copy assignment operator. More...
 
Surfaceoperator= (Surface &&other) noexcept
 Move assignment operator. More...
 
Vector< double, N > ClosestPoint (const Vector< double, N > &otherPoint) const
 
BoundingBox< double, N > GetBoundingBox () const
 Returns the bounding box of this surface object. More...
 
bool Intersects (const Ray< double, N > &ray) const
 Returns true if the given ray intersects with this surface object. More...
 
double ClosestDistance (const Vector< double, N > &otherPoint) const
 
SurfaceRayIntersection< N > ClosestIntersection (const Ray< double, N > &ray) const
 Returns the closest intersection point for given ray. More...
 
Vector< double, N > ClosestNormal (const Vector< double, N > &otherPoint) const
 
virtual void UpdateQueryEngine ()
 Updates internal spatial query engine. More...
 
virtual bool IsBounded () const
 Returns true if bounding box can be defined. More...
 
virtual bool IsValidGeometry () const
 Returns true if the surface is a valid geometry. More...
 
bool IsInside (const Vector< double, N > &otherPoint) const
 

Static Public Member Functions

static Builder GetBuilder ()
 Returns builder fox Sphere. More...
 

Public Attributes

Vector< double, N > center
 Center of the sphere. More...
 
double radius = 1.0
 Radius of the sphere. More...
 
- Public Attributes inherited from CubbyFlow::Surface< N >
Transform< N > transform
 Local-to-world transform. More...
 
bool isNormalFlipped = false
 Flips normal. More...
 

Additional Inherited Members

- Protected Member Functions inherited from CubbyFlow::Surface< N >
virtual bool IsInsideLocal (const Vector< double, N > &otherPoint) const
 

Detailed Description

template<size_t N>
class CubbyFlow::Sphere< N >

N-D sphere geometry.

This class represents N-D sphere geometry which extends Surface2 by overriding surface-related queries.

Constructor & Destructor Documentation

◆ Sphere() [1/4]

template<size_t N>
CubbyFlow::Sphere< N >::Sphere ( const Transform< N > &  _transform = Transform< N >{},
bool  _isNormalFlipped = false 
)

Constructs a sphere with center at the origin and radius of 1.

◆ Sphere() [2/4]

template<size_t N>
CubbyFlow::Sphere< N >::Sphere ( const Vector< double, N > &  center,
double  radius,
const Transform< N > &  _transform = Transform< N >{},
bool  _isNormalFlipped = false 
)

Constructs a sphere with center and radius.

◆ ~Sphere()

template<size_t N>
CubbyFlow::Sphere< N >::~Sphere ( )
overridedefault

Default virtual destructor.

◆ Sphere() [3/4]

template<size_t N>
CubbyFlow::Sphere< N >::Sphere ( const Sphere< N > &  other)

Copy constructor.

◆ Sphere() [4/4]

template<size_t N>
CubbyFlow::Sphere< N >::Sphere ( Sphere< N > &&  other)
noexcept

Move constructor.

Member Function Documentation

◆ GetBuilder()

template<size_t N>
static Builder CubbyFlow::Sphere< N >::GetBuilder ( )
static

Returns builder fox Sphere.

◆ operator=() [1/2]

template<size_t N>
Sphere& CubbyFlow::Sphere< N >::operator= ( const Sphere< N > &  other)

Copy assignment operator.

◆ operator=() [2/2]

template<size_t N>
Sphere& CubbyFlow::Sphere< N >::operator= ( Sphere< N > &&  other)
noexcept

Move assignment operator.

Member Data Documentation

◆ center

template<size_t N>
Vector<double, N> CubbyFlow::Sphere< N >::center

Center of the sphere.

◆ radius

template<size_t N>
double CubbyFlow::Sphere< N >::radius = 1.0

Radius of the sphere.


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