PhysicsBasedAnimationToolkit 0.0.10
Cross-platform C++20 library of algorithms and data structures commonly used in computer graphics research on physically-based simulation.
|
This file contains functions to answer intersection queries. More...
#include "pbat/Aliases.h"
#include "pbat/HostDevice.h"
#include "pbat/math/linalg/mini/Mini.h"
#include <array>
#include <cmath>
#include <optional>
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. | |
namespace | pbat::geometry::IntersectionQueries |
This namespace contains functions to answer intersection queries. | |
Functions | |
template<mini::CMatrix TMatrixAP, mini::CMatrix TMatrixAB, mini::CMatrix TMatrixAC> | |
PBAT_HOST_DEVICE auto | pbat::geometry::IntersectionQueries::TriangleBarycentricCoordinates (TMatrixAP const &AP, TMatrixAB const &AB, TMatrixAC const &AC) -> mini::SMatrix< typename TMatrixAP::ScalarType, 3, 1 > |
Computes the barycentric coordinates of point P with respect to the triangle spanned by vertices A, B, and C. | |
template<mini::CMatrix TMatrixP, mini::CMatrix TMatrixA, mini::CMatrix TMatrixB, mini::CMatrix TMatrixC> | |
PBAT_HOST_DEVICE auto | pbat::geometry::IntersectionQueries::TriangleBarycentricCoordinates (TMatrixP const &P, TMatrixA const &A, TMatrixB const &B, TMatrixC const &C) -> mini::SVector< typename TMatrixP::ScalarType, 3 > |
Computes the barycentric coordinates of point P with respect to the triangle spanned by vertices A, B, and C. | |
template<mini::CMatrix TMatrixL1, mini::CMatrix TMatrixU1, mini::CMatrix TMatrixL2, mini::CMatrix TMatrixU2> | |
PBAT_HOST_DEVICE auto | pbat::geometry::IntersectionQueries::AxisAlignedBoundingBoxes (TMatrixL1 const &L1, TMatrixU1 const &U1, TMatrixL2 const &L2, TMatrixU2 const &U2) -> mini::SMatrix< typename TMatrixL1::ScalarType, TMatrixL1::Rows, 2 > |
Computes the intersection volume between 2 axis aligned bounding boxes. | |
template<mini::CMatrix TMatrixP, mini::CMatrix TMatrixQ, mini::CMatrix TMatrixC> | |
PBAT_HOST_DEVICE auto | pbat::geometry::IntersectionQueries::LineSegmentSphere (TMatrixP const &P, TMatrixQ const &Q, TMatrixC const &C, typename TMatrixC::ScalarType R) -> std::optional< mini::SVector< typename TMatrixP::ScalarType, TMatrixP::kRows > > |
Computes the intersection point, if any, between a line segment PQ and a sphere (C,r). | |
template<mini::CMatrix TMatrixP, mini::CMatrix TMatrixQ, mini::CMatrix TMatrixA, mini::CMatrix TMatrixB, mini::CMatrix TMatrixC> | |
PBAT_HOST_DEVICE auto | pbat::geometry::IntersectionQueries::LineSegmentPlane3D (TMatrixP const &P, TMatrixQ const &Q, TMatrixA const &A, TMatrixB const &B, TMatrixC const &C) -> std::optional< mini::SVector< typename TMatrixP::ScalarType, TMatrixP::kRows > > |
Computes the intersection point, if any, between a line including points P,Q and the plane spanned by triangle ABC, in 3D. | |
template<mini::CMatrix TMatrixP, mini::CMatrix TMatrixQ, mini::CMatrix TMatrixN> | |
PBAT_HOST_DEVICE auto | pbat::geometry::IntersectionQueries::LineSegmentPlane3D (TMatrixP const &P, TMatrixQ const &Q, TMatrixN const &n, typename TMatrixN::ScalarType d) -> std::optional< mini::SVector< typename TMatrixP::ScalarType, TMatrixP::kRows > > |
Computes the intersection point, if any, between a line including points P,Q and the plane (n,d), in 3D. | |
template<mini::CMatrix TMatrixP, mini::CMatrix TMatrixQ, mini::CMatrix TMatrixA, mini::CMatrix TMatrixB, mini::CMatrix TMatrixC> | |
PBAT_HOST_DEVICE auto | pbat::geometry::IntersectionQueries::UvwLineTriangle3D (TMatrixP const &P, TMatrixQ const &Q, TMatrixA const &A, TMatrixB const &B, TMatrixC const &C) -> std::optional< mini::SVector< typename TMatrixP::ScalarType, 3 > > |
Computes the intersection point, if any, between a line including points P,Q and a triangle ABC, in 3D. | |
template<mini::CMatrix TMatrixP, mini::CMatrix TMatrixQ, mini::CMatrix TMatrixA, mini::CMatrix TMatrixB, mini::CMatrix TMatrixC> | |
PBAT_HOST_DEVICE auto | pbat::geometry::IntersectionQueries::UvwLineSegmentTriangle3D (TMatrixP const &P, TMatrixQ const &Q, TMatrixA const &A, TMatrixB const &B, TMatrixC const &C) -> std::optional< mini::SVector< typename TMatrixP::ScalarType, 4 > > |
Computes the intersection point, if any, between a line segment delimited by points P,Q and a triangle ABC, in 3D. | |
template<mini::CMatrix TMatrixA1, mini::CMatrix TMatrixB1, mini::CMatrix TMatrixC1, mini::CMatrix TMatrixA2, mini::CMatrix TMatrixB2, mini::CMatrix TMatrixC2> | |
PBAT_HOST_DEVICE auto | pbat::geometry::IntersectionQueries::UvwTriangles3D (TMatrixA1 const &A1, TMatrixB1 const &B1, TMatrixC1 const &C1, TMatrixA2 const &A2, TMatrixB2 const &B2, TMatrixC2 const &C2) -> std::array< std::optional< mini::SVector< typename TMatrixA1::ScalarType, 3 > >, 6u > |
Computes intersection points between 3 edges (as line segments) of triangle A1B1C1 and triangle A2B2C2, and intersection points between 3 edges (as line segments) of triangle A2B2C2 and triangle A1B1C1, in 3D. | |
This file contains functions to answer intersection queries.