SPH
Public Member Functions | List of all members
Sphere Class Reference

#include <Sphere.h>

Public Member Functions

 Sphere ()=default
 Creates an uninitialized sphere. More...
 
 Sphere (const Vector &center, const Float radius)
 Creates a sphere given its center and radius. More...
 
INLINE Vector center () const
 
INLINE Vectorcenter ()
 
INLINE Float radius () const
 
INLINE Floatradius ()
 
INLINE Float volume () const
 
INLINE bool contains (const Vector &v) const
 
INLINE Box getBBox () const
 
INLINE bool intersects (const Sphere &other) const
 Checks if the sphere intersects another sphere. More...
 
INLINE bool overlaps (const Box &box) const
 Checks whether the sphere partially or fully overlaps given box. More...
 
INLINE IntersectResult intersectsBox (const Box &box) const
 Checks the intersection of the sphere with a box. More...
 

Detailed Description

Definition at line 18 of file Sphere.h.

Constructor & Destructor Documentation

◆ Sphere() [1/2]

Sphere::Sphere ( )
default

Creates an uninitialized sphere.

◆ Sphere() [2/2]

Sphere::Sphere ( const Vector center,
const Float  radius 
)
inline

Creates a sphere given its center and radius.

Definition at line 31 of file Sphere.h.

Member Function Documentation

◆ center() [1/2]

INLINE Vector& Sphere::center ( )
inline

Definition at line 41 of file Sphere.h.

◆ center() [2/2]

INLINE Vector Sphere::center ( ) const
inline

Definition at line 37 of file Sphere.h.

◆ contains()

INLINE bool Sphere::contains ( const Vector v) const
inline

Definition at line 57 of file Sphere.h.

◆ getBBox()

INLINE Box Sphere::getBBox ( ) const
inline

Definition at line 61 of file Sphere.h.

◆ intersects()

INLINE bool Sphere::intersects ( const Sphere other) const
inline

Checks if the sphere intersects another sphere.

If one sphere contains the other one entirely, it counts as an intersections.

Definition at line 68 of file Sphere.h.

◆ intersectsBox()

INLINE IntersectResult Sphere::intersectsBox ( const Box box) const
inline

Checks the intersection of the sphere with a box.

Todo:
not all branches are actually needed by TreeWalk, possibly optimize by some constexpr flag

Definition at line 83 of file Sphere.h.

◆ overlaps()

INLINE bool Sphere::overlaps ( const Box box) const
inline

Checks whether the sphere partially or fully overlaps given box.

Definition at line 73 of file Sphere.h.

◆ radius() [1/2]

INLINE Float& Sphere::radius ( )
inline

Definition at line 49 of file Sphere.h.

◆ radius() [2/2]

INLINE Float Sphere::radius ( ) const
inline

Definition at line 45 of file Sphere.h.

◆ volume()

INLINE Float Sphere::volume ( ) const
inline

Definition at line 53 of file Sphere.h.


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