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

Quadrilateral shape with vertices \( a, b, c, d \in \mathbb{R}^3 \). More...

#include <Primitive.h>

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

Public Types

using ScalarType = TScalar
 Scalar type.
 

Public Member Functions

 Quadrilateral ()=default
 Default constructor.
 
 Quadrilateral (Vec3< ScalarType > const &a_, Vec3< ScalarType > const &b_, Vec3< ScalarType > const &c_, Vec3< ScalarType > const &d_)
 Construct a new Quadrilateral object.
 
PBAT_HOST_DEVICE ScalarType Eval (Vec3< ScalarType > const &p) const
 Evaluate the signed distance function at a point.
 

Public Attributes

Vec3< ScalarTypea {TScalar(0), TScalar(0), TScalar(0)}
 Vertex a of the quadrilateral.
 
Vec3< ScalarTypeb {TScalar(1), TScalar(0), TScalar(0)}
 Vertex b of the quadrilateral.
 
Vec3< ScalarTypec {TScalar(1), TScalar(0), TScalar(1)}
 Vertex c of the quadrilateral.
 
Vec3< ScalarTyped {TScalar(0), TScalar(0), TScalar(1)}
 Vertex d of the quadrilateral.
 

Detailed Description

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

Quadrilateral shape with vertices \( a, b, c, d \in \mathbb{R}^3 \).

Template Parameters
TScalarScalar type

Constructor & Destructor Documentation

◆ Quadrilateral()

template<common::CArithmetic TScalar>
pbat::geometry::sdf::Quadrilateral< TScalar >::Quadrilateral ( Vec3< ScalarType > const & a_,
Vec3< ScalarType > const & b_,
Vec3< ScalarType > const & c_,
Vec3< ScalarType > const & d_ )
inlineexplicit

Construct a new Quadrilateral object.

Parameters
a_Vertex a of the quadrilateral
b_Vertex b of the quadrilateral
c_Vertex c of the quadrilateral
d_Vertex d of the quadrilateral

Member Function Documentation

◆ Eval()

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

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