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::Box< TScalar > Struct Template Reference

Axis-aligned box centered in \( (0,0,0) \) with half extents \( \text{he} \in \mathbb{R}^3 \). More...

#include <Primitive.h>

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

Public Types

using ScalarType = TScalar
 Scalar type.
 

Public Member Functions

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

Public Attributes

Vec3< ScalarTypehe
 Half extents of the box along each axis.
 

Detailed Description

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

Axis-aligned box centered in \( (0,0,0) \) with half extents \( \text{he} \in \mathbb{R}^3 \).

Template Parameters
TScalarScalar type

Constructor & Destructor Documentation

◆ Box()

template<common::CArithmetic TScalar>
pbat::geometry::sdf::Box< TScalar >::Box ( Vec3< ScalarType > const & he_)
inlineexplicit

Construct a new Box object.

Parameters
he_Half extents of the box along each axis

Member Function Documentation

◆ Eval()

template<common::CArithmetic TScalar>
PBAT_HOST_DEVICE ScalarType pbat::geometry::sdf::Box< 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 box (negative inside, positive outside)

Member Data Documentation

◆ he

template<common::CArithmetic TScalar>
Vec3<ScalarType> pbat::geometry::sdf::Box< TScalar >::he
Initial value:
{
TScalar(0.5),
TScalar(0.5),
TScalar(0.5)}

Half extents of the box along each axis.


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