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::DistanceQueries Namespace Reference

This namespace contains functions to answer distance queries. More...

Functions

template<mini::CMatrix TMatrixL1, mini::CMatrix TMatrixU1, mini::CMatrix TMatrixL2, mini::CMatrix TMatrixU2>
PBAT_HOST_DEVICE auto AxisAlignedBoundingBoxes (TMatrixL1 const &L1, TMatrixU1 const &U1, TMatrixL2 const &L2, TMatrixU2 const &U2) -> typename TMatrixL1::ScalarType
 Obtain squared distance between 2 axis-aligned bounding boxes.
 
template<mini::CMatrix TMatrixP, mini::CMatrix TMatrixL, mini::CMatrix TMatrixU>
PBAT_HOST_DEVICE auto PointAxisAlignedBoundingBox (TMatrixP const &P, TMatrixL const &L, TMatrixU const &U) -> typename TMatrixP::ScalarType
 Obtain squared distance between point P and axis-aligned box (L,U)
 
template<mini::CMatrix TMatrixP, mini::CMatrix TMatrixA, mini::CMatrix TMatrixB, mini::CMatrix TMatrixC>
PBAT_HOST_DEVICE auto PointTriangle (TMatrixP const &P, TMatrixA const &A, TMatrixB const &B, TMatrixC const &C) -> typename TMatrixP::ScalarType
 Obtain squared distance between point P and triangle ABC.
 
template<mini::CMatrix TMatrixP, mini::CMatrix TMatrixA, mini::CMatrix TMatrixB, mini::CMatrix TMatrixC, mini::CMatrix TMatrixD>
PBAT_HOST_DEVICE auto PointTetrahedron (TMatrixP const &P, TMatrixA const &A, TMatrixB const &B, TMatrixC const &C, TMatrixD const &D) -> typename TMatrixP::ScalarType
 Obtain squared distance between point P and tetrahedron ABCD.
 
template<mini::CMatrix TMatrixX, mini::CMatrix TMatrixP, mini::CMatrix TMatrixN>
PBAT_HOST_DEVICE auto PointPlane (TMatrixX const &X, TMatrixP const &P, TMatrixN const &n) -> typename TMatrixX::ScalarType
 Obtains the signed distance of X w.r.t. plane (P,n)
 
template<mini::CMatrix TMatrixX, mini::CMatrix TMatrixA, mini::CMatrix TMatrixB, mini::CMatrix TMatrixC>
PBAT_HOST_DEVICE auto PointPlane (TMatrixX const &X, TMatrixA const &A, TMatrixB const &B, TMatrixC const &C) -> typename TMatrixX::ScalarType
 Obtains the signed distance of X w.r.t. plane spanned by ABC.
 
template<mini::CMatrix TMatrixX, mini::CMatrix TMatrixA, mini::CMatrix TMatrixB, mini::CMatrix TMatrixC>
PBAT_HOST_DEVICE auto SphereTriangle (TMatrixX const &X, typename TMatrixX::ScalarType R, TMatrixA const &A, TMatrixB const &B, TMatrixC const &C) -> typename TMatrixX::ScalarType
 Obtains the squared distance between sphere (X,R) and triangle ABC.
 

Detailed Description

This namespace contains functions to answer distance queries.

Function Documentation

◆ AxisAlignedBoundingBoxes()

template<mini::CMatrix TMatrixL1, mini::CMatrix TMatrixU1, mini::CMatrix TMatrixL2, mini::CMatrix TMatrixU2>
PBAT_HOST_DEVICE auto pbat::geometry::DistanceQueries::AxisAlignedBoundingBoxes ( TMatrixL1 const & L1,
TMatrixU1 const & U1,
TMatrixL2 const & L2,
TMatrixU2 const & U2 ) -> typename TMatrixL1::ScalarType

Obtain squared distance between 2 axis-aligned bounding boxes.

Template Parameters
TMatrixL11st AABB's lower corner matrix type
TMatrixU11st AABB's upper corner matrix type
TMatrixL22nd AABB's lower corner matrix type
TMatrixU22nd AABB's upper corner matrix type
Parameters
L11st AABB's lower corner
U11st AABB's upper corner
L22nd AABB's lower corner
U22nd AABB's upper corner
Returns
Squared distance between the 2 AABBs

◆ PointAxisAlignedBoundingBox()

template<mini::CMatrix TMatrixP, mini::CMatrix TMatrixL, mini::CMatrix TMatrixU>
PBAT_HOST_DEVICE auto pbat::geometry::DistanceQueries::PointAxisAlignedBoundingBox ( TMatrixP const & P,
TMatrixL const & L,
TMatrixU const & U ) -> typename TMatrixP::ScalarType

Obtain squared distance between point P and axis-aligned box (L,U)

Template Parameters
TMatrixPPoint matrix type
TMatrixLLower corner matrix type
TMatrixUUpper corner matrix type
Parameters
PPoint
LLower corner of the box
UUpper corner of the box
Returns
Squared distance between point and box

◆ PointPlane() [1/2]

template<mini::CMatrix TMatrixX, mini::CMatrix TMatrixA, mini::CMatrix TMatrixB, mini::CMatrix TMatrixC>
PBAT_HOST_DEVICE auto pbat::geometry::DistanceQueries::PointPlane ( TMatrixX const & X,
TMatrixA const & A,
TMatrixB const & B,
TMatrixC const & C ) -> typename TMatrixX::ScalarType

Obtains the signed distance of X w.r.t. plane spanned by ABC.

Template Parameters
TMatrixXQuery point matrix type
TMatrixAVertex A of the triangle in plane matrix type
TMatrixBVertex B of the triangle in plane matrix type
TMatrixCVertex C of the triangle in plane matrix type
Parameters
XQuery point
AVertex A of the triangle in plane
BVertex B of the triangle in plane
CVertex C of the triangle in plane
Returns
Signed distance of X w.r.t. plane spanned by ABC

◆ PointPlane() [2/2]

template<mini::CMatrix TMatrixX, mini::CMatrix TMatrixP, mini::CMatrix TMatrixN>
PBAT_HOST_DEVICE auto pbat::geometry::DistanceQueries::PointPlane ( TMatrixX const & X,
TMatrixP const & P,
TMatrixN const & n ) -> typename TMatrixX::ScalarType

Obtains the signed distance of X w.r.t. plane (P,n)

Template Parameters
TMatrixXQuery point matrix type
TMatrixPPoint on the plane matrix type
TMatrixNNormal of the plane matrix type
Parameters
XQuery point
PPoint on the plane
nNormal of the plane
Returns
Signed distance of X w.r.t. plane (P,n)

◆ PointTetrahedron()

template<mini::CMatrix TMatrixP, mini::CMatrix TMatrixA, mini::CMatrix TMatrixB, mini::CMatrix TMatrixC, mini::CMatrix TMatrixD>
PBAT_HOST_DEVICE auto pbat::geometry::DistanceQueries::PointTetrahedron ( TMatrixP const & P,
TMatrixA const & A,
TMatrixB const & B,
TMatrixC const & C,
TMatrixD const & D ) -> typename TMatrixP::ScalarType

Obtain squared distance between point P and tetrahedron ABCD.

Template Parameters
TMatrixPPoint matrix type
TMatrixAVertex A matrix type
TMatrixBVertex B matrix type
TMatrixCVertex C matrix type
TMatrixDVertex D matrix type
Parameters
PPoint
AVertex A of the tetrahedron
BVertex B of the tetrahedron
CVertex C of the tetrahedron
DVertex D of the tetrahedron
Returns
Squared distance between point and tetrahedron

◆ PointTriangle()

template<mini::CMatrix TMatrixP, mini::CMatrix TMatrixA, mini::CMatrix TMatrixB, mini::CMatrix TMatrixC>
PBAT_HOST_DEVICE auto pbat::geometry::DistanceQueries::PointTriangle ( TMatrixP const & P,
TMatrixA const & A,
TMatrixB const & B,
TMatrixC const & C ) -> typename TMatrixP::ScalarType

Obtain squared distance between point P and triangle ABC.

Template Parameters
TMatrixPPoint matrix type
TMatrixAVertex A matrix type
TMatrixBVertex B matrix type
TMatrixCVertex C matrix type
Parameters
PPoint
AVertex A of the triangle
BVertex B of the triangle
CVertex C of the triangle
Returns
Squared distance between point and triangle

◆ SphereTriangle()

template<mini::CMatrix TMatrixX, mini::CMatrix TMatrixA, mini::CMatrix TMatrixB, mini::CMatrix TMatrixC>
PBAT_HOST_DEVICE auto pbat::geometry::DistanceQueries::SphereTriangle ( TMatrixX const & X,
typename TMatrixX::ScalarType R,
TMatrixA const & A,
TMatrixB const & B,
TMatrixC const & C ) -> typename TMatrixX::ScalarType

Obtains the squared distance between sphere (X,R) and triangle ABC.

Template Parameters
TMatrixXSphere center matrix type
TMatrixATriangle vertex A matrix type
TMatrixBTriangle vertex B matrix type
TMatrixCTriangle vertex C matrix type
Parameters
XSphere center
RSphere radius
AVertex A of the triangle
BVertex B of the triangle
CVertex C of the triangle
Returns
Squared distance between sphere and triangle