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

Triangle shape. More...

#include <Primitive.h>

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

Public Types

using ScalarType = TScalar
 Scalar type.
 

Public Member Functions

 Triangle ()=default
 Default constructor.
 
 Triangle (Vec3< ScalarType > const &a_, Vec3< ScalarType > const &b_, Vec3< ScalarType > const &c_)
 Construct a new Triangle 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 triangle.
 
Vec3< ScalarTypeb {TScalar(1), TScalar(0), TScalar(0)}
 Vertex b of the triangle.
 
Vec3< ScalarTypec {TScalar(0), TScalar(0), TScalar(1)}
 Vertex c of the triangle.
 

Detailed Description

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

Triangle shape.

Template Parameters
TScalarScalar type

Constructor & Destructor Documentation

◆ Triangle()

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

Construct a new Triangle object.

Parameters
a_Vertex a of the triangle
b_Vertex b of the triangle
c_Vertex c of the triangle

Member Function Documentation

◆ Eval()

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

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