PhysicsBasedAnimationToolkit 0.0.10
Cross-platform C++20 library of algorithms and data structures commonly used in computer graphics research on physically-based simulation.
Loading...
Searching...
No Matches
pbat::geometry::sdf::Sphere< TScalar > Struct Template Reference

Sphere centered in \( (0,0,0) \) with radius \( R \). More...

#include <Primitive.h>

Inheritance diagram for pbat::geometry::sdf::Sphere< TScalar >:
pbat::geometry::sdf::Primitive

Public Types

using ScalarType = TScalar
 Scalar type.
 

Public Member Functions

 Sphere ()=default
 Default constructor.
 
 Sphere (ScalarType R_)
 Construct a new Sphere object.
 
PBAT_HOST_DEVICE ScalarType Eval (Vec3< ScalarType > const &p) const
 Evaluate the signed distance function at a point.
 

Public Attributes

ScalarType R {1}
 Sphere radius.
 

Detailed Description

template<common::CArithmetic TScalar>
struct pbat::geometry::sdf::Sphere< TScalar >

Sphere centered in \( (0,0,0) \) with radius \( R \).

Template Parameters
TScalarScalar type

Constructor & Destructor Documentation

◆ Sphere()

template<common::CArithmetic TScalar>
pbat::geometry::sdf::Sphere< TScalar >::Sphere ( ScalarType R_)
inlineexplicit

Construct a new Sphere object.

Parameters
R_Sphere radius

Member Function Documentation

◆ Eval()

template<common::CArithmetic TScalar>
PBAT_HOST_DEVICE ScalarType pbat::geometry::sdf::Sphere< TScalar >::Eval ( Vec3< ScalarType > const & p) const
inline

Evaluate the signed distance function at a point.

Parameters
pPoint in 3D space
Returns
Signed distance to the sphere (negative inside, positive outside)

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