9 template<
typename Real>
17 template<
typename Real>
24 template<
typename Real>
36 Triangle3D tri_ret = triangle_sweep.interpolate(t);
41 bool bIntersected = baryParam.
u >=
Real(0) & baryParam.
u <=
Real(1) + threshold & baryParam.
v >=
Real(0) - threshold & baryParam.
v <=
Real(1) + threshold & baryParam.
w >=
Real(0) - threshold & baryParam.
w <=
Real(1) + threshold;
42 if (bValid && bIntersected)
58 template<
typename Real>
62 point.
origin = (1 - t)*start_point.origin + t * end_point.origin;
68 template<
typename Real>
76 template<
typename Real>
84 template<
typename Real>
0D geometric primitive in three-dimensional space
DYN_FUNC Real distance(const TPoint3D< Real > &pt) const
DYN_FUNC TPointSweep3D(TPoint3D< Real > &start, TPoint3D< Real > &end)
TPoint3D< Real > end_point
DYN_FUNC bool intersect(const TTriangleSweep3D< Real > &triangle_sweep, typename TTriangle3D< Real >::Param &baryc, Real &t, const Real threshold=Real(0.00001)) const
Calculate the possible intersection for a moving point and a moving triangle. We assume both the poin...
TPoint3D< Real > start_point
DYN_FUNC TPoint3D< double > interpolate(double t) const
DYN_FUNC bool computeBarycentrics(const Coord3D &p, Param &bary) const
DYN_FUNC TTriangleSweep3D(TTriangle3D< Real > &start, TTriangle3D< Real > &end)
TTriangle3D< Real > end_triangle
TTriangle3D< Real > start_triangle
DYN_FUNC TTriangle3D< Real > interpolate(Real t) const
Return the intermediate state for a triangle.
static DYN_FUNC bool VertexFaceCCD(const Vector< T, 3 > &p0, const Vector< T, 3 > &a0, const Vector< T, 3 > &b0, const Vector< T, 3 > &c0, const Vector< T, 3 > &p1, const Vector< T, 3 > &a1, const Vector< T, 3 > &b1, const Vector< T, 3 > &c1, T &time)
Do a continuous collision detection between a vertex and a triangle.
This is an implementation of AdditiveCCD based on peridyno.
TTriangle3D< double > Triangle3D
TPoint3D< double > Point3D