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
PointTriangleCcd.h File Reference

Point-triangle continuous collision detection (CCD) implementation. More...

#include "IntersectionQueries.h"
#include "pbat/HostDevice.h"
#include "pbat/math/linalg/mini/Concepts.h"
#include "pbat/math/linalg/mini/Matrix.h"
#include "pbat/math/linalg/mini/Reductions.h"
#include "pbat/math/polynomial/Roots.h"
#include <array>
#include <cmath>

Go to the source code of this file.

Namespaces

namespace  pbat
 The main namespace of the library.
 
namespace  pbat::geometry
 Geometric queries, quantities and data structures.
 

Functions

template<math::linalg::mini::CReadableVectorizedMatrix TXT, math::linalg::mini::CReadableVectorizedMatrix TAT, math::linalg::mini::CReadableVectorizedMatrix TBT, math::linalg::mini::CReadableVectorizedMatrix TCT, math::linalg::mini::CReadableVectorizedMatrix TX, math::linalg::mini::CReadableVectorizedMatrix TA, math::linalg::mini::CReadableVectorizedMatrix TB, math::linalg::mini::CReadableVectorizedMatrix TC, class TScalar = typename TX::ScalarType>
PBAT_HOST_DEVICE std::array< TScalar, 4 > pbat::geometry::detail::PointTriangleCcdUnivariatePolynomial (TXT const &XT, TAT const &AT, TBT const &BT, TCT const &CT, TX const &X, TA const &A, TB const &B, TC const &C)
 Computes the univariate linearly swept point-triangle co-planarity polynomial.
 
template<math::linalg::mini::CReadableVectorizedMatrix TXT, math::linalg::mini::CReadableVectorizedMatrix TAT, math::linalg::mini::CReadableVectorizedMatrix TBT, math::linalg::mini::CReadableVectorizedMatrix TCT, math::linalg::mini::CReadableVectorizedMatrix TX, math::linalg::mini::CReadableVectorizedMatrix TA, math::linalg::mini::CReadableVectorizedMatrix TB, math::linalg::mini::CReadableVectorizedMatrix TC, class TScalar = typename TXT::ScalarType>
PBAT_HOST_DEVICE auto pbat::geometry::PointTriangleCcd (TXT const &XT, TAT const &AT, TBT const &BT, TCT const &CT, TX const &X, TA const &A, TB const &B, TC const &C) -> math::linalg::mini::SVector< TScalar, 4 >
 Computes the time of impact \( t^* \) and barycentric coordinates \( \mathbf{\beta} \) of the intersection point between a point and a triangle moving along a linear trajectory.
 

Detailed Description

Point-triangle continuous collision detection (CCD) implementation.

Author
Quoc-Minh Ton-That (tonth.nosp@m.at.q.nosp@m.uocmi.nosp@m.nh@g.nosp@m.mail..nosp@m.com)
Date
2025-03-27

Function Documentation

◆ PointTriangleCcdUnivariatePolynomial()

template<math::linalg::mini::CReadableVectorizedMatrix TXT, math::linalg::mini::CReadableVectorizedMatrix TAT, math::linalg::mini::CReadableVectorizedMatrix TBT, math::linalg::mini::CReadableVectorizedMatrix TCT, math::linalg::mini::CReadableVectorizedMatrix TX, math::linalg::mini::CReadableVectorizedMatrix TA, math::linalg::mini::CReadableVectorizedMatrix TB, math::linalg::mini::CReadableVectorizedMatrix TC, class TScalar = typename TX::ScalarType>
PBAT_HOST_DEVICE std::array< TScalar, 4 > pbat::geometry::detail::PointTriangleCcdUnivariatePolynomial ( TXT const & XT,
TAT const & AT,
TBT const & BT,
TCT const & CT,
TX const & X,
TA const & A,
TB const & B,
TC const & C )

Computes the univariate linearly swept point-triangle co-planarity polynomial.

\[\langle \mathbf{n}(t), \mathbf{q}(t) \rangle = 0 , \]

where \( \mathbf{n}(t) = (\mathbf{b}(t) - \mathbf{a}) \times (\mathbf{c}(t) - \mathbf{a}) \) and \( \mathbf{q}(t) = \mathbf{x}(t) - \mathbf{a} \)

Note
Code-generated from python/geometry/ccd.py
Template Parameters
TXTType of the input matrix XT
TATType of the input matrix AT
TBTType of the input matrix BT
TCTType of the input matrix CT
TXType of the input matrix X
TAType of the input matrix A
TBType of the input matrix B
TCType of the input matrix C
TScalarType of the scalar
Parameters
XTMatrix of the initial positions of the point
ATMatrix of the initial positions of the triangle vertex A
BTMatrix of the initial positions of the triangle vertex B
CTMatrix of the initial positions of the triangle vertex C
XMatrix of the final positions of the point
AMatrix of the final positions of the triangle vertex A
BMatrix of the final positions of the triangle vertex B
CMatrix of the final positions of the triangle vertex C
Returns
4-vector containing the coefficients of the polynomial in increasing order