![]() |
Namespaces | |
CardinalSplines | |
Geometry | |
TriangleCapsuleContactCalculation | |
Classes | |
class | BoxShape |
Box shape: box centered on (0 0 0), aligned with the axis with different sizes along X, Y and Z. More... | |
class | CapsuleShape |
Capsule shape: centered on (0, 0, 0), aligned along Y, with length and radius. More... | |
class | clampOperator |
define a custom template unary functor to execute the clamp operation over an Eigen matrix structure. More... | |
class | CompoundShape |
class | CylinderShape |
Cylinder shape: centered on (0 0 0), aligned along Y, defined with length and radius. More... | |
class | DoubleSidedPlaneShape |
DoubleSidedPlaneShape: The XZ plane (d = 0) with normal pointing along positive Y axis. More... | |
struct | gaussQuadraturePoint |
1D Gauss-Legendre quadrature More... | |
struct | gaussQuadratureTrianglePoint |
2D Gauss-Legendre quadrature on a triangle More... | |
class | Interval |
Interval defines the concept of a mathematical interval and provides operations on it including arithmetic operations, construction, and IO. More... | |
class | IntervalND |
IntervalND defines the concept of a group of mathematical intervals and provides operations on them including arithmetic operations, construction, and IO. More... | |
class | IntervalND< T, 3 > |
IntervalND<T,3> defines the concept of a group of mathematical intervals specialized to 3 intervals and provides operations on them including arithmetic operations, construction, and IO. More... | |
class | KalmanFilter |
Implements a linear Kalman filter, a recursive estimator. More... | |
class | LinearMotion |
LinearMotion is (intentionally) a lot like Interval, but it deals with linear motion where all operands start and end their motion simultaneously. More... | |
class | LinearMotionND |
LinearMotionND<T, N> defines the concept of a group of linear motions and provides operations on them including arithmetic operations, construction, and I/O. More... | |
class | LinearMotionND< T, 3 > |
LinearMotionND<T, 3> specializes the LinearMotionND<T, N> class for 3 dimensions. More... | |
class | LinearSolveAndInverse |
LinearSolveAndInverse aims at performing an efficient linear system resolution and calculating its inverse matrix at the same time. More... | |
class | LinearSolveAndInverseDenseMatrix |
Derivation for dense matrix type. More... | |
class | LinearSolveAndInverseDiagonalMatrix |
Derivation for diagonal matrix type. More... | |
class | LinearSolveAndInverseSymmetricTriDiagonalBlockMatrix |
Derivation for symmetric tri-diagonal block matrix type. More... | |
class | LinearSolveAndInverseTriDiagonalBlockMatrix |
Derivation for tri-diagonal block matrix type. More... | |
class | LinearSparseSolveAndInverse |
LinearSparseSolveAndInverse aims at performing an efficient linear system resolution and calculating its inverse matrix at the same time. More... | |
class | LinearSparseSolveAndInverseCG |
Derivation for sparse CG solver. More... | |
class | LinearSparseSolveAndInverseLU |
Derivation for sparse LU solver. More... | |
class | MeshShape |
Mesh shape: shape made of a triangle mesh The triangle mesh needs to be watertight to produce valid volume, center and second moment of volume. More... | |
class | MlcpGaussSeidelSolver |
A solver for mixed LCP problems using the Gauss-Seidel iterative method. More... | |
struct | MlcpProblem |
A description of an MLCP (mixed linear complementarity problem, or mixed LCP) system to be solved. More... | |
struct | MlcpSolution |
The description of a solution to a mixed linear complementarity problem. More... | |
class | MlcpSolver |
This class provides a solver interface for mixed linear complementarity problems. More... | |
class | OctreeShape |
Octree Shape A defined by an octree data structure. More... | |
class | OdeEquation |
Ode equation of 2nd order of the form \(M(x,v).a = F(x, v)\) with \((x0, v0)\) for initial conditions and a set of boundary conditions. More... | |
class | OdeSolver |
Base class for all solvers of ode equation of order 2 of the form \(M(x(t), v(t)).a(t) = f(t, x(t), v(t))\). More... | |
class | OdeSolverEulerExplicit |
Euler Explicit ode solver solves the following \(2^{nd}\) order ode \(M(x(t), v(t)).a(t) = f(t, x(t), v(t))\). More... | |
class | OdeSolverEulerExplicitModified |
Modified Euler Explicit ode solver solves the following \(2^{nd}\) order ode \(M(x(t), v(t)).a(t) = f(t, x(t), v(t))\). More... | |
class | OdeSolverEulerImplicit |
Euler implicit (a.k.a backward Euler) ode solver (see OdeSolverEulerImplicit.dox for more details). More... | |
class | OdeSolverLinearEulerExplicit |
Linear Version of the Euler Explicit ode solver This solver assumes that the system is linear, ie that Mass, Damping, and Stiffness matrices do not change. More... | |
class | OdeSolverLinearEulerExplicitModified |
Linear Version of the Modified Euler Explicit ode solver This solver assumes that the system is linear, ie that Mass, Damping, and Stiffness matrices do not change. More... | |
class | OdeSolverLinearEulerImplicit |
Linear Version of the Euler Implicit ode solver This solver assumes that the system is linear, ie that Mass, Damping, and Stiffness matrices do not change. More... | |
class | OdeSolverLinearRungeKutta4 |
Linear Version of the Runge Kutta 4 ode solver This solver assumes that the system is linear ie that Mass, Damping, and Stiffness matrices do not change. More... | |
class | OdeSolverLinearStatic |
Linear version of the static ode solver This solver assumes that the system is linear, ie that Stiffness matrix does not change. More... | |
class | OdeSolverRungeKutta4 |
Runge Kutta 4 ode solver (See http://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods) solves the following \(2^{nd}\) order ode \(M(x(t), v(t)).a(t) = f(t, x(t), v(t))\). More... | |
class | OdeSolverStatic |
Static ode solver solves the following \(2^{nd}\) order ode \(M(x(t), v(t)).a(t) = f(t, x(t), v(t))\). More... | |
class | OdeState |
The state \(y\) of an ode of 2nd order of the form \(M(x,v).a = F(x, v)\) with boundary conditions. More... | |
class | Operation |
Helper class to run operation a column/row of a matrix to a chunk of memory where the size is dynamically defined. More... | |
class | Operation< DerivedSub, SparseType, Eigen::ColMajor > |
Specialization for column major storage. More... | |
class | Operation< DerivedSub, SparseType, Eigen::RowMajor > |
Specialization for row major storage. More... | |
class | ParticlesShape |
Particles Shape: A shape consisting of a group of particles of equal radius. More... | |
class | PlaneShape |
The XZ plane (d = 0) with normal pointing along positive Y axis. More... | |
class | Polynomial |
Polynomial<T, N> defines the concept of an N degree polynomial with type T coefficients and provides operations on them including arithmetic operations, construction, and IO. More... | |
class | Polynomial< T, 0 > |
Polynomial<T, 0> specializes the Polynomial class for degree 0 (constant polynomials) More... | |
class | Polynomial< T, 1 > |
Polynomial<T, 1> specializes the Polynomial class for degree 1 (linear polynomials) More... | |
class | Polynomial< T, 2 > |
Polynomial<T, 2> specializes the Polynomial class for degree 2 (quadratic polynomials) More... | |
class | Polynomial< T, 3 > |
Polynomial<T, 3> specializes the Polynomial class for degree 3 (cubic polynomials) More... | |
class | PolynomialRoots |
The (algebraic) roots of a Polynomial<N,T>. More... | |
class | PolynomialRoots< T, 1 > |
PolynomialRoots<T, 1> specializes the PolynomialRoots class for degree 1 (linear polynomials) More... | |
class | PolynomialRoots< T, 2 > |
PolynomialRoots<T, 2> specializes the PolynomialRoots class for degree 2 (quadratic polynomials) More... | |
class | PolynomialRootsCommon |
The common base class for PolynomialRoots specializations for various N. More... | |
class | PolynomialValues |
Class to manage polynomial based calculations of interval boundaries. More... | |
class | PolynomialValues< T, 0 > |
PolynomialValues<T, 0> specializes the PolynomialValues class for degree 0 (constant polynomials) More... | |
class | PolynomialValues< T, 1 > |
PolynomialValues<T, 1> specializes the PolynomialValues class for degree 1 (linear polynomials) More... | |
class | PolynomialValues< T, 2 > |
PolynomialValues<T, 2> specializes the PolynomialValues class for degree 2 (quadratic polynomials) More... | |
class | PolynomialValues< T, 3 > |
PolynomialValues<T, 3> specializes the PolynomialValues class for degree 3 (cubic polynomials) More... | |
struct | PosedShape |
PosedShape is a transformed shape with a record of the pose used to transform it. More... | |
struct | PosedShapeMotion |
PosedShapeMotion is embedding the motion of a PosedShape, providing a posed shape at 2 different instant. More... | |
class | SegmentMeshShape |
SegmentMeshShape defines a shape based on a mesh, like MeshShape. More... | |
class | SegmentMeshShapePlyReaderDelegate |
Implementation of ply reader for segment meshes, enable to read the radius from the ply file. More... | |
class | Shape |
Generic rigid shape class defining a shape. More... | |
class | SphereShape |
Sphere shape: sphere centered on (0 0 0), defined with radius. More... | |
class | SurfaceMeshShape |
SurfaceMeshShape defines a shape based on a mesh, like MeshShape. More... | |
class | TriangleHelper |
A helper class for a triangle, used for the following two purposes: More... | |
Typedefs | |
typedef Eigen::AlignedBox< float, 3 > | Aabbf |
Wrapper around the Eigen type. More... | |
typedef Eigen::AlignedBox< double, 3 > | Aabbd |
Wrapper around the Eigen type. More... | |
typedef Eigen::Matrix< float, 2, 2, Eigen::RowMajor > | Matrix22f |
A 2x2 matrix of floats. More... | |
typedef Eigen::Matrix< float, 3, 3, Eigen::RowMajor > | Matrix33f |
A 3x3 matrix of floats. More... | |
typedef Eigen::Matrix< float, 4, 4, Eigen::RowMajor > | Matrix44f |
A 4x4 matrix of floats. More... | |
typedef Eigen::Matrix< double, 2, 2, Eigen::RowMajor > | Matrix22d |
A 2x2 matrix of doubles. More... | |
typedef Eigen::Matrix< double, 3, 3, Eigen::RowMajor > | Matrix33d |
A 3x3 matrix of doubles. More... | |
typedef Eigen::Matrix< double, 4, 4, Eigen::RowMajor > | Matrix44d |
A 4x4 matrix of doubles. More... | |
typedef Eigen::Matrix< double, 6, 6, Eigen::RowMajor > | Matrix66d |
A 6x6 matrix of doubles. More... | |
typedef Eigen::DiagonalMatrix< double, Eigen::Dynamic > | DiagonalMatrix |
A dynamic size diagonal matrix. More... | |
typedef Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > | Matrix |
A dynamic size matrix. More... | |
typedef Eigen::Quaternion< float > | Quaternionf |
A quaternion of floats. More... | |
typedef Eigen::Quaternion< double > | Quaterniond |
A quaternion of doubles. More... | |
typedef Eigen::Transform< float, 2, Eigen::Isometry > | RigidTransform2f |
A 2D rigid (isometric) transform, represented as floats. More... | |
typedef Eigen::Transform< float, 3, Eigen::Isometry > | RigidTransform3f |
A 3D rigid (isometric) transform, represented as floats. More... | |
typedef Eigen::Transform< double, 2, Eigen::Isometry > | RigidTransform2d |
A 2D rigid (isometric) transform, represented as doubles. More... | |
typedef Eigen::Transform< double, 3, Eigen::Isometry > | RigidTransform3d |
A 3D rigid (isometric) transform, represented as doubles. More... | |
typedef Eigen::SparseMatrix< double > | SparseMatrix |
A sparse matrix. More... | |
typedef Eigen::Matrix< float, 2, 1 > | Vector2f |
A 2D vector of floats. More... | |
typedef Eigen::Matrix< float, 3, 1 > | Vector3f |
A 3D vector of floats. More... | |
typedef Eigen::Matrix< float, 4, 1 > | Vector4f |
A 4D vector of floats. More... | |
typedef Eigen::Matrix< float, 6, 1 > | Vector6f |
A 6D vector of floats. More... | |
typedef Eigen::Matrix< double, 2, 1 > | Vector2d |
A 2D vector of doubles. More... | |
typedef Eigen::Matrix< double, 3, 1 > | Vector3d |
A 3D vector of doubles. More... | |
typedef Eigen::Matrix< double, 4, 1 > | Vector4d |
A 4D vector of doubles. More... | |
typedef Eigen::Matrix< double, 6, 1 > | Vector6d |
A 6D matrix of doubles. More... | |
typedef Eigen::Matrix< double, Eigen::Dynamic, 1 > | Vector |
A dynamic size column vector. More... | |
Functions | |
template<class Scalar , int Dim> | |
bool | doAabbIntersect (const Eigen::AlignedBox< Scalar, Dim > &aabb0, const Eigen::AlignedBox< Scalar, Dim > &aabb1, double tolerance) |
Determine whether two AABBs have an intersection with each other, for the calculation see http://www.gamasutra.com/view/feature/131790/simple_intersection_tests_for_games.php?page=3. More... | |
template<class Scalar , int Dim> | |
bool | doAabbIntersect (const Eigen::AlignedBox< Scalar, Dim > &a, const Eigen::AlignedBox< Scalar, Dim > &b) |
Determine whether two AABBs overlap, using a minimal set of eigen calls, does not take a tolerance. More... | |
template<class Scalar , int Dim, int MType> | |
Eigen::AlignedBox< Scalar, Dim > | makeAabb (const Eigen::Matrix< Scalar, Dim, 1, MType > &vector0, const Eigen::Matrix< Scalar, Dim, 1, MType > &vector1, const Eigen::Matrix< Scalar, Dim, 1, MType > &vector2) |
Convenience function for creating a bounding box from three vertices (e.g. More... | |
template<class Scalar , int Dim> | |
Eigen::AlignedBox< Scalar, Dim > | transformAabb (const Eigen::Transform< Scalar, Dim, Eigen::Isometry > &transform, const Eigen::AlignedBox< Scalar, Dim > &aabb) |
Rotate the extrema of the aabb, note that that will extend the size of the box. More... | |
template<class T > | |
int | findRootsInRange01 (const Polynomial< T, 3 > &polynomial, std::array< T, 3 > *roots) |
Find all roots in range \([0 \ldotp\ldotp 1]\) of a cubic equation. More... | |
template<class T , int MOpt> | |
bool | barycentricCoordinates (const Eigen::Matrix< T, 3, 1, MOpt > &pt, const Eigen::Matrix< T, 3, 1, MOpt > &sv0, const Eigen::Matrix< T, 3, 1, MOpt > &sv1, Eigen::Matrix< T, 2, 1, MOpt > *coordinates) |
Calculate the barycentric coordinates of a point with respect to a line segment. More... | |
template<class T , int MOpt> | |
bool | barycentricCoordinates (const Eigen::Matrix< T, 3, 1, MOpt > &pt, const Eigen::Matrix< T, 3, 1, MOpt > &tv0, const Eigen::Matrix< T, 3, 1, MOpt > &tv1, const Eigen::Matrix< T, 3, 1, MOpt > &tv2, const Eigen::Matrix< T, 3, 1, MOpt > &tn, Eigen::Matrix< T, 3, 1, MOpt > *coordinates) |
Calculate the barycentric coordinates of a point with respect to a triangle. More... | |
template<class T , int MOpt> | |
bool | barycentricCoordinates (const Eigen::Matrix< T, 3, 1, MOpt > &pt, const Eigen::Matrix< T, 3, 1, MOpt > &tv0, const Eigen::Matrix< T, 3, 1, MOpt > &tv1, const Eigen::Matrix< T, 3, 1, MOpt > &tv2, Eigen::Matrix< T, 3, 1, MOpt > *coordinates) |
Calculate the barycentric coordinates of a point with respect to a triangle. More... | |
template<class T , int MOpt> | |
bool | isPointInsideTriangle (const Eigen::Matrix< T, 3, 1, MOpt > &pt, const Eigen::Matrix< T, 3, 1, MOpt > &tv0, const Eigen::Matrix< T, 3, 1, MOpt > &tv1, const Eigen::Matrix< T, 3, 1, MOpt > &tv2, const Eigen::Matrix< T, 3, 1, MOpt > &tn) |
Check if a point is inside a triangle. More... | |
template<class T , int MOpt> | |
bool | isPointInsideTriangle (const Eigen::Matrix< T, 3, 1, MOpt > &pt, const Eigen::Matrix< T, 3, 1, MOpt > &tv0, const Eigen::Matrix< T, 3, 1, MOpt > &tv1, const Eigen::Matrix< T, 3, 1, MOpt > &tv2) |
Check if a point is inside a triangle. More... | |
template<class T , int MOpt> | |
bool | isPointOnTriangleEdge (const Eigen::Matrix< T, 3, 1, MOpt > &pt, const Eigen::Matrix< T, 3, 1, MOpt > &tv0, const Eigen::Matrix< T, 3, 1, MOpt > &tv1, const Eigen::Matrix< T, 3, 1, MOpt > &tv2, const Eigen::Matrix< T, 3, 1, MOpt > &tn) |
Check if a point is on the edge of a triangle. More... | |
template<class T , int MOpt> | |
bool | isPointOnTriangleEdge (const Eigen::Matrix< T, 3, 1, MOpt > &pt, const Eigen::Matrix< T, 3, 1, MOpt > &tv0, const Eigen::Matrix< T, 3, 1, MOpt > &tv1, const Eigen::Matrix< T, 3, 1, MOpt > &tv2) |
Check if a point is on the edge of a triangle. More... | |
template<class T , int MOpt> | |
bool | isCoplanar (const Eigen::Matrix< T, 3, 1, MOpt > &a, const Eigen::Matrix< T, 3, 1, MOpt > &b, const Eigen::Matrix< T, 3, 1, MOpt > &c, const Eigen::Matrix< T, 3, 1, MOpt > &d) |
Check whether the points are coplanar. More... | |
template<class T , int MOpt> | |
T | distancePointLine (const Eigen::Matrix< T, 3, 1, MOpt > &pt, const Eigen::Matrix< T, 3, 1, MOpt > &v0, const Eigen::Matrix< T, 3, 1, MOpt > &v1, Eigen::Matrix< T, 3, 1, MOpt > *result) |
Calculate the normal distance between a point and a line. More... | |
template<class T , int MOpt> | |
T | distancePointSegment (const Eigen::Matrix< T, 3, 1, MOpt > &pt, const Eigen::Matrix< T, 3, 1, MOpt > &sv0, const Eigen::Matrix< T, 3, 1, MOpt > &sv1, Eigen::Matrix< T, 3, 1, MOpt > *result) |
Point segment distance, if the projection of the closest point is not within the segments, the closest segment point is used for the distance calculation. More... | |
template<class T , int MOpt> | |
T | distanceLineLine (const Eigen::Matrix< T, 3, 1, MOpt > &l0v0, const Eigen::Matrix< T, 3, 1, MOpt > &l0v1, const Eigen::Matrix< T, 3, 1, MOpt > &l1v0, const Eigen::Matrix< T, 3, 1, MOpt > &l1v1, Eigen::Matrix< T, 3, 1, MOpt > *pt0, Eigen::Matrix< T, 3, 1, MOpt > *pt1) |
Determine the distance between two lines. More... | |
template<class T , int MOpt> | |
T | distanceSegmentSegment (const Eigen::Matrix< T, 3, 1, MOpt > &s0v0, const Eigen::Matrix< T, 3, 1, MOpt > &s0v1, const Eigen::Matrix< T, 3, 1, MOpt > &s1v0, const Eigen::Matrix< T, 3, 1, MOpt > &s1v1, Eigen::Matrix< T, 3, 1, MOpt > *pt0, Eigen::Matrix< T, 3, 1, MOpt > *pt1, T *s0t=nullptr, T *s1t=nullptr) |
Distance between two segments, if the project of the closest point is not on the opposing segment, the segment endpoints will be used for the distance calculation. More... | |
template<class T , int MOpt> | |
T | distancePointTriangle (const Eigen::Matrix< T, 3, 1, MOpt > &pt, const Eigen::Matrix< T, 3, 1, MOpt > &tv0, const Eigen::Matrix< T, 3, 1, MOpt > &tv1, const Eigen::Matrix< T, 3, 1, MOpt > &tv2, Eigen::Matrix< T, 3, 1, MOpt > *result) |
Calculate the normal distance of a point from a triangle, the resulting point will be on the edge of the triangle if the projection of the point is not inside the triangle. More... | |
template<class T , int MOpt> | |
bool | doesCollideSegmentTriangle (const Eigen::Matrix< T, 3, 1, MOpt > &sv0, const Eigen::Matrix< T, 3, 1, MOpt > &sv1, const Eigen::Matrix< T, 3, 1, MOpt > &tv0, const Eigen::Matrix< T, 3, 1, MOpt > &tv1, const Eigen::Matrix< T, 3, 1, MOpt > &tv2, const Eigen::Matrix< T, 3, 1, MOpt > &tn, Eigen::Matrix< T, 3, 1, MOpt > *result) |
Calculate the intersection of a line segment with a triangle See http://geomalgorithms.com/a06-_intersect-2.html#intersect_RayTriangle for the algorithm. More... | |
template<class T , int MOpt> | |
T | distancePointPlane (const Eigen::Matrix< T, 3, 1, MOpt > &pt, const Eigen::Matrix< T, 3, 1, MOpt > &n, T d, Eigen::Matrix< T, 3, 1, MOpt > *result) |
Calculate the distance of a point to a plane. More... | |
template<class T , int MOpt> | |
T | distanceSegmentPlane (const Eigen::Matrix< T, 3, 1, MOpt > &sv0, const Eigen::Matrix< T, 3, 1, MOpt > &sv1, const Eigen::Matrix< T, 3, 1, MOpt > &n, T d, Eigen::Matrix< T, 3, 1, MOpt > *closestPointSegment, Eigen::Matrix< T, 3, 1, MOpt > *planeIntersectionPoint) |
Calculate the distance between a segment and a plane. More... | |
template<class T , int MOpt> | |
T | distanceTrianglePlane (const Eigen::Matrix< T, 3, 1, MOpt > &tv0, const Eigen::Matrix< T, 3, 1, MOpt > &tv1, const Eigen::Matrix< T, 3, 1, MOpt > &tv2, const Eigen::Matrix< T, 3, 1, MOpt > &n, T d, Eigen::Matrix< T, 3, 1, MOpt > *closestPointTriangle, Eigen::Matrix< T, 3, 1, MOpt > *planeProjectionPoint) |
Calculate the distance of a triangle to a plane. More... | |
template<class T , int MOpt> | |
bool | doesIntersectPlanePlane (const Eigen::Matrix< T, 3, 1, MOpt > &pn0, T pd0, const Eigen::Matrix< T, 3, 1, MOpt > &pn1, T pd1, Eigen::Matrix< T, 3, 1, MOpt > *pt0, Eigen::Matrix< T, 3, 1, MOpt > *pt1) |
Test if two planes are intersecting, if yes also calculate the intersection line. More... | |
template<class T , int MOpt> | |
T | distanceSegmentTriangle (const Eigen::Matrix< T, 3, 1, MOpt > &sv0, const Eigen::Matrix< T, 3, 1, MOpt > &sv1, const Eigen::Matrix< T, 3, 1, MOpt > &tv0, const Eigen::Matrix< T, 3, 1, MOpt > &tv1, const Eigen::Matrix< T, 3, 1, MOpt > &tv2, Eigen::Matrix< T, 3, 1, MOpt > *segmentPoint, Eigen::Matrix< T, 3, 1, MOpt > *trianglePoint) |
Calculate the distance of a line segment to a triangle. More... | |
template<class T , int MOpt> | |
T | distanceSegmentTriangle (const Eigen::Matrix< T, 3, 1, MOpt > &sv0, const Eigen::Matrix< T, 3, 1, MOpt > &sv1, const Eigen::Matrix< T, 3, 1, MOpt > &tv0, const Eigen::Matrix< T, 3, 1, MOpt > &tv1, const Eigen::Matrix< T, 3, 1, MOpt > &tv2, const Eigen::Matrix< T, 3, 1, MOpt > &normal, Eigen::Matrix< T, 3, 1, MOpt > *segmentPoint, Eigen::Matrix< T, 3, 1, MOpt > *trianglePoint) |
Calculate the distance of a line segment to a triangle. More... | |
template<class T , int MOpt> | |
T | distanceTriangleTriangle (const Eigen::Matrix< T, 3, 1, MOpt > &t0v0, const Eigen::Matrix< T, 3, 1, MOpt > &t0v1, const Eigen::Matrix< T, 3, 1, MOpt > &t0v2, const Eigen::Matrix< T, 3, 1, MOpt > &t1v0, const Eigen::Matrix< T, 3, 1, MOpt > &t1v1, const Eigen::Matrix< T, 3, 1, MOpt > &t1v2, Eigen::Matrix< T, 3, 1, MOpt > *closestPoint0, Eigen::Matrix< T, 3, 1, MOpt > *closestPoint1) |
Calculate the distance between two triangles. More... | |
template<class T , int MOpt> | |
void | intersectionsSegmentBox (const Eigen::Matrix< T, 3, 1, MOpt > &sv0, const Eigen::Matrix< T, 3, 1, MOpt > &sv1, const Eigen::AlignedBox< T, 3 > &box, std::vector< Eigen::Matrix< T, 3, 1, MOpt >> *intersections) |
Calculate the intersections between a line segment and an axis aligned box. More... | |
template<class T , int MOpt> | |
bool | doesIntersectBoxCapsule (const Eigen::Matrix< T, 3, 1, MOpt > &capsuleBottom, const Eigen::Matrix< T, 3, 1, MOpt > &capsuleTop, const T capsuleRadius, const Eigen::AlignedBox< T, 3 > &box) |
Test if an axis aligned box intersects with a capsule. More... | |
template<class T , int VOpt> | |
Eigen::Matrix< T, 3, 1, VOpt > | nearestPointOnLine (const Eigen::Matrix< T, 3, 1, VOpt > &point, const Eigen::Matrix< T, 3, 1, VOpt > &segment0, const Eigen::Matrix< T, 3, 1, VOpt > &segment1) |
Helper method to determine the nearest point between a point and a line. More... | |
template<class T , int MOpt> | |
bool | doesIntersectTriangleTriangle (const Eigen::Matrix< T, 3, 1, MOpt > &t0v0, const Eigen::Matrix< T, 3, 1, MOpt > &t0v1, const Eigen::Matrix< T, 3, 1, MOpt > &t0v2, const Eigen::Matrix< T, 3, 1, MOpt > &t1v0, const Eigen::Matrix< T, 3, 1, MOpt > &t1v1, const Eigen::Matrix< T, 3, 1, MOpt > &t1v2, const Eigen::Matrix< T, 3, 1, MOpt > &t0n, const Eigen::Matrix< T, 3, 1, MOpt > &t1n) |
Check if the two triangles intersect using separating axis test. More... | |
template<class T , int MOpt> | |
bool | doesIntersectTriangleTriangle (const Eigen::Matrix< T, 3, 1, MOpt > &t0v0, const Eigen::Matrix< T, 3, 1, MOpt > &t0v1, const Eigen::Matrix< T, 3, 1, MOpt > &t0v2, const Eigen::Matrix< T, 3, 1, MOpt > &t1v0, const Eigen::Matrix< T, 3, 1, MOpt > &t1v1, const Eigen::Matrix< T, 3, 1, MOpt > &t1v2) |
Check if the two triangles intersect using separating axis test. More... | |
template<class T , int MOpt> | |
bool | calculateContactTriangleTriangle (const Eigen::Matrix< T, 3, 1, MOpt > &t0v0, const Eigen::Matrix< T, 3, 1, MOpt > &t0v1, const Eigen::Matrix< T, 3, 1, MOpt > &t0v2, const Eigen::Matrix< T, 3, 1, MOpt > &t1v0, const Eigen::Matrix< T, 3, 1, MOpt > &t1v1, const Eigen::Matrix< T, 3, 1, MOpt > &t1v2, const Eigen::Matrix< T, 3, 1, MOpt > &t0n, const Eigen::Matrix< T, 3, 1, MOpt > &t1n, T *penetrationDepth, Eigen::Matrix< T, 3, 1, MOpt > *penetrationPoint0, Eigen::Matrix< T, 3, 1, MOpt > *penetrationPoint1, Eigen::Matrix< T, 3, 1, MOpt > *contactNormal) |
Calculate the contact between two triangles. More... | |
template<class T , int MOpt> | |
bool | calculateContactTriangleTriangle (const Eigen::Matrix< T, 3, 1, MOpt > &t0v0, const Eigen::Matrix< T, 3, 1, MOpt > &t0v1, const Eigen::Matrix< T, 3, 1, MOpt > &t0v2, const Eigen::Matrix< T, 3, 1, MOpt > &t1v0, const Eigen::Matrix< T, 3, 1, MOpt > &t1v1, const Eigen::Matrix< T, 3, 1, MOpt > &t1v2, T *penetrationDepth, Eigen::Matrix< T, 3, 1, MOpt > *penetrationPoint0, Eigen::Matrix< T, 3, 1, MOpt > *penetrationPoint1, Eigen::Matrix< T, 3, 1, MOpt > *contactNormal) |
Calculate the contact between two triangles. More... | |
template<class T , int MOpt> | |
bool | calculateContactTriangleTriangleSeparatingAxis (const Eigen::Matrix< T, 3, 1, MOpt > &t0v0, const Eigen::Matrix< T, 3, 1, MOpt > &t0v1, const Eigen::Matrix< T, 3, 1, MOpt > &t0v2, const Eigen::Matrix< T, 3, 1, MOpt > &t1v0, const Eigen::Matrix< T, 3, 1, MOpt > &t1v1, const Eigen::Matrix< T, 3, 1, MOpt > &t1v2, const Eigen::Matrix< T, 3, 1, MOpt > &t0n, const Eigen::Matrix< T, 3, 1, MOpt > &t1n, T *penetrationDepth, Eigen::Matrix< T, 3, 1, MOpt > *penetrationPoint0, Eigen::Matrix< T, 3, 1, MOpt > *penetrationPoint1, Eigen::Matrix< T, 3, 1, MOpt > *contactNormal) |
Calculate the contact between two triangles. More... | |
template<class T , int MOpt> | |
bool | calculateContactTriangleTriangleSeparatingAxis (const Eigen::Matrix< T, 3, 1, MOpt > &t0v0, const Eigen::Matrix< T, 3, 1, MOpt > &t0v1, const Eigen::Matrix< T, 3, 1, MOpt > &t0v2, const Eigen::Matrix< T, 3, 1, MOpt > &t1v0, const Eigen::Matrix< T, 3, 1, MOpt > &t1v1, const Eigen::Matrix< T, 3, 1, MOpt > &t1v2, T *penetrationDepth, Eigen::Matrix< T, 3, 1, MOpt > *penetrationPoint0, Eigen::Matrix< T, 3, 1, MOpt > *penetrationPoint1, Eigen::Matrix< T, 3, 1, MOpt > *contactNormal) |
Calculate the contact between two triangles. More... | |
template<class T , int MOpt> | |
bool | calculateContactTriangleCapsule (const Eigen::Matrix< T, 3, 1, MOpt > &tv0, const Eigen::Matrix< T, 3, 1, MOpt > &tv1, const Eigen::Matrix< T, 3, 1, MOpt > &tv2, const Eigen::Matrix< T, 3, 1, MOpt > &tn, const Eigen::Matrix< T, 3, 1, MOpt > &cv0, const Eigen::Matrix< T, 3, 1, MOpt > &cv1, double cr, T *penetrationDepth, Eigen::Matrix< T, 3, 1, MOpt > *penetrationPointTriangle, Eigen::Matrix< T, 3, 1, MOpt > *penetrationPointCapsule, Eigen::Matrix< T, 3, 1, MOpt > *contactNormal, Eigen::Matrix< T, 3, 1, MOpt > *penetrationPointCapsuleAxis) |
Calculate the contact between a capsule and a triangle. More... | |
template<class T , int MOpt> | |
bool | calculateContactTriangleCapsule (const Eigen::Matrix< T, 3, 1, MOpt > &tv0, const Eigen::Matrix< T, 3, 1, MOpt > &tv1, const Eigen::Matrix< T, 3, 1, MOpt > &tv2, const Eigen::Matrix< T, 3, 1, MOpt > &cv0, const Eigen::Matrix< T, 3, 1, MOpt > &cv1, double cr, T *penetrationDepth, Eigen::Matrix< T, 3, 1, MOpt > *penetrationPointTriangle, Eigen::Matrix< T, 3, 1, MOpt > *penetrationPointCapsule, Eigen::Matrix< T, 3, 1, MOpt > *contactNormal, Eigen::Matrix< T, 3, 1, MOpt > *penetrationPointCapsuleAxis) |
Calculate the contact between a capsule and a triangle. More... | |
template<class T , int MOpt> | |
int | timesOfCoplanarityInRange01 (const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> &A, const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> &B, const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> &C, const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> &D, std::array< T, 3 > *timesOfCoplanarity) |
Test when 4 points are coplanar in the range [0..1] given their linear motion. More... | |
template<typename T > | |
Interval< T > | operator+ (T v, const Interval< T > &i) |
template<typename T > | |
Interval< T > | operator* (T v, const Interval< T > &i) |
template<class T > | |
void | IntervalArithmetic_add (const Interval< T > &a, const Interval< T > &b, Interval< T > *res) |
template<class T > | |
void | IntervalArithmetic_addadd (const Interval< T > &a, const Interval< T > &b, Interval< T > *res) |
template<class T > | |
void | IntervalArithmetic_sub (const Interval< T > &a, const Interval< T > &b, Interval< T > *res) |
template<class T > | |
void | IntervalArithmetic_addsub (const Interval< T > &a, const Interval< T > &b, Interval< T > *res) |
template<class T > | |
void | IntervalArithmetic_mul (const Interval< T > &a, const Interval< T > &b, Interval< T > *res) |
template<class T > | |
void | IntervalArithmetic_addmul (const Interval< T > &a, const Interval< T > &b, Interval< T > *res) |
template<class T > | |
void | IntervalArithmetic_submul (const Interval< T > &a, const Interval< T > &b, Interval< T > *res) |
template<typename T > | |
std::ostream & | operator<< (std::ostream &o, const Interval< T > &interval) |
Write a textual version of the interval to an output stream. More... | |
template<typename T , int N> | |
std::ostream & | operator<< (std::ostream &o, const IntervalND< T, N > &interval) |
Write a textual version of an interval group to an output stream. More... | |
template<class T > | |
void | IntervalArithmetic_add (const IntervalND< T, 3 > &a, const IntervalND< T, 3 > &b, IntervalND< T, 3 > *res) |
template<class T > | |
void | IntervalArithmetic_sub (const IntervalND< T, 3 > &a, const IntervalND< T, 3 > &b, IntervalND< T, 3 > *res) |
template<class T > | |
void | IntervalArithmetic_crossProduct (const IntervalND< T, 3 > &a, const IntervalND< T, 3 > &b, IntervalND< T, 3 > *res) |
template<class T > | |
void | IntervalArithmetic_dotProduct (const IntervalND< T, 3 > &a, const IntervalND< T, 3 > &b, Interval< T > *res) |
template<class P > | |
void | IntervalArithmetic_add (const Interval< P > &a, const Interval< P > &b, Interval< P > *res) |
Calculate the sum of two intervals. More... | |
template<class P > | |
void | IntervalArithmetic_addadd (const Interval< P > &a, const Interval< P > &b, Interval< P > *res) |
Calculate the sum of three intervals res + a + b. More... | |
template<class P > | |
void | IntervalArithmetic_sub (const Interval< P > &a, const Interval< P > &b, Interval< P > *res) |
Calculate the difference of two intervals. More... | |
template<class P > | |
void | IntervalArithmetic_addsub (const Interval< P > &a, const Interval< P > &b, Interval< P > *res) |
Add the difference of two intervals to an existing value. More... | |
template<class P > | |
void | IntervalArithmetic_mul (const Interval< P > &a, const Interval< P > &b, Interval< P > *res) |
Calculate the product of two intervals. More... | |
template<class P > | |
void | IntervalArithmetic_addmul (const Interval< P > &a, const Interval< P > &b, Interval< P > *res) |
Add the product of two intervals to an existing value. More... | |
template<class P > | |
void | IntervalArithmetic_submul (const Interval< P > &a, const Interval< P > &b, Interval< P > *res) |
Subtract the product of two intervals from an existing value. More... | |
template<class P > | |
void | IntervalArithmetic_add (const IntervalND< P, 3 > &a, const IntervalND< P, 3 > &b, IntervalND< P, 3 > *res) |
Calculate the sum of two interval groups. More... | |
template<class P > | |
void | IntervalArithmetic_sub (const IntervalND< P, 3 > &a, const IntervalND< P, 3 > &b, IntervalND< P, 3 > *res) |
Calculate the difference of two interval groups. More... | |
template<class P > | |
void | IntervalArithmetic_dotProduct (const IntervalND< P, 3 > &a, const IntervalND< P, 3 > &b, Interval< P > *res) |
Calculate the dot product of two interval groups. More... | |
template<class P > | |
void | IntervalArithmetic_crossProduct (const IntervalND< P, 3 > &a, const IntervalND< P, 3 > &b, IntervalND< P, 3 > *res) |
Calculate the cross product of two interval groups. More... | |
template<typename T > | |
std::ostream & | operator<< (std::ostream &o, const LinearMotion< T > &motion) |
Write a textual version of a linear motion to an output stream. More... | |
template<typename T , int N> | |
std::ostream & | operator<< (std::ostream &o, const LinearMotionND< T, N > &motion) |
Write a textual version of a linear motion group to an output stream. More... | |
template<typename T > | |
Polynomial< T, 2 > | analyticDotProduct (const LinearMotionND< T, 3 > &a, const LinearMotionND< T, 3 > &b) |
Calculate an analytic dot product as a Polynomial. More... | |
template<typename T , int A> | |
Polynomial< T, 2 > | analyticCrossProductAxis (const LinearMotionND< T, 3 > &a, const LinearMotionND< T, 3 > &b) |
Calculate a single axis of an analytic cross product as a Polynomial. More... | |
template<typename T > | |
Polynomial< T, 2 > | analyticCrossProductXAxis (const LinearMotionND< T, 3 > &a, const LinearMotionND< T, 3 > &b) |
Calculate the X axis of an analytic cross product as a Polynomial. More... | |
template<typename T > | |
Polynomial< T, 2 > | analyticCrossProductYAxis (const LinearMotionND< T, 3 > &a, const LinearMotionND< T, 3 > &b) |
Calculate the Y axis of an analytic cross product as a Polynomial. More... | |
template<typename T > | |
Polynomial< T, 2 > | analyticCrossProductZAxis (const LinearMotionND< T, 3 > &a, const LinearMotionND< T, 3 > &b) |
Calculate the Z axis of an analytic cross product as a Polynomial. More... | |
template<typename T > | |
void | analyticCrossProduct (const LinearMotionND< T, 3 > &a, const LinearMotionND< T, 3 > &b, Polynomial< T, 2 > *resultXAxis, Polynomial< T, 2 > *resultYAxis, Polynomial< T, 2 > *resultZAxis) |
Calculate an analytic cross product as a Polynomial. More... | |
template<typename T > | |
Polynomial< T, 3 > | analyticTripleProduct (const LinearMotionND< T, 3 > &a, const LinearMotionND< T, 3 > &b, const LinearMotionND< T, 3 > &c) |
Calculate an analytic cross product as a Polynomial, as a polynomial whose value for t=0..1 is the value of the triple product. More... | |
template<typename T > | |
Polynomial< T, 2 > | analyticMagnitudeSquared (const LinearMotionND< T, 3 > &motion) |
Calculate the magnitude squared of a linear motion 3 group as a polynomial. More... | |
template<class T > | |
Interval< T > | tripleProduct (const LinearMotionND< T, 3 > &a, const LinearMotionND< T, 3 > &b, const LinearMotionND< T, 3 > &c, const Interval< T > &range) |
Calculate the triple product, as an interval. More... | |
template<typename T , int VOpt> | |
Eigen::Matrix< T, 3, 3 > | makeRotationMatrix (const T &angle, const Eigen::Matrix< T, 3, 1, VOpt > &axis) |
Create a rotation matrix corresponding to the specified angle (in radians) and axis. More... | |
template<typename T , int VOpt> | |
Eigen::Matrix< T, 3, 3 > | makeSkewSymmetricMatrix (const Eigen::Matrix< T, 3, 1, VOpt > &vector) |
Create a skew-symmetric matrix corresponding to the specified vector. More... | |
template<typename T , int MOpt> | |
Eigen::Matrix< T, 3, 1 > | skew (const Eigen::Matrix< T, 3, 3, MOpt > &matrix) |
Extract the unique vector from the skew-symmetric part of a given matrix. More... | |
template<typename T , int MOpt, int VOpt> | |
void | computeAngleAndAxis (const Eigen::Matrix< T, 3, 3, MOpt > &matrix, T *angle, Eigen::Matrix< T, 3, 1, VOpt > *axis) |
Get the angle (in radians) and axis corresponding to a rotation matrix. More... | |
template<typename T , int MOpt> | |
T | computeAngle (const Eigen::Matrix< T, 3, 3, MOpt > &matrix) |
Get the angle corresponding to a quaternion's rotation, in radians. More... | |
template<class Matrix , class SubMatrix > | |
void | addSubMatrix (const SubMatrix &subMatrix, size_t blockIdRow, size_t blockIdCol, size_t blockSizeRow, size_t blockSizeCol, Matrix *matrix) |
Helper method to add a sub-matrix into a matrix, for the sake of clarity. More... | |
template<class Matrix , class SubMatrix > | |
void | addSubMatrix (const SubMatrix &subMatrix, const std::vector< size_t > blockIds, size_t blockSize, Matrix *matrix) |
Helper method to add a sub-matrix made of squared-blocks into a matrix, for the sake of clarity. More... | |
template<class Matrix , class SubMatrix > | |
void | setSubMatrix (const SubMatrix &subMatrix, size_t blockIdRow, size_t blockIdCol, size_t blockSizeRow, size_t blockSizeCol, Matrix *matrix) |
Helper method to set a sub-matrix into a matrix, for the sake of clarity. More... | |
template<class Matrix > | |
Eigen::Block< Matrix > | getSubMatrix (Matrix &matrix, size_t blockIdRow, size_t blockIdCol, size_t blockSizeRow, size_t blockSizeCol) |
Helper method to access a sub-matrix from a matrix, for the sake of clarity. More... | |
template<class Derived > | |
void | zeroRow (size_t row, Eigen::DenseBase< Derived > *matrix) |
Helper method to zero a row of a matrix. More... | |
template<class Derived > | |
void | zeroColumn (size_t column, Eigen::DenseBase< Derived > *matrix) |
Helper method to zero a column of a matrix. More... | |
template<class T > | |
void | minMax (const T &a1, const T &a2, T *minVal, T *maxVal) |
Calculate the minimum and maximum of two values. More... | |
template<class T > | |
void | minMax (const T &a1, const T &a2, const T &a3, T *minVal, T *maxVal) |
Calculate the minimum and maximum of three values. More... | |
template<class T > | |
void | minMax (const T &a1, const T &a2, const T &a3, const T &a4, T *minVal, T *maxVal) |
Calculate the minimum and maximum of four values. More... | |
template<class T > | |
void | minMax (const T &a1, const T &a2, const T &a3, const T &a4, const T &a5, T *minVal, T *maxVal) |
Calculate the minimum and maximum of five values. More... | |
template<class T > | |
void | minMax (const T *values, int numValues, T *minVal, T *maxVal) |
Calculate the minimum and maximum of numValues values. More... | |
std::string | getMlcpConstraintTypeName (MlcpConstraintType constraintType) |
MlcpConstraintType | getMlcpConstraintTypeValue (const std::string &typeName) |
template<class T , int MOpt> | |
bool | isPointInsideTriangle (T time, const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> &P, const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> &A, const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> &B, const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> &C, Eigen::Matrix< T, 3, 1, MOpt > *barycentricCoordinates) |
Check if a point belongs to a triangle at a given time of their motion. More... | |
template<class T , int MOpt> | |
bool | calculateCcdContactPointTriangle (const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> &P, const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> &A, const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> &B, const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> &C, T *timeOfImpact, T *tv01Param, T *tv02Param) |
Continuous collision detection between a point P and a triangle ABC. More... | |
template<typename T > | |
bool | isNearZero (const T &value, const T &epsilon=static_cast< T >(polynomial_epsilon)) |
Define an utility function for comparing individual coefficients to 0. More... | |
template<typename T , int N, int M> | |
Polynomial< T, N+M > | operator* (const Polynomial< T, N > &p, const Polynomial< T, M > &q) |
Multiply two polynomials of arbitrary degree. More... | |
template<typename T > | |
Polynomial< T, 2 > | operator* (const Polynomial< T, 1 > &p, const Polynomial< T, 1 > &q) |
Multiply two polynomials of degree 1. More... | |
template<typename T > | |
Polynomial< T, 3 > | operator* (const Polynomial< T, 2 > &p, const Polynomial< T, 1 > &q) |
Multiply two polynomials of degree 2 and 1 respectively. More... | |
template<typename T > | |
Polynomial< T, 3 > | operator* (const Polynomial< T, 1 > &p, const Polynomial< T, 2 > &q) |
Multiply two polynomials of degree 1 and 2 respectively. More... | |
template<typename T > | |
Polynomial< T, 0 > | square (const Polynomial< T, 0 > &p) |
Square a degree 0 polynomial. More... | |
template<typename T > | |
Polynomial< T, 2 > | square (const Polynomial< T, 1 > &p) |
Square a degree 1 polynomial. More... | |
template<typename T , int N> | |
std::ostream & | operator<< (std::ostream &stream, const Polynomial< T, N > &p) |
Write a textual version of a Polynomial to an output stream. More... | |
template<typename T , int N> | |
void | solve (const T &a, const T &b, const T &epsilon, int *numRoots, std::array< T, N > *roots) |
Specialized solve routine for linear polynomials (2 coefficients) More... | |
template<typename T , int N> | |
void | solve (const T &a, const T &b, const T &c, const T &epsilon, int *numRoots, std::array< T, N > *roots) |
Specialized solve routine for quadratic polynomials (3 coefficients) More... | |
template<class T , int N> | |
Interval< T > | valuesOverInterval (const Polynomial< T, N > &p, const Interval< T > &interval) |
Calculate the minimum and maximum values of the dependent variable over a specified range of the independent variable. More... | |
template<typename T , int VOpt> | |
Eigen::Quaternion< T > | makeRotationQuaternion (const T &angle, const Eigen::Matrix< T, 3, 1, VOpt > &axis) |
Create a quaternion rotation corresponding to the specified angle (in radians) and axis. More... | |
template<typename T , int QOpt> | |
Eigen::Quaternion< T, QOpt > | negate (const Eigen::Quaternion< T, QOpt > &q) |
Quaternion negation (i.e. More... | |
template<typename T , int QOpt, int VOpt> | |
void | computeAngleAndAxis (const Eigen::Quaternion< T, QOpt > &quaternion, T *angle, Eigen::Matrix< T, 3, 1, VOpt > *axis) |
Get the angle (in radians) and axis corresponding to a quaternion's rotation. More... | |
template<typename T , int QOpt> | |
T | computeAngle (const Eigen::Quaternion< T, QOpt > &quaternion) |
Get the angle corresponding to a quaternion's rotation, in radians. More... | |
template<typename T , int TOpt, int VOpt> | |
void | computeRotationVector (const Eigen::Transform< T, 3, Eigen::Isometry, TOpt > &end, const Eigen::Transform< T, 3, Eigen::Isometry, TOpt > &start, Eigen::Matrix< T, 3, 1, VOpt > *rotationVector) |
Get the vector corresponding to the rotation between transforms. More... | |
template<typename T , int QOpt> | |
Eigen::Quaternion< T, QOpt > | interpolate (const Eigen::Quaternion< T, QOpt > &q0, const Eigen::Quaternion< T, QOpt > &q1, T t) |
Interpolate (slerp) between 2 quaternions. More... | |
template<typename M , typename V > | |
Eigen::Transform< typename M::Scalar, M::RowsAtCompileTime, Eigen::Isometry > | makeRigidTransform (const Eigen::MatrixBase< M > &rotation, const Eigen::MatrixBase< V > &translation) |
Create a rigid transform using the specified rotation matrix and translation. More... | |
template<typename Q , typename V > | |
Eigen::Transform< typename Q::Scalar, 3, Eigen::Isometry > | makeRigidTransform (const Eigen::QuaternionBase< Q > &rotation, const Eigen::MatrixBase< V > &translation) |
Create a rigid transform using the specified rotation quaternion and translation. More... | |
template<typename T , int VOpt> | |
Eigen::Transform< T, 3, Eigen::Isometry > | makeRigidTransform (const Eigen::Matrix< T, 3, 1, VOpt > &position, const Eigen::Matrix< T, 3, 1, VOpt > ¢er, const Eigen::Matrix< T, 3, 1, VOpt > &up) |
Make a rigid transform from a eye point a center view point and an up direction, does not check whether up is colinear with eye-center The original formula can be found at http://www.opengl.org/sdk/docs/man2/xhtml/gluLookAt.xml. More... | |
template<typename V > | |
Eigen::Transform< typename V::Scalar, V::SizeAtCompileTime, Eigen::Isometry > | makeRigidTranslation (const Eigen::MatrixBase< V > &translation) |
Create a rigid transform using the identity rotation and the specified translation. More... | |
template<typename T , int TOpt> | |
Eigen::Transform< T, 3, Eigen::Isometry > | interpolate (const Eigen::Transform< T, 3, Eigen::Isometry, TOpt > &t0, const Eigen::Transform< T, 3, Eigen::Isometry, TOpt > &t1, T t) |
Interpolate (slerp) between 2 rigid transformations. More... | |
template<class T > | |
T | clamp (T value, T min, T max, T epsilon) |
Clamp any values within an epsilon window to a maximum or minimum value. More... | |
template<class T , int MOpt> | |
bool | areSegmentsIntersecting (T time, const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> &A, const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> &B, const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> &C, const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> &D, Eigen::Matrix< T, 2, 1, MOpt > *barycentricCoordinates) |
Check if 2 segments intersect at a given time of their motion. More... | |
template<class T , int MOpt> | |
bool | calculateCcdContactSegmentSegment (const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> &A, const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> &B, const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> &C, const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> &D, T *timeOfImpact, T *s0p1Factor, T *s1p1Factor) |
Continuous collision detection between two segments AB and CD. More... | |
template<int Opt, typename Index > | |
void | blockWithSearch (const Eigen::Ref< const Matrix > &subMatrix, size_t rowStart, size_t columnStart, size_t n, size_t m, Eigen::SparseMatrix< double, Opt, Index > *matrix, void(Operation< Matrix, Eigen::SparseMatrix< double, Opt, Index >>::*op)(double *, size_t, size_t, size_t, const Matrix &, size_t)) |
Runs a given operation on a SparseMatrix block(i, j, n, m) from a (n x m) 'subMatrix' with searching for the block 1st element. More... | |
template<int Opt, typename Index > | |
void | blockOperation (const Eigen::Ref< const Matrix > &subMatrix, size_t rowStart, size_t columnStart, Eigen::SparseMatrix< double, Opt, Index > *matrix, void(Operation< Matrix, Eigen::SparseMatrix< double, Opt, Index >>::*op)(double *, const double &)) |
Runs a given operation on a SparseMatrix block(i, j, n, m) from a (n x m) 'subMatrix' with searching for the block 1st element. More... | |
template<int Opt, typename Index > | |
void | addSubMatrix (const Eigen::Ref< const Matrix > &subMatrix, size_t blockIdRow, size_t blockIdCol, Eigen::SparseMatrix< double, Opt, Index > *matrix, bool initialize=true) |
Helper method to add a sub-matrix into a matrix, for the sake of clarity. More... | |
template<int Opt, typename Index > | |
void | assignSubMatrix (const Eigen::Ref< const Matrix > &subMatrix, size_t blockIdRow, size_t blockIdCol, Eigen::SparseMatrix< double, Opt, Index > *matrix, bool initialize=true) |
Helper method to assign a sub-matrix into a matrix, for the sake of clarity. More... | |
template<typename T , int Opt, typename Index > | |
void | zeroRow (size_t row, Eigen::SparseMatrix< T, Opt, Index > *matrix) |
Helper method to zero a row of a matrix specialized for Sparse Matrices. More... | |
template<typename T , int Opt, typename Index > | |
void | zeroColumn (size_t column, Eigen::SparseMatrix< T, Opt, Index > *matrix) |
Helper method to zero a column of a matrix specialized for Sparse Matrices. More... | |
template<typename T , int Opt, typename Index > | |
void | clearMatrix (Eigen::SparseMatrix< T, Opt, Index > *matrix) |
Helper method to zero all entries of a matrix specialized for Sparse Matrices. More... | |
template<class T > | |
void | edgeIntersection (T dStart, T dEnd, T pvStart, T pvEnd, T *parametricIntersection, size_t *parametricIntersectionIndex) |
Two ends of the triangle edge are given in terms of the following vertex properties. More... | |
bool | isValid (float value) |
Check if a float value is valid. More... | |
bool | isValid (double value) |
Check if a double value is valid. More... | |
template<typename T > | |
bool | isValid (const Eigen::DenseBase< T > &value) |
Check if a matrix or a vector is valid. More... | |
template<typename T > | |
bool | isValid (const Eigen::QuaternionBase< T > &value) |
Check if a quaternion is valid. More... | |
template<typename T > | |
bool | isValid (const Eigen::AngleAxis< T > &value) |
Check if an angle/axis 3D rotation is valid. More... | |
template<typename T > | |
bool | isValid (const Eigen::Rotation2D< T > &value) |
Check if a 2D rotation is valid. More... | |
template<typename T , int D, int M, int O> | |
bool | isValid (const Eigen::Transform< T, D, M, O > &value) |
Check if a transform is valid. More... | |
bool | isSubnormal (float value) |
Check if a float value is subnormal. More... | |
bool | isSubnormal (double value) |
Check if a double value is subnormal. More... | |
template<typename T > | |
bool | isSubnormal (const Eigen::DenseBase< T > &value) |
Check if a matrix or a vector contains any subnormal floating-point values. More... | |
template<typename T > | |
bool | isSubnormal (const Eigen::QuaternionBase< T > &value) |
Check if a quaternion contains any subnormal floating-point values. More... | |
template<typename T > | |
bool | isSubnormal (const Eigen::AngleAxis< T > &value) |
Check if an angle/axis 3D rotation contains any subnormal floating-point values. More... | |
template<typename T > | |
bool | isSubnormal (const Eigen::Rotation2D< T > &value) |
Check if a 2D rotation is described by an angle that is subnormal. More... | |
template<typename T , int D, int M, int O> | |
bool | isSubnormal (const Eigen::Transform< T, D, M, O > &value) |
Check if a transform contains any subnormal floating-point values. More... | |
bool | setSubnormalToZero (float *value) |
If the float value is subnormal, set it to zero. More... | |
bool | setSubnormalToZero (double *value) |
If the double value is subnormal, set it to zero. More... | |
template<typename T > | |
bool | setSubnormalToZero (Eigen::DenseBase< T > *value) |
Set all subnormal values in a matrix or a vector to zero. More... | |
template<typename T > | |
bool | setSubnormalToZero (Eigen::QuaternionBase< T > *value) |
Set all subnormal values in a quaternion to zero. More... | |
template<typename T > | |
bool | setSubnormalToZero (Eigen::AngleAxis< T > *value) |
Set all subnormal values in an angle/axis 3D rotation to zero. More... | |
template<typename T > | |
bool | setSubnormalToZero (Eigen::Rotation2D< T > *value) |
If the angle of a 2D rotation is subnormal, set it to zero. More... | |
template<typename T , int D, int M, int O> | |
bool | setSubnormalToZero (Eigen::Transform< T, D, M, O > *value) |
Set all subnormal values in a transform to zero. More... | |
template<class Vector , class SubVector > | |
void | addSubVector (const SubVector &subVector, size_t blockId, size_t blockSize, Vector *vector) |
Helper method to add a sub-vector into a vector, for the sake of clarity. More... | |
template<class Vector , class SubVector > | |
void | addSubVector (const SubVector &subVector, const std::vector< size_t > blockIds, size_t blockSize, Vector *vector) |
Helper method to add a sub-vector per block into a vector, for the sake of clarity. More... | |
template<class Vector , class SubVector > | |
void | setSubVector (const SubVector &subVector, size_t blockId, size_t blockSize, Vector *vector) |
Helper method to set a sub-vector into a vector, for the sake of clarity. More... | |
template<class Vector > | |
Eigen::VectorBlock< Vector > | getSubVector (Vector &vector, size_t blockId, size_t blockSize) |
Helper method to access a sub-vector from a vector, for the sake of clarity. More... | |
template<class Vector , class SubVector > | |
void | getSubVector (const Vector &vector, const std::vector< size_t > blockIds, size_t blockSize, SubVector *subVector) |
Helper method to get a sub-vector per block from a vector, for the sake of clarity. More... | |
template<typename T , int size, int TOpt> | |
Eigen::Matrix< T, size, 1, TOpt > | interpolate (const Eigen::Matrix< T, size, 1, TOpt > &previous, const Eigen::Matrix< T, size, 1, TOpt > &next, T t) |
Interpolate (slerp) between 2 vectors. More... | |
template<class T , int VOpt> | |
bool | buildOrthonormalBasis (Eigen::Matrix< T, 3, 1, VOpt > *i, Eigen::Matrix< T, 3, 1, VOpt > *j, Eigen::Matrix< T, 3, 1, VOpt > *k) |
Helper method to construct an orthonormal basis (i, j, k) given the 1st vector direction. More... | |
template<class T , int VOpt> | |
Eigen::Matrix< T, 3, 1, VOpt > | robustCrossProduct (const std::array< Eigen::Matrix< T, 3, 1, VOpt >, 2 > &p, const std::array< Eigen::Matrix< T, 3, 1, VOpt >, 2 > &q, T epsilon) |
Calculate the best unit normal we can find in the direction of pXq for one of the endpoints of q. More... | |
Variables | |
const std::array< gaussQuadraturePoint, 1 > | gaussQuadrature1Point |
1D 1-point Gauss-Legendre quadrature \({<x_1, w_1>}\) More... | |
const std::array< gaussQuadraturePoint, 2 > | gaussQuadrature2Points |
1D 2-points Gauss-Legendre quadrature \({<x_1, w_1>, <x_2, w_2>}\) More... | |
const std::array< gaussQuadraturePoint, 3 > | gaussQuadrature3Points |
1D 3-points Gauss-Legendre quadrature \({<x_1, w_1>, <x_2, w_2>, <x_3, w_3>}\) More... | |
const std::array< gaussQuadraturePoint, 4 > | gaussQuadrature4Points |
1D 4-points Gauss-Legendre quadrature \({<x_1, w_1>, <x_2, w_2>, <x_3, w_3>, <x_4, w_4>}\) More... | |
const std::array< gaussQuadraturePoint, 5 > | gaussQuadrature5Points |
1D 5-points Gauss-Legendre quadrature \({<x_1, w_1>, <x_2, w_2>, <x_3, w_3>, <x_4, w_4>, <x_5, w_5>}\) More... | |
const std::array< gaussQuadraturePoint, 100 > | gaussQuadrature100Points |
1D 100-points Gauss-Legendre quadrature \({<x_1, w_1>, <x_2, w_2>, <x_3, w_3>, ..., <x_{100}, w_{100}>}\) More... | |
const std::array< gaussQuadratureTrianglePoint, 3 > | gaussQuadrature2DTriangle3Points |
2D triangle Gauss-Legendre quadrature 3-points \({<\xi_1, \eta_1, w_1>, ..., <\xi_3, \eta_3, w_3>}\) More... | |
const std::array< gaussQuadratureTrianglePoint, 6 > | gaussQuadrature2DTriangle6Points |
2D triangle Gauss-Legendre quadrature 6-points \({<\xi_1, \eta_1, w_1>, ..., <\xi_6, \eta_6, w_6>}\) More... | |
const std::array< gaussQuadratureTrianglePoint, 12 > | gaussQuadrature2DTriangle12Points |
2D triangle Gauss-Legendre quadrature 12-points \({<\xi_1, \eta_1, w_1>, ..., <\xi_{12}, \eta_{12}, w_{12}>}\) More... | |
const std::unordered_map< LinearSolver, std::string, std::hash< int > > | LinearSolverNames |
const std::unordered_map< IntegrationScheme, std::string, std::hash< int > > | IntegrationSchemeNames |
typedef Eigen::AlignedBox<double, 3> SurgSim::Math::Aabbd |
Wrapper around the Eigen type.
typedef Eigen::AlignedBox<float, 3> SurgSim::Math::Aabbf |
Wrapper around the Eigen type.
typedef Eigen::DiagonalMatrix<double, Eigen::Dynamic> SurgSim::Math::DiagonalMatrix |
A dynamic size diagonal matrix.
typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> SurgSim::Math::Matrix |
A dynamic size matrix.
typedef Eigen::Matrix<double, 2, 2, Eigen::RowMajor> SurgSim::Math::Matrix22d |
A 2x2 matrix of doubles.
This type (and any structs that contain it) can be safely allocated via new.
typedef Eigen::Matrix<float, 2, 2, Eigen::RowMajor> SurgSim::Math::Matrix22f |
A 2x2 matrix of floats.
This type (and any structs that contain it) can be safely allocated via new.
typedef Eigen::Matrix<double, 3, 3, Eigen::RowMajor> SurgSim::Math::Matrix33d |
A 3x3 matrix of doubles.
This type (and any structs that contain it) can be safely allocated via new.
typedef Eigen::Matrix<float, 3, 3, Eigen::RowMajor> SurgSim::Math::Matrix33f |
A 3x3 matrix of floats.
This type (and any structs that contain it) can be safely allocated via new.
typedef Eigen::Matrix<double, 4, 4, Eigen::RowMajor> SurgSim::Math::Matrix44d |
A 4x4 matrix of doubles.
This type (and any structs that contain it) can be safely allocated via new.
typedef Eigen::Matrix<float, 4, 4, Eigen::RowMajor> SurgSim::Math::Matrix44f |
A 4x4 matrix of floats.
This type (and any structs that contain it) can be safely allocated via new.
typedef Eigen::Matrix<double, 6, 6, Eigen::RowMajor> SurgSim::Math::Matrix66d |
A 6x6 matrix of doubles.
This type (and any structs that contain it) can be safely allocated via new.
typedef Eigen::Quaternion<double> SurgSim::Math::Quaterniond |
A quaternion of doubles.
This type (and any structs that contain it) can be safely allocated via new.
typedef Eigen::Quaternion<float> SurgSim::Math::Quaternionf |
A quaternion of floats.
This type (and any structs that contain it) can be safely allocated via new.
typedef Eigen::Transform<double, 2, Eigen::Isometry> SurgSim::Math::RigidTransform2d |
A 2D rigid (isometric) transform, represented as doubles.
This type (and any struct that contain it) can be safely allocated via new.
typedef Eigen::Transform<float, 2, Eigen::Isometry> SurgSim::Math::RigidTransform2f |
A 2D rigid (isometric) transform, represented as floats.
This type (and any struct that contain it) can be safely allocated via new.
typedef Eigen::Transform<double, 3, Eigen::Isometry> SurgSim::Math::RigidTransform3d |
A 3D rigid (isometric) transform, represented as doubles.
This type (and any struct that contain it) can be safely allocated via new.
typedef Eigen::Transform<float, 3, Eigen::Isometry> SurgSim::Math::RigidTransform3f |
A 3D rigid (isometric) transform, represented as floats.
This type (and any struct that contain it) can be safely allocated via new.
typedef Eigen::SparseMatrix<double> SurgSim::Math::SparseMatrix |
A sparse matrix.
typedef Eigen::Matrix<double, Eigen::Dynamic, 1> SurgSim::Math::Vector |
A dynamic size column vector.
typedef Eigen::Matrix<double, 2, 1> SurgSim::Math::Vector2d |
A 2D vector of doubles.
This type (and any structs that contain it) can be safely allocated via new.
typedef Eigen::Matrix<float, 2, 1> SurgSim::Math::Vector2f |
A 2D vector of floats.
This type (and any structs that contain it) can be safely allocated via new.
typedef Eigen::Matrix<double, 3, 1> SurgSim::Math::Vector3d |
A 3D vector of doubles.
This type (and any structs that contain it) can be safely allocated via new.
typedef Eigen::Matrix<float, 3, 1> SurgSim::Math::Vector3f |
A 3D vector of floats.
This type (and any structs that contain it) can be safely allocated via new.
typedef Eigen::Matrix<double, 4, 1> SurgSim::Math::Vector4d |
A 4D vector of doubles.
This type (and any structs that contain it) can be safely allocated via new.
typedef Eigen::Matrix<float, 4, 1> SurgSim::Math::Vector4f |
A 4D vector of floats.
This type (and any structs that contain it) can be safely allocated via new.
typedef Eigen::Matrix<double, 6, 1> SurgSim::Math::Vector6d |
A 6D matrix of doubles.
This type (and any structs that contain it) can be safely allocated via new.
typedef Eigen::Matrix<float, 6, 1> SurgSim::Math::Vector6f |
A 6D vector of floats.
This type (and any structs that contain it) can be safely allocated via new.
The diverse numerical integration scheme supported Each Ode Solver should have its own entry in this enum.
Type defining the shape direction for certain templatized shape (i.e.
CylinderShape and CapsuleShape)
Enumerator | |
---|---|
SHAPE_DIRECTION_AXIS_X | |
SHAPE_DIRECTION_AXIS_Y | |
SHAPE_DIRECTION_AXIS_Z |
Fixed List of enums for the available Shape types, do not explicitly assign values, ShapeCount is used to determine the number of actual shape types.
void SurgSim::Math::addSubMatrix | ( | const Eigen::Ref< const Matrix > & | subMatrix, |
size_t | blockIdRow, | ||
size_t | blockIdCol, | ||
Eigen::SparseMatrix< double, Opt, Index > * | matrix, | ||
bool | initialize = true |
||
) |
Helper method to add a sub-matrix into a matrix, for the sake of clarity.
Opt,Index | Type parameters defining the output matrix type SparseMatrix<double, Opt, Index> |
subMatrix | The sub-matrix | |
blockIdRow,blockIdCol | The block indices in matrix | |
[in,out] | matrix | The matrix to add the sub-matrix into |
initialize | Option parameter, default=true. If true, the matrix form is assumed to be undefined and is initialized when necessary. If false, the matrix form is assumed to be previously defined. |
void SurgSim::Math::addSubMatrix | ( | const SubMatrix & | subMatrix, |
const std::vector< size_t > | blockIds, | ||
size_t | blockSize, | ||
Matrix * | matrix | ||
) |
Helper method to add a sub-matrix made of squared-blocks into a matrix, for the sake of clarity.
Matrix | The matrix type |
SubMatrix | The sub-matrix type |
subMatrix | The sub-matrix (containing all the squared-blocks) | |
blockIds | Vector of block indices (for accessing matrix) corresponding to the blocks in sub-matrix | |
blockSize | The blocks size | |
[out] | matrix | The matrix to add the sub-matrix blocks into |
void SurgSim::Math::addSubMatrix | ( | const SubMatrix & | subMatrix, |
size_t | blockIdRow, | ||
size_t | blockIdCol, | ||
size_t | blockSizeRow, | ||
size_t | blockSizeCol, | ||
Matrix * | matrix | ||
) |
Helper method to add a sub-matrix into a matrix, for the sake of clarity.
Matrix | The matrix type |
SubMatrix | The sub-matrix type |
subMatrix | The sub-matrix | |
blockIdRow,blockIdCol | The block indices in matrix | |
blockSizeRow,blockSizeCol | The block size (size of the sub-matrix) | |
[out] | matrix | The matrix to add the sub-matrix into |
void SurgSim::Math::addSubVector | ( | const SubVector & | subVector, |
const std::vector< size_t > | blockIds, | ||
size_t | blockSize, | ||
Vector * | vector | ||
) |
Helper method to add a sub-vector per block into a vector, for the sake of clarity.
Vector | The vector type |
SubVector | The sub-vector type |
subVector | The sub-vector (containing all the blocks) | |
blockIds | Vector of block indices (for accessing vector) corresponding to the blocks in sub-vector | |
blockSize | The block size | |
[out] | vector | The vector to add the sub-vector blocks into |
void SurgSim::Math::addSubVector | ( | const SubVector & | subVector, |
size_t | blockId, | ||
size_t | blockSize, | ||
Vector * | vector | ||
) |
Helper method to add a sub-vector into a vector, for the sake of clarity.
Vector | The vector type |
SubVector | The sub-vector type |
subVector | The sub-vector | |
blockId | The block index in vector | |
blockSize | The block size | |
[out] | vector | The vector to add the sub-vector into |
void SurgSim::Math::analyticCrossProduct | ( | const LinearMotionND< T, 3 > & | a, |
const LinearMotionND< T, 3 > & | b, | ||
Polynomial< T, 2 > * | resultXAxis, | ||
Polynomial< T, 2 > * | resultYAxis, | ||
Polynomial< T, 2 > * | resultZAxis | ||
) |
Calculate an analytic cross product as a Polynomial.
T | underlying type of the linear motion |
a | the first linear motion 3 group | |
b | the second linear motion 3 group | |
[out] | resultXAxis | the X axis in a polynomial representation |
[out] | resultYAxis | the Y axis in a polynomial representation |
[out] | resultZAxis | the Z axis in a polynomial representation |
Polynomial< T, 2 > SurgSim::Math::analyticCrossProductAxis | ( | const LinearMotionND< T, 3 > & | a, |
const LinearMotionND< T, 3 > & | b | ||
) |
Calculate a single axis of an analytic cross product as a Polynomial.
T | underlying type of the linear motion |
A | axis to generate: 0 = X, 1=Y, 2=Z |
a | the first linear motion 3 group |
b | the second linear motion 3 group |
Polynomial< T, 2 > SurgSim::Math::analyticCrossProductXAxis | ( | const LinearMotionND< T, 3 > & | a, |
const LinearMotionND< T, 3 > & | b | ||
) |
Calculate the X axis of an analytic cross product as a Polynomial.
T | underlying type of the linear motion |
a | the first linear motion 3 group |
b | the second linear motion 3 group |
Polynomial< T, 2 > SurgSim::Math::analyticCrossProductYAxis | ( | const LinearMotionND< T, 3 > & | a, |
const LinearMotionND< T, 3 > & | b | ||
) |
Calculate the Y axis of an analytic cross product as a Polynomial.
T | underlying type of the linear motion |
a | the first linear motion 3 group |
b | the second linear motion 3 group |
Polynomial< T, 2 > SurgSim::Math::analyticCrossProductZAxis | ( | const LinearMotionND< T, 3 > & | a, |
const LinearMotionND< T, 3 > & | b | ||
) |
Calculate the Z axis of an analytic cross product as a Polynomial.
T | underlying type of the linear motion |
a | the first linear motion 3 group |
b | the second linear motion 3 group |
Polynomial< T, 2 > SurgSim::Math::analyticDotProduct | ( | const LinearMotionND< T, 3 > & | a, |
const LinearMotionND< T, 3 > & | b | ||
) |
Calculate an analytic dot product as a Polynomial.
T | underlying type of the linear motion |
a | the first linear motion 3 group |
b | the second linear motion 3 group |
Polynomial< T, 2 > SurgSim::Math::analyticMagnitudeSquared | ( | const LinearMotionND< T, 3 > & | motion | ) |
Calculate the magnitude squared of a linear motion 3 group as a polynomial.
T | underlying type of the linear motion |
motion | the linear motion 3 group |
Polynomial< T, 3 > SurgSim::Math::analyticTripleProduct | ( | const LinearMotionND< T, 3 > & | a, |
const LinearMotionND< T, 3 > & | b, | ||
const LinearMotionND< T, 3 > & | c | ||
) |
Calculate an analytic cross product as a Polynomial, as a polynomial whose value for t=0..1 is the value of the triple product.
T | underlying type of the linear motion |
a | the first linear motion 3 group |
b | the second linear motion 3 group |
c | the third linear motion 3 group |
bool SurgSim::Math::areSegmentsIntersecting | ( | T | time, |
const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> & | A, | ||
const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> & | B, | ||
const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> & | C, | ||
const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> & | D, | ||
Eigen::Matrix< T, 2, 1, MOpt > * | barycentricCoordinates | ||
) |
Check if 2 segments intersect at a given time of their motion.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
time | The time of coplanarity of the 4 points (A(t), B(t), C(t), D(t) are expected to be coplanar) | |
A,B | The 1st segment motion (each point's motion is from first to second) | |
C,D | The 2nd segment motion (each point's motion is from first to second) | |
[out] | barycentricCoordinates | The barycentric coordinates of the intersection in AB(t) and CD(t) i.e. P(t) = A + barycentricCoordinates[0].AB(t) = C + barycentricCoordinates[1].CD |
void SurgSim::Math::assignSubMatrix | ( | const Eigen::Ref< const Matrix > & | subMatrix, |
size_t | blockIdRow, | ||
size_t | blockIdCol, | ||
Eigen::SparseMatrix< double, Opt, Index > * | matrix, | ||
bool | initialize = true |
||
) |
Helper method to assign a sub-matrix into a matrix, for the sake of clarity.
Opt,Index | Type parameters defining the output matrix type SparseMatrix<double, Opt, Index> |
subMatrix | The sub-matrix | |
blockIdRow,blockIdCol | The block indices in matrix | |
[in,out] | matrix | The matrix to assign the sub-matrix into |
initialize | Option parameter, default=true. If true, the matrix form is assumed to be undefined and is initialized when necessary. If false, the matrix form is assumed to be previously defined. |
|
inline |
Calculate the barycentric coordinates of a point with respect to a line segment.
T | Floating point type of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
pt | Vertex of the point. | |
sv0,sv1 | Vertices of the line segment. | |
[out] | coordinates | Barycentric coordinates. |
|
inline |
Calculate the barycentric coordinates of a point with respect to a triangle.
T | Floating point type of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
pt | Vertex of the point. | |
tv0,tv1,tv2 | Vertices of the triangle in counter clockwise order in respect to the normal. | |
tn | Normal of the triangle (yes must be of norm 1 and a,b,c CCW). | |
[out] | coordinates | Barycentric coordinates. |
|
inline |
Calculate the barycentric coordinates of a point with respect to a triangle.
Please note that each time you use this call the normal of the triangle will be calculated, if you convert more than one coordinate against this triangle, precalculate the normal and use the other version of this function
T | Floating point type of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
pt | Vertex of the point. | |
tv0,tv1,tv2 | Vertices of the triangle. | |
[out] | coordinates | The Barycentric coordinates. |
void SurgSim::Math::blockOperation | ( | const Eigen::Ref< const Matrix > & | subMatrix, |
size_t | rowStart, | ||
size_t | columnStart, | ||
Eigen::SparseMatrix< double, Opt, Index > * | matrix, | ||
void(Operation< Matrix, Eigen::SparseMatrix< double, Opt, Index >>::*)(double *, const double &) | op | ||
) |
Runs a given operation on a SparseMatrix block(i, j, n, m) from a (n x m) 'subMatrix' with searching for the block 1st element.
It supposes:
Opt,Index | Type parameters defining the output matrix type SparseMatrix<double, Opt, Index> |
subMatrix | The sub matrix that will be copied into the SparseMatrix block | |
rowStart,columnStart | The row and column indices to indicate where the block in the SparseMatrix starts | |
[in,out] | matrix | The sparse matrix in which the block needs to be set by 'subMatrix' |
op | The operation to run on the block |
SurgSim::Framework::AssertionFailure | If one of the following conditions is met: |
void SurgSim::Math::blockWithSearch | ( | const Eigen::Ref< const Matrix > & | subMatrix, |
size_t | rowStart, | ||
size_t | columnStart, | ||
size_t | n, | ||
size_t | m, | ||
Eigen::SparseMatrix< double, Opt, Index > * | matrix, | ||
void(Operation< Matrix, Eigen::SparseMatrix< double, Opt, Index >>::*)(double *, size_t, size_t, size_t, const Matrix &, size_t) | op | ||
) |
Runs a given operation on a SparseMatrix block(i, j, n, m) from a (n x m) 'subMatrix' with searching for the block 1st element.
It supposes:
Opt,Index | Type parameters defining the output matrix type SparseMatrix<double, Opt, Index> |
subMatrix | The sub matrix that will be copied into the SparseMatrix block | |
rowStart,columnStart | The row and column indices to indicate where the block in the SparseMatrix starts | |
n,m | The block size (Derived may be bigger but cannot be smaller in both dimension) | |
[in,out] | matrix | The sparse matrix in which the block needs to be set by 'subMatrix' |
op | The operation to run on the block |
SurgSim::Framework::AssertionFailure | If one of the following conditions is met: |
bool SurgSim::Math::buildOrthonormalBasis | ( | Eigen::Matrix< T, 3, 1, VOpt > * | i, |
Eigen::Matrix< T, 3, 1, VOpt > * | j, | ||
Eigen::Matrix< T, 3, 1, VOpt > * | k | ||
) |
Helper method to construct an orthonormal basis (i, j, k) given the 1st vector direction.
T | the numeric data type used for the vector argument. Can usually be deduced. |
VOpt | the option flags (alignment etc.) used for the vector argument. Can be deduced. |
[in,out] | i | Should provide the 1st direction on input. The 1st vector of the basis (i, j, k) on output. |
[out] | j,k | The 2nd and 3rd orthonormal vectors of the basis (i, j, k) |
|
inline |
Continuous collision detection between a point P and a triangle ABC.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
P | the point motion (from first to second) to calculate the ccd with | |
A,B,C | The triangle points motion (from first to second) to calculate the ccd with | |
[out] | timeOfImpact | The time of impact within [0..1] if a collision is found |
[out] | tv01Param,tv02Param | The barycentric coordinate of the contact point in the triangle i.e. ContactPoint(timeOfImpact) = A(timeOfImpact) + tv01Param.AB(timeOfImpact) + tv02Param.AC(timeOfImpact) |
|
inline |
Continuous collision detection between two segments AB and CD.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
A,B | The 1st segment motion (each point's motion is from first to second) | |
C,D | The 2nd segment motion (each point's motion is from first to second) | |
[out] | timeOfImpact | The time of impact within [0..1] if an collision is found |
[out] | s0p1Factor,s1p1Factor | The barycentric coordinate of the contact point on the 2 segments i.e. ContactPoint(timeOfImpact) = A(timeOfImpact) + s0p1Factor.AB(timeOfImpact) i.e. ContactPoint(timeOfImpact) = C(timeOfImpact) + s1p1Factor.CD(timeOfImpact) |
|
inline |
Calculate the contact between a capsule and a triangle.
If the shapes intersect, the deepest penetration of the capsule along the triangle normal is calculated.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
tv0,tv1,tv2 | Vertices of the triangle. | |
cv0,cv1 | Ends of the capsule axis. | |
cr | Capsule radius. | |
[out] | penetrationDepth | The depth of penetration. |
[out] | penetrationPointTriangle | The contact point on triangle. |
[out] | penetrationPointCapsule | The contact point on capsule. |
[out] | contactNormal | The contact normal that points from capsule to triangle. |
[out] | penetrationPointCapsuleAxis | The point on the capsule axis closest to the triangle. |
|
inline |
Calculate the contact between a capsule and a triangle.
If the shapes intersect, the deepest penetration of the capsule along the triangle normal is calculated.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
tv0,tv1,tv2 | Vertices of the triangle. | |
tn | Normal of the triangle, should be normalized. | |
cv0,cv1 | Ends of the capsule axis. | |
cr | Capsule radius. | |
[out] | penetrationDepth | The depth of penetration. |
[out] | penetrationPointTriangle | The contact point on triangle. |
[out] | penetrationPointCapsule | The contact point on capsule. |
[out] | contactNormal | The contact normal that points from capsule to triangle. |
[out] | penetrationPointCapsuleAxis | The point on the capsule axis closest to the triangle. |
|
inline |
Calculate the contact between two triangles.
Algorithm presented in https://docs.google.com/a/simquest.com/document/d/11ajMD7QoTVelT2_szGPpeUEY0wHKKxW1TOgMe8k5Fsc/pub. If the triangle are known to intersect, the deepest penetration of the triangles into each other is calculated. The triangle which penetrates less into the other triangle is chosen as contact.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
t0v0,t0v1,t0v2 | Vertices of the first triangle. | |
t1v0,t1v1,t1v2 | Vertices of the second triangle. | |
t0n | Unit length normal of the first triangle, should be normalized. | |
t1n | Unit length normal of the second triangle, should be normalized. | |
[out] | penetrationDepth | The depth of penetration. |
[out] | penetrationPoint0 | The contact point on triangle0 (t0v0,t0v1,t0v2). |
[out] | penetrationPoint1 | The contact point on triangle1 (t1v0,t1v1,t1v2). |
[out] | contactNormal | The contact normal that points from triangle1 to triangle0. |
|
inline |
Calculate the contact between two triangles.
Algorithm presented in https://docs.google.com/a/simquest.com/document/d/11ajMD7QoTVelT2_szGPpeUEY0wHKKxW1TOgMe8k5Fsc/pub. If the triangle are known to intersect, the deepest penetration of the triangles into each other is calculated. The triangle which penetrates less into the other triangle is chosen as contact.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
t0v0,t0v1,t0v2 | Vertices of the first triangle, should be normalized. | |
t1v0,t1v1,t1v2 | Vertices of the second triangle, should be normalized. | |
[out] | penetrationDepth | The depth of penetration. |
[out] | penetrationPoint0 | The contact point on triangle0 (t0v0,t0v1,t0v2). |
[out] | penetrationPoint1 | The contact point on triangle1 (t1v0,t1v1,t1v2). |
[out] | contactNormal | The contact normal that points from triangle1 to triangle0. |
|
inline |
Calculate the contact between two triangles.
Algorithm is implemented from http://fileadmin.cs.lth.se/cs/Personal/Tomas_Akenine-Moller/pubs/tritri.pdf
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
t0v0,t0v1,t0v2 | Vertices of the first triangle. | |
t1v0,t1v1,t1v2 | Vertices of the second triangle. | |
t0n | Normal of the first triangle, should be normalized. | |
t1n | Normal of the second triangle, should be normalized. | |
[out] | penetrationDepth | The depth of penetration. |
[out] | penetrationPoint0 | The contact point on triangle0 (t0v0,t0v1,t0v2). |
[out] | penetrationPoint1 | The contact point on triangle1 (t1v0,t1v1,t1v2). |
[out] | contactNormal | The contact normal that points from triangle1 to triangle0. |
|
inline |
Calculate the contact between two triangles.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
t0v0,t0v1,t0v2 | Vertices of the first triangle. | |
t1v0,t1v1,t1v2 | Vertices of the second triangle. | |
[out] | penetrationDepth | The depth of penetration. |
[out] | penetrationPoint0 | The contact point on triangle0 (t0v0,t0v1,t0v2). |
[out] | penetrationPoint1 | The contact point on triangle1 (t1v0,t1v1,t1v2). |
[out] | contactNormal | The contact normal that points from triangle1 to triangle0. |
T SurgSim::Math::clamp | ( | T | value, |
T | min, | ||
T | max, | ||
T | epsilon | ||
) |
Clamp any values within an epsilon window to a maximum or minimum value.
T | underlying type |
value | [in/out] the value to be clamped |
min | the minimum value for the clamp |
max | the maximum value for the clamp |
epsilon | definition of the epsilon window. |
|
inline |
Helper method to zero all entries of a matrix specialized for Sparse Matrices.
This allows the preservation of the the matrix form while still allowing the reset of the matrix entries to zero.
[in,out] | matrix | The matrix to set to zero |
|
inline |
Get the angle corresponding to a quaternion's rotation, in radians.
If you don't care about the rotation axis, this is more efficient than computeAngleAndAxis().
T | the numeric data type used for arguments and the return value. Can usually be deduced. |
MOpt | the option flags (alignment etc.) used for the rotation matrix argument. Can be deduced. |
matrix | the rotation matrix to inspect. |
|
inline |
Get the angle corresponding to a quaternion's rotation, in radians.
T | the numeric data type used for arguments and the return value. Can usually be deduced. |
QOpt | the option flags (alignment etc.) used for the quaternion argument. Can be deduced. |
quaternion | the rotation quaternion to inspect. |
|
inline |
Get the angle (in radians) and axis corresponding to a rotation matrix.
T | the numeric data type used for arguments and the return value. Can usually be deduced. |
MOpt | the option flags (alignment etc.) used for the rotation matrix argument. Can be deduced. |
VOpt | the option flags (alignment etc.) used for the axis vector argument. Can be deduced. |
matrix | the rotation matrix to inspect. | |
[out] | angle | the angle of the rotation, in radians. |
[out] | axis | the axis of the rotation. |
|
inline |
Get the angle (in radians) and axis corresponding to a quaternion's rotation.
T | the numeric data type used for arguments and the return value. Can usually be deduced. |
QOpt | the option flags (alignment etc.) used for the quaternion argument. Can be deduced. |
VOpt | the option flags (alignment etc.) used for the axis vector argument. Can be deduced. |
quaternion | the rotation quaternion to inspect. | |
[out] | angle | the angle of the rotation in [0 +pi], in radians. |
[out] | axis | the axis of the rotation. |
void SurgSim::Math::computeRotationVector | ( | const Eigen::Transform< T, 3, Eigen::Isometry, TOpt > & | end, |
const Eigen::Transform< T, 3, Eigen::Isometry, TOpt > & | start, | ||
Eigen::Matrix< T, 3, 1, VOpt > * | rotationVector | ||
) |
Get the vector corresponding to the rotation between transforms.
T | the numeric data type used for arguments and the return value. Can usually be deduced. |
TOpt | the option flags (alignment etc.) used for the transform arguments. Can be deduced. |
VOpt | the option flags (alignment etc.) used for the vector argument. Can be deduced. |
end | the transform after the rotation. | |
start | the transform before the rotation. | |
[out] | rotationVector | a vector describing the rotation. |
|
inline |
Determine the distance between two lines.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
l0v0,l0v1 | Points on Line 0. | |
l1v0,l1v1 | Points on Line 1. | |
[out] | pt0 | The closest point on line 0. |
[out] | pt1 | The closest point on line 1. |
|
inline |
Calculate the normal distance between a point and a line.
pt | The input point. | |
v0,v1 | Two vertices on the line. | |
[out] | result | The point projected onto the line. |
|
inline |
Calculate the distance of a point to a plane.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
pt | The point to check. | |
n | The normal of the plane n (normalized). | |
d | Constant d for the plane equation as in n.x + d = 0. | |
[out] | result | Projection of point p into the plane. |
|
inline |
Point segment distance, if the projection of the closest point is not within the segments, the closest segment point is used for the distance calculation.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
pt | The input point | |
sv0,sv1 | The segment extremities. | |
[out] | result | Either the projection onto the segment or one of the 2 vertices. |
|
inline |
Calculate the normal distance of a point from a triangle, the resulting point will be on the edge of the triangle if the projection of the point is not inside the triangle.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
pt | The point that is being measured. | |
tv0,tv1,tv2 | The vertices of the triangle. | |
[out] | result | The point on the triangle that is closest to pt, if the projection of pt onto the triangle. plane is not inside the triangle the closest point on the edge will be used. |
|
inline |
Calculate the distance between a segment and a plane.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
sv0,sv1 | Endpoints of the segments. | |
n | Normal of the plane n (normalized). | |
d | Constant d in n.x + d = 0. | |
[out] | closestPointSegment | Point closest to the plane, the midpoint of the segment (v0+v1)/2 is being used if the segment is parallel to the plane. If the segment actually intersects the plane segmentIntersectionPoint will be equal to planeIntersectionPoint. |
[out] | planeIntersectionPoint | the point on the plane where the line defined by the segment intersects the plane. |
T SurgSim::Math::distanceSegmentSegment | ( | const Eigen::Matrix< T, 3, 1, MOpt > & | s0v0, |
const Eigen::Matrix< T, 3, 1, MOpt > & | s0v1, | ||
const Eigen::Matrix< T, 3, 1, MOpt > & | s1v0, | ||
const Eigen::Matrix< T, 3, 1, MOpt > & | s1v1, | ||
Eigen::Matrix< T, 3, 1, MOpt > * | pt0, | ||
Eigen::Matrix< T, 3, 1, MOpt > * | pt1, | ||
T * | s0t = nullptr , |
||
T * | s1t = nullptr |
||
) |
Distance between two segments, if the project of the closest point is not on the opposing segment, the segment endpoints will be used for the distance calculation.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
s0v0,s0v1 | Segment 0 Extremities. | |
s1v0,s1v1 | Segment 1 Extremities. | |
[out] | pt0 | Closest point on segment 0 |
[out] | pt1 | Closest point on segment 1 |
[out] | s0t | Abscissa at the point of intersection on Segment 0 (s0v0 + t * (s0v1 - s0v0)). |
[out] | s1t | Abscissa at the point of intersection on Segment 0 (s1v0 + t * (s1v1 - s1v0)). |
|
inline |
Calculate the distance of a line segment to a triangle.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
sv0,sv1 | Extremities of the line segment. | |
tv0,tv1,tv2 | Points of the triangle. | |
normal | Normal of the triangle (Expected to be normalized) | |
[out] | segmentPoint | Closest point on the segment. |
[out] | trianglePoint | Closest point on the triangle. |
|
inline |
Calculate the distance of a line segment to a triangle.
Note that this version will calculate the normal of the triangle, if the normal is known use the other version of this function.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
sv0,sv1 | Extremities of the line segment. | |
tv0,tv1,tv2 | Triangle points. | |
[out] | segmentPoint | Closest point on the segment. |
[out] | trianglePoint | Closest point on the triangle. |
|
inline |
Calculate the distance of a triangle to a plane.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
tv0,tv1,tv2 | Points of the triangle. |
n | Normal of the plane n (normalized). |
d | Constant d in n.x + d = 0. |
closestPointTriangle | Closest point on the triangle, when the triangle is coplanar to the plane (tv0+tv1+tv2)/3 is used, when the triangle intersects the plane the midpoint of the intersection segment is returned. |
planeProjectionPoint | Projection of the closest point onto the plane, when the triangle intersects the plane the midpoint of the intersection segment is returned. |
|
inline |
Calculate the distance between two triangles.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
t0v0,t0v1,t0v2 | Points of the first triangle. | |
t1v0,t1v1,t1v2 | Points of the second triangle. | |
[out] | closestPoint0 | Closest point on the first triangle, unless penetrating, in which case it is the point along the edge that allows min separation. |
[out] | closestPoint1 | Closest point on the second triangle, unless penetrating, in which case it is the point along the edge that allows min separation. |
bool SurgSim::Math::doAabbIntersect | ( | const Eigen::AlignedBox< Scalar, Dim > & | a, |
const Eigen::AlignedBox< Scalar, Dim > & | b | ||
) |
Determine whether two AABBs overlap, using a minimal set of eigen calls, does not take a tolerance.
Scalar | numeric type |
Dim | dimension of the space to be used |
a | first axis aligned bounding box |
b | second axis aligned bounding box |
bool SurgSim::Math::doAabbIntersect | ( | const Eigen::AlignedBox< Scalar, Dim > & | aabb0, |
const Eigen::AlignedBox< Scalar, Dim > & | aabb1, | ||
double | tolerance | ||
) |
Determine whether two AABBs have an intersection with each other, for the calculation see http://www.gamasutra.com/view/feature/131790/simple_intersection_tests_for_games.php?page=3.
Scalar | numeric type |
Dim | dimension of the space to be used |
aabb0 | first axis aligned bounding box |
aabb1 | second axis aligned bounding box |
tolerance | the bounding boxes will be considered bigger by this amount |
|
inline |
Calculate the intersection of a line segment with a triangle See http://geomalgorithms.com/a06-_intersect-2.html#intersect_RayTriangle for the algorithm.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
sv0,sv1 | Extremities of the segment. | |
tv0,tv1,tv2 | The triangle vertices. CCW around the normal. | |
tn | The triangle normal, should be normalized. | |
[out] | result | The point where the triangle and the line segment intersect, invalid if they don't intersect. |
bool SurgSim::Math::doesIntersectBoxCapsule | ( | const Eigen::Matrix< T, 3, 1, MOpt > & | capsuleBottom, |
const Eigen::Matrix< T, 3, 1, MOpt > & | capsuleTop, | ||
const T | capsuleRadius, | ||
const Eigen::AlignedBox< T, 3 > & | box | ||
) |
Test if an axis aligned box intersects with a capsule.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
capsuleBottom | Position of the capsule bottom |
capsuleTop | Position of the capsule top |
capsuleRadius | The capsule radius |
box | Axis aligned bounding box |
|
inline |
Test if two planes are intersecting, if yes also calculate the intersection line.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
pn0,pd0 | Normal and constant of the first plane, nx + d = 0. | |
pn1,pd1 | Normal and constant of the second plane, nx + d = 0. | |
[out] | pt0,pt1 | Two points on the intersection line, not valid if there is no intersection. |
|
inline |
Check if the two triangles intersect using separating axis test.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
t0v0,t0v1,t0v2 | Vertices of the first triangle. |
t1v0,t1v1,t1v2 | Vertices of the second triangle. |
|
inline |
Check if the two triangles intersect using separating axis test.
Algorithm is implemented from http://fileadmin.cs.lth.se/cs/Personal/Tomas_Akenine-Moller/pubs/tritri.pdf
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
t0v0,t0v1,t0v2 | Vertices of the first triangle. |
t1v0,t1v1,t1v2 | Vertices of the second triangle. |
t0n | Normal of the first triangle, should be normalized. |
t1n | Normal of the second triangle, should be normalized. |
void SurgSim::Math::edgeIntersection | ( | T | dStart, |
T | dEnd, | ||
T | pvStart, | ||
T | pvEnd, | ||
T * | parametricIntersection, | ||
size_t * | parametricIntersectionIndex | ||
) |
Two ends of the triangle edge are given in terms of the following vertex properties.
T | Accuracy of the calculation, can usually be inferred. |
dStart | Signed distance of the start of edge from the plane of the colliding triangle. |
dEnd | Signed distance of the end of edge from the plane of the colliding triangle. |
pvStart | Projection of the start of edge from the plane of the colliding triangle. |
pvEnd | Projection of the end of edge from the plane of the colliding triangle. |
parametricIntersection | Parametric representation of the intersection between the triangle edge and the plane in terms of the projection on the separating axis. |
parametricIntersectionIndex | The array index of parametricIntersection. |
int SurgSim::Math::findRootsInRange01 | ( | const Polynomial< T, 3 > & | polynomial, |
std::array< T, 3 > * | roots | ||
) |
Find all roots in range \([0 \ldotp\ldotp 1]\) of a cubic equation.
T | The equation coefficient type |
polynomial | The cubic polynomial \(ax^3 + bx^2 + cx + d\) | |
[out] | roots | All roots ordered ascendingly in \([0 \ldotp\ldotp 1]\) if any (3 max) |
\[ \begin{array}{lll} P(x) &=& ax^3 + bx^2 + cx + d \\ \text{} P'(x) &=& 3ax^2 + 2bx + c \Rightarrow \Delta = (2b)^2 - 4(3a)(c) = 4(b^2 - 3ac) \end{array} \\ \text{} \left\{ \begin{array}{ll} \Delta < 0 & \text{P is monotonic, P' is always the same sign, the sign of P'(0) = sign(c)} \\ \text{} \Delta = 0 & \text{P is monotonic with an inflection point, P' is always the same sign, except at P'(root) = 0} \\ \text{} \Delta > 0 & \text{P is monotonic on 3 separate intervals} \end{array} \right. \]
|
inline |
|
inline |
Eigen::Block<Matrix> SurgSim::Math::getSubMatrix | ( | Matrix & | matrix, |
size_t | blockIdRow, | ||
size_t | blockIdCol, | ||
size_t | blockSizeRow, | ||
size_t | blockSizeCol | ||
) |
Helper method to access a sub-matrix from a matrix, for the sake of clarity.
Matrix | The matrix type to get the sub-matrix from |
matrix | The matrix to get the sub-matrix from |
blockIdRow,blockIdCol | The block indices |
blockSizeRow,blockSizeCol | The block size |
void SurgSim::Math::getSubVector | ( | const Vector & | vector, |
const std::vector< size_t > | blockIds, | ||
size_t | blockSize, | ||
SubVector * | subVector | ||
) |
Helper method to get a sub-vector per block from a vector, for the sake of clarity.
Vector | The vector type |
SubVector | The sub-vector type |
vector | The vector (containing the blocks in a sparse manner) | |
blockIds | Vector of block indices (for accessing vector) corresponding to the blocks in vector | |
blockSize | The block size | |
[out] | subVector | The sub-vector to store the requested blocks (blockIds) from vector into |
Eigen::VectorBlock<Vector> SurgSim::Math::getSubVector | ( | Vector & | vector, |
size_t | blockId, | ||
size_t | blockSize | ||
) |
Helper method to access a sub-vector from a vector, for the sake of clarity.
Vector | The vector type to get the sub-vector from |
vector | The vector to get the sub-vector from |
blockId | The block index |
blockSize | The block size |
Eigen::Matrix<T, size, 1, TOpt> SurgSim::Math::interpolate | ( | const Eigen::Matrix< T, size, 1, TOpt > & | previous, |
const Eigen::Matrix< T, size, 1, TOpt > & | next, | ||
T | t | ||
) |
Interpolate (slerp) between 2 vectors.
T | the numeric data type used for arguments and the return value. Can usually be deduced. |
size | the size of the vectors. Can be deduced. |
TOpt | the option flags (alignment etc.) used for the Vector arguments. Can be deduced. |
previous | The starting vector (at time 0.0). |
next | The ending vector (at time 1.0). |
t | The interpolation time requested. Within [0..1], although note bounds are not checked. |
|
inline |
Interpolate (slerp) between 2 quaternions.
T | the numeric data type used for arguments and the return value. Can usually be deduced. |
QOpt | the option flags (alignment etc.) used for the quaternion arguments. Can be deduced. |
q0 | The start quaternion (at time 0.0). |
q1 | The end quaternion (at time 1.0). |
t | The interpolation time requested. Within [0..1]. |
|
inline |
Interpolate (slerp) between 2 rigid transformations.
T | the numeric data type used for arguments and the return value. Can usually be deduced. |
TOpt | the option flags (alignment etc.) used for the Transform arguments. Can be deduced. |
t0 | The start transform (at time 0.0). |
t1 | The end transform (at time 1.0). |
t | The interpolation time requested. Within [0..1]. |
void SurgSim::Math::intersectionsSegmentBox | ( | const Eigen::Matrix< T, 3, 1, MOpt > & | sv0, |
const Eigen::Matrix< T, 3, 1, MOpt > & | sv1, | ||
const Eigen::AlignedBox< T, 3 > & | box, | ||
std::vector< Eigen::Matrix< T, 3, 1, MOpt >> * | intersections | ||
) |
Calculate the intersections between a line segment and an axis aligned box.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
sv0,sv1 | Extremities of the line segment. | |
box | Axis aligned bounding box | |
[out] | intersections | The points of intersection between the segment and the box |
void SurgSim::Math::IntervalArithmetic_add | ( | const Interval< P > & | a, |
const Interval< P > & | b, | ||
Interval< P > * | res | ||
) |
Calculate the sum of two intervals.
P | underlying type of the interval |
a | the first interval |
b | the second interval |
res | [out] the result of a + b |
void SurgSim::Math::IntervalArithmetic_add | ( | const Interval< T > & | a, |
const Interval< T > & | b, | ||
Interval< T > * | res | ||
) |
void SurgSim::Math::IntervalArithmetic_add | ( | const IntervalND< P, 3 > & | a, |
const IntervalND< P, 3 > & | b, | ||
IntervalND< P, 3 > * | res | ||
) |
Calculate the sum of two interval groups.
P | underlying type of the interval |
a | the first interval group |
b | the second interval group |
res | [out] the result of a + b |
void SurgSim::Math::IntervalArithmetic_add | ( | const IntervalND< T, 3 > & | a, |
const IntervalND< T, 3 > & | b, | ||
IntervalND< T, 3 > * | res | ||
) |
void SurgSim::Math::IntervalArithmetic_addadd | ( | const Interval< P > & | a, |
const Interval< P > & | b, | ||
Interval< P > * | res | ||
) |
Calculate the sum of three intervals res + a + b.
P | underlying type of the interval |
a | the first interval |
b | the second interval |
res | [in/out] the result of res + a + b |
void SurgSim::Math::IntervalArithmetic_addadd | ( | const Interval< T > & | a, |
const Interval< T > & | b, | ||
Interval< T > * | res | ||
) |
void SurgSim::Math::IntervalArithmetic_addmul | ( | const Interval< P > & | a, |
const Interval< P > & | b, | ||
Interval< P > * | res | ||
) |
Add the product of two intervals to an existing value.
P | underlying type of the interval |
a | the first interval |
b | the second interval |
res | [in/out] the result of res + (a * b) |
void SurgSim::Math::IntervalArithmetic_addmul | ( | const Interval< T > & | a, |
const Interval< T > & | b, | ||
Interval< T > * | res | ||
) |
void SurgSim::Math::IntervalArithmetic_addsub | ( | const Interval< P > & | a, |
const Interval< P > & | b, | ||
Interval< P > * | res | ||
) |
Add the difference of two intervals to an existing value.
P | underlying type of the interval |
a | the first interval |
b | the second interval |
res | [in/out] the result of res + (a - b) |
void SurgSim::Math::IntervalArithmetic_addsub | ( | const Interval< T > & | a, |
const Interval< T > & | b, | ||
Interval< T > * | res | ||
) |
void SurgSim::Math::IntervalArithmetic_crossProduct | ( | const IntervalND< P, 3 > & | a, |
const IntervalND< P, 3 > & | b, | ||
IntervalND< P, 3 > * | res | ||
) |
Calculate the cross product of two interval groups.
P | underlying type of the interval |
a | the first interval group |
b | the second interval group |
res | [out] the cross product of a and b |
void SurgSim::Math::IntervalArithmetic_crossProduct | ( | const IntervalND< T, 3 > & | a, |
const IntervalND< T, 3 > & | b, | ||
IntervalND< T, 3 > * | res | ||
) |
void SurgSim::Math::IntervalArithmetic_dotProduct | ( | const IntervalND< P, 3 > & | a, |
const IntervalND< P, 3 > & | b, | ||
Interval< P > * | res | ||
) |
Calculate the dot product of two interval groups.
P | underlying type of the interval |
a | the first interval group |
b | the second interval group |
res | [out] the dot product of a and b |
void SurgSim::Math::IntervalArithmetic_dotProduct | ( | const IntervalND< T, 3 > & | a, |
const IntervalND< T, 3 > & | b, | ||
Interval< T > * | res | ||
) |
void SurgSim::Math::IntervalArithmetic_mul | ( | const Interval< P > & | a, |
const Interval< P > & | b, | ||
Interval< P > * | res | ||
) |
Calculate the product of two intervals.
P | underlying type of the interval |
a | the first interval |
b | the second interval |
res | [out] the result of a * b |
void SurgSim::Math::IntervalArithmetic_mul | ( | const Interval< T > & | a, |
const Interval< T > & | b, | ||
Interval< T > * | res | ||
) |
void SurgSim::Math::IntervalArithmetic_sub | ( | const Interval< P > & | a, |
const Interval< P > & | b, | ||
Interval< P > * | res | ||
) |
Calculate the difference of two intervals.
P | underlying type of the interval |
a | the first interval |
b | the second interval |
res | [out] the result of a - b |
void SurgSim::Math::IntervalArithmetic_sub | ( | const Interval< T > & | a, |
const Interval< T > & | b, | ||
Interval< T > * | res | ||
) |
void SurgSim::Math::IntervalArithmetic_sub | ( | const IntervalND< P, 3 > & | a, |
const IntervalND< P, 3 > & | b, | ||
IntervalND< P, 3 > * | res | ||
) |
Calculate the difference of two interval groups.
P | underlying type of the interval |
a | the first interval group |
b | the second interval group |
res | [out] the result of a - b |
void SurgSim::Math::IntervalArithmetic_sub | ( | const IntervalND< T, 3 > & | a, |
const IntervalND< T, 3 > & | b, | ||
IntervalND< T, 3 > * | res | ||
) |
void SurgSim::Math::IntervalArithmetic_submul | ( | const Interval< P > & | a, |
const Interval< P > & | b, | ||
Interval< P > * | res | ||
) |
Subtract the product of two intervals from an existing value.
P | underlying type of the interval |
a | the first interval |
b | the second interval |
res | [in/out] the result of res - (a * b) |
void SurgSim::Math::IntervalArithmetic_submul | ( | const Interval< T > & | a, |
const Interval< T > & | b, | ||
Interval< T > * | res | ||
) |
|
inline |
Check whether the points are coplanar.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
a,b,c,d | Points to check for coplanarity. |
bool SurgSim::Math::isNearZero | ( | const T & | value, |
const T & | epsilon = static_cast< T >(polynomial_epsilon) |
||
) |
Define an utility function for comparing individual coefficients to 0.
T | underlying data type used as either the scalar or as the data type for the interval |
value | the value to compare |
epsilon | the tolerance |
|
inline |
Check if a point is inside a triangle.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
pt | Vertex of the point. |
tv0,tv1,tv2 | Vertices of the triangle, must be in CCW. |
|
inline |
Check if a point is inside a triangle.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
pt | Vertex of the point. |
tv0,tv1,tv2 | Vertices of the triangle, must be in CCW. |
tn | Normal of the triangle (yes must be of norm 1 and a,b,c CCW). |
bool SurgSim::Math::isPointInsideTriangle | ( | T | time, |
const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> & | P, | ||
const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> & | A, | ||
const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> & | B, | ||
const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> & | C, | ||
Eigen::Matrix< T, 3, 1, MOpt > * | barycentricCoordinates | ||
) |
Check if a point belongs to a triangle at a given time of their motion.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
time | The time of coplanarity of the 4 points (P(t), A(t), B(t), C(t) are expected to be coplanar) | |
P | the point motion (from first to second) | |
A,B,C | The triangle points motion (from first to second) | |
[out] | barycentricCoordinates | The barycentric coordinates of P(t) in ABC(t) |
|
inline |
Check if a point is on the edge of a triangle.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
pt | Vertex of the point. |
tv0,tv1,tv2 | Vertices of the triangle, must be in CCW. |
|
inline |
Check if a point is on the edge of a triangle.
T | Accuracy of the calculation, can usually be inferred. |
MOpt | Eigen Matrix options, can usually be inferred. |
pt | Vertex of the point. |
tv0,tv1,tv2 | Vertices of the triangle, must be in CCW. |
tn | Normal of the triangle (must be of norm 1 and a,b,c CCW). |
|
inline |
Check if an angle/axis 3D rotation contains any subnormal floating-point values.
Subnormal values have absolute values in the range std::numeric_limits<T>::denorm_min() <= x < std::numeric_limits<T>::min()
, and can result in very slow floating point calculations under some conditions.
T | the scalar type used to describe the rotation. Can usually be deduced. |
value | the rotation value to check. |
|
inline |
Check if a matrix or a vector contains any subnormal floating-point values.
Subnormal values have absolute values in the range std::numeric_limits<T>::denorm_min() <= x < std::numeric_limits<T>::min()
, and can result in very slow floating point calculations under some conditions.
T | the base type used to describe the matrix or vector. Can usually be deduced. |
value | the matrix or vector value to check. |
|
inline |
Check if a quaternion contains any subnormal floating-point values.
Subnormal values have absolute values in the range std::numeric_limits<T>::denorm_min() <= x < std::numeric_limits<T>::min()
, and can result in very slow floating point calculations under some conditions.
T | the base type used to describe the quaternion. Can usually be deduced. |
value | the quaternion value to check. |
|
inline |
Check if a 2D rotation is described by an angle that is subnormal.
Subnormal values have absolute values in the range std::numeric_limits<T>::denorm_min() <= x < std::numeric_limits<T>::min()
, and can result in very slow floating point calculations under some conditions.
T | the scalar type used to describe the rotation. Can usually be deduced. |
value | the 2D rotation value to check. |
|
inline |
Check if a transform contains any subnormal floating-point values.
Subnormal values have absolute values in the range std::numeric_limits<T>::denorm_min() <= x < std::numeric_limits<T>::min()
, and can result in very slow floating point calculations under some conditions.
T | the scalar type used to describe the transform. Can usually be deduced. |
D | the dimension used to describe the transform. Can usually be deduced. |
M | the mode value used to describe the transform. Can usually be deduced. |
O | the options value used to describe the transform. Can usually be deduced. |
value | the transform value to check. |
|
inline |
Check if a double
value is subnormal.
Subnormal values have absolute values in the range std::numeric_limits<double>::denorm_min() <= x < std::numeric_limits<double>::min()
, and can result in very slow floating point calculations under some conditions.
value | the value to check. |
|
inline |
Check if a float
value is subnormal.
Subnormal values have absolute values in the range std::numeric_limits<float>::denorm_min() <= x < std::numeric_limits<float>::min()
, and can result in very slow floating point calculations under some conditions.
value | the value to check. |
|
inline |
Check if an angle/axis 3D rotation is valid.
Angle/axis rotations are valid if the angle and the axis components are valid. Zero, subnormal and normal numbers are valid; infinities and NaNs are not.
T | the scalar type used to describe the rotation. Can usually be deduced. |
value | the rotation value to check. |
|
inline |
Check if a matrix or a vector is valid.
These quantities are valid if all of their elements are valid. Zero, subnormal and normal numbers are valid; infinities and NaNs are not.
T | the base type used to describe the matrix or vector. Can usually be deduced. |
value | the matrix or vector value to check. |
|
inline |
Check if a quaternion is valid.
Quaternions are valid if all of their components are valid. Zero, subnormal and normal numbers are valid; infinities and NaNs are not.
T | the base type used to describe the quaternion. Can usually be deduced. |
value | the quaternion value to check. |
|
inline |
Check if a 2D rotation is valid.
2D rotations are valid if the rotation angle is valid. Zero, subnormal and normal numbers are valid; infinities and NaNs are not.
T | the scalar type used to describe the rotation. Can usually be deduced. |
value | the rotation value to check. |
|
inline |
Check if a transform is valid.
Transforms are valid if all of their components are valid. Zero, subnormal and normal numbers are valid; infinities and NaNs are not.
T | the scalar type used to describe the transform. Can usually be deduced. |
D | the dimension used to describe the transform. Can usually be deduced. |
M | the mode value used to describe the transform. Can usually be deduced. |
O | the options value used to describe the transform. Can usually be deduced. |
value | the transform value to check. |
|
inline |
Check if a double
value is valid.
Zero, subnormal and normal numbers are valid; infinities and NaNs are not.
value | the value to check. |
|
inline |
Check if a float
value is valid.
Zero, subnormal and normal numbers are valid; infinities and NaNs are not.
value | the value to check. |
Eigen::AlignedBox<Scalar, Dim> SurgSim::Math::makeAabb | ( | const Eigen::Matrix< Scalar, Dim, 1, MType > & | vector0, |
const Eigen::Matrix< Scalar, Dim, 1, MType > & | vector1, | ||
const Eigen::Matrix< Scalar, Dim, 1, MType > & | vector2 | ||
) |
Convenience function for creating a bounding box from three vertices (e.g.
the vertices of a triangle)
Scalar | numeric type |
Dim | dimension of the space to be used |
MType | the eigen type of the vectors |
|
inline |
Make a rigid transform from a eye point a center view point and an up direction, does not check whether up is colinear with eye-center The original formula can be found at http://www.opengl.org/sdk/docs/man2/xhtml/gluLookAt.xml.
typename | T T the numeric data type used for arguments and the return value. Can usually be deduced. |
int | VOpt VOpt the option flags (alignment etc.) used for the axis vector argument. Can be deduced. |
position | The position of the object. |
center | The point to which the object should point. |
up | The up vector to be used for this calculation. |
|
inline |
Create a rigid transform using the specified rotation matrix and translation.
M | the type used to describe the rotation matrix. Can usually be deduced. |
V | the type used to describe the translation vector. Can usually be deduced. |
rotation | the rotation matrix. |
translation | the translation vector. |
|
inline |
Create a rigid transform using the specified rotation quaternion and translation.
Q | the type used to describe the rotation quaternion. Can usually be deduced. |
V | the type used to describe the translation vector. Can usually be deduced. |
rotation | the rotation quaternion. |
translation | the translation vector. |
|
inline |
Create a rigid transform using the identity rotation and the specified translation.
V | the type used to describe the translation vector. Can usually be deduced. |
translation | the translation vector. |
|
inline |
Create a rotation matrix corresponding to the specified angle (in radians) and axis.
T | the numeric data type used for arguments and the return value. Can usually be deduced. |
VOpt | the option flags (alignment etc.) used for the axis vector argument. Can be deduced. |
angle | the angle of the rotation, in radians. |
axis | the axis of the rotation. |
|
inline |
Create a quaternion rotation corresponding to the specified angle (in radians) and axis.
T | the numeric data type used for arguments and the return value. Can usually be deduced. |
VOpt | the option flags (alignment etc.) used for the axis vector argument. Can be deduced. |
angle | the angle of the rotation, in radians. |
axis | the axis of the rotation. |
|
inline |
Create a skew-symmetric matrix corresponding to the specified vector.
Skew-symmetric matrices are particularly useful for representing a portion of the vector cross-product.
T | the numeric data type used for arguments and the return value. Can usually be deduced. |
VOpt | the option flags (alignment etc.) used for the vector argument. Can be deduced. |
vector | the vector to be transformed. |
void SurgSim::Math::minMax | ( | const T & | a1, |
const T & | a2, | ||
const T & | a3, | ||
const T & | a4, | ||
const T & | a5, | ||
T * | minVal, | ||
T * | maxVal | ||
) |
Calculate the minimum and maximum of five values.
T | underlying type |
a1 | the first value |
a2 | the second value |
a3 | the third value |
a4 | the fourth value |
a5 | the fifth value |
minVal | [out] the minimum of a1, a2, a3, a4 and a5 |
maxVal | [out] the maximum of a1, a2, a3, a4 and a5 |
void SurgSim::Math::minMax | ( | const T & | a1, |
const T & | a2, | ||
const T & | a3, | ||
const T & | a4, | ||
T * | minVal, | ||
T * | maxVal | ||
) |
Calculate the minimum and maximum of four values.
T | underlying type |
a1 | the first value |
a2 | the second value |
a3 | the third value |
a4 | the fourth value |
minVal | [out] the minimum of a1, a2, a3 and a4 |
maxVal | [out] the maximum of a1, a2, a3 and a4 |
void SurgSim::Math::minMax | ( | const T & | a1, |
const T & | a2, | ||
const T & | a3, | ||
T * | minVal, | ||
T * | maxVal | ||
) |
Calculate the minimum and maximum of three values.
T | underlying type |
a1 | the first value |
a2 | the second value |
a3 | the third value |
minVal | [out] the minimum of a1, a2 and a3 |
maxVal | [out] the maximum of a1, a2 and a3 |
void SurgSim::Math::minMax | ( | const T & | a1, |
const T & | a2, | ||
T * | minVal, | ||
T * | maxVal | ||
) |
Calculate the minimum and maximum of two values.
T | underlying type |
a1 | the first value |
a2 | the second value |
minVal | [out] the minimum of a1 and a2 |
maxVal | [out] the maximum of a1 and a2 |
void SurgSim::Math::minMax | ( | const T * | values, |
int | numValues, | ||
T * | minVal, | ||
T * | maxVal | ||
) |
Calculate the minimum and maximum of numValues values.
T | underlying type |
values | a series of numValues values |
numValues | the number of values in the series |
minVal | [out] the minimum value in values |
maxVal | [out] the maximum value in values |
Eigen::Matrix<T, 3, 1, VOpt> SurgSim::Math::nearestPointOnLine | ( | const Eigen::Matrix< T, 3, 1, VOpt > & | point, |
const Eigen::Matrix< T, 3, 1, VOpt > & | segment0, | ||
const Eigen::Matrix< T, 3, 1, VOpt > & | segment1 | ||
) |
Helper method to determine the nearest point between a point and a line.
T | the numeric data type used for the vector argument. Can usually be deduced. |
VOpt | the option flags (alignment etc.) used for the vector argument. Can be deduced. |
point | is the point under consideration. |
segment0 | one point on the line |
segment1 | second point on the line |
|
inline |
Quaternion negation (i.e.
unary operator -)
T | the numeric data type used for arguments and the return value. Can usually be deduced. |
QOpt | the option flags (alignment etc.) used for the quaternion arguments. Can be deduced. |
q | The quaternion to negate |
Polynomial< T, 2 > SurgSim::Math::operator* | ( | const Polynomial< T, 1 > & | p, |
const Polynomial< T, 1 > & | q | ||
) |
Multiply two polynomials of degree 1.
T | underlying data type over which the interval is defined. |
p | first polynomial of degree 1 |
q | second polynomial of degree 1 |
Polynomial< T, 3 > SurgSim::Math::operator* | ( | const Polynomial< T, 1 > & | p, |
const Polynomial< T, 2 > & | q | ||
) |
Multiply two polynomials of degree 1 and 2 respectively.
T | underlying data type over which the interval is defined. |
p | first polynomial of degree 1 |
q | second polynomial of degree 2 |
Polynomial< T, 3 > SurgSim::Math::operator* | ( | const Polynomial< T, 2 > & | p, |
const Polynomial< T, 1 > & | q | ||
) |
Multiply two polynomials of degree 2 and 1 respectively.
T | underlying data type over which the interval is defined. |
p | first polynomial of degree 2 |
q | second polynomial of degree 1 |
Polynomial< T, N+M > SurgSim::Math::operator* | ( | const Polynomial< T, N > & | p, |
const Polynomial< T, M > & | q | ||
) |
Multiply two polynomials of arbitrary degree.
This current implementation is limited to a resulting polynomial of no more than degree 3 (i.e. N + M <= 3) because of limits in the underlying polynomial representations.
N | degree of the first polynomial |
M | degree of the second polynomial |
T | underlying data type over which the interval is defined. |
p | first polynomial of degree N |
q | second polynomial of degree M |
T | underlying type of the interval |
v | the scalar |
i | the interval |
T | underlying type of the interval |
v | the scalar |
i | the interval |
std::ostream & SurgSim::Math::operator<< | ( | std::ostream & | o, |
const Interval< T > & | interval | ||
) |
Write a textual version of the interval to an output stream.
T | underlying type of the interval |
o | the ostream to be written to |
interval | the interval to write |
std::ostream & SurgSim::Math::operator<< | ( | std::ostream & | o, |
const IntervalND< T, N > & | interval | ||
) |
Write a textual version of an interval group to an output stream.
T | underlying type of the interval |
N | number of intervals in the group |
o | the ostream to be written to |
interval | the interval group to write |
std::ostream & SurgSim::Math::operator<< | ( | std::ostream & | o, |
const LinearMotion< T > & | motion | ||
) |
Write a textual version of a linear motion to an output stream.
T | underlying type of the linear motion |
o | the ostream to be written to |
motion | the motion to write |
std::ostream & SurgSim::Math::operator<< | ( | std::ostream & | o, |
const LinearMotionND< T, N > & | motion | ||
) |
Write a textual version of a linear motion group to an output stream.
T | underlying type of the linear motion |
N | number of linear motions in the group |
o | the ostream to be written to |
motion | the motion group to write |
|
inline |
Write a textual version of a Polynomial to an output stream.
T | underlying type of the polynomial coefficients |
N | degree of the polynomial |
stream | the ostream to be written to |
p | the polynomial to write |
Eigen::Matrix<T, 3, 1, VOpt> SurgSim::Math::robustCrossProduct | ( | const std::array< Eigen::Matrix< T, 3, 1, VOpt >, 2 > & | p, |
const std::array< Eigen::Matrix< T, 3, 1, VOpt >, 2 > & | q, | ||
T | epsilon | ||
) |
Calculate the best unit normal we can find in the direction of pXq for one of the endpoints of q.
Try multiple arrangements of the end points to reduce the artifacts when three of the vertices may be nearly collinear.
p | segment p |
q | segment q |
epsilon | when the norm of p x q is above epsilon, the cross product is assumed to be valid. return the normalized cross product of p x q |
void SurgSim::Math::setSubMatrix | ( | const SubMatrix & | subMatrix, |
size_t | blockIdRow, | ||
size_t | blockIdCol, | ||
size_t | blockSizeRow, | ||
size_t | blockSizeCol, | ||
Matrix * | matrix | ||
) |
Helper method to set a sub-matrix into a matrix, for the sake of clarity.
Matrix | The matrix type |
SubMatrix | The sub-matrix type |
subMatrix | The sub-matrix | |
blockIdRow,blockIdCol | The block indices for row and column in matrix | |
blockSizeRow,blockSizeCol | The size of the sub-matrix | |
[out] | matrix | The matrix to set the sub-matrix into |
|
inline |
If the double
value is subnormal, set it to zero.
Subnormal values have absolute values in the range std::numeric_limits<double>::denorm_min() <= x < std::numeric_limits<double>::min()
, and can result in very slow floating point calculations under some conditions.
[in,out] | value | the value to check and possibly modify. |
|
inline |
Set all subnormal values in an angle/axis 3D rotation to zero.
Subnormal values have absolute values in the range std::numeric_limits<T>::denorm_min() <= x < std::numeric_limits<T>::min()
, and can result in very slow floating point calculations under some conditions.
T | the scalar type used to describe the rotation. Can usually be deduced. |
[in,out] | value | the rotation value to check and possibly modify. |
|
inline |
Set all subnormal values in a matrix or a vector to zero.
Subnormal values have absolute values in the range std::numeric_limits<T>::denorm_min() <= x < std::numeric_limits<T>::min()
, and can result in very slow floating point calculations under some conditions.
T | the base type used to describe the matrix or vector. Can usually be deduced. |
[in,out] | value | the matrix or vector value to check and possibly modify. |
|
inline |
Set all subnormal values in a quaternion to zero.
Subnormal values have absolute values in the range std::numeric_limits<T>::denorm_min() <= x < std::numeric_limits<T>::min()
, and can result in very slow floating point calculations under some conditions.
T | the base type used to describe the quaternion. Can usually be deduced. |
[in,out] | value | the quaternion value to check and possibly modify. |
|
inline |
If the angle of a 2D rotation is subnormal, set it to zero.
Subnormal values have absolute values in the range std::numeric_limits<T>::denorm_min() <= x < std::numeric_limits<T>::min()
, and can result in very slow floating point calculations under some conditions.
T | the scalar type used to describe the rotation. Can usually be deduced. |
[in,out] | value | the rotation value to check and possibly modify. |
|
inline |
Set all subnormal values in a transform to zero.
Subnormal values have absolute values in the range std::numeric_limits<T>::denorm_min() <= x < std::numeric_limits<T>::min()
, and can result in very slow floating point calculations under some conditions.
T | the base type used to describe the transform. Can usually be deduced. |
[in,out] | value | the transform value to check and possibly modify. |
|
inline |
If the float
value is subnormal, set it to zero.
Subnormal values have absolute values in the range std::numeric_limits<float>::denorm_min() <= x < std::numeric_limits<float>::min()
, and can result in very slow floating point calculations under some conditions.
[in,out] | value | the value to check and possibly modify. |
void SurgSim::Math::setSubVector | ( | const SubVector & | subVector, |
size_t | blockId, | ||
size_t | blockSize, | ||
Vector * | vector | ||
) |
Helper method to set a sub-vector into a vector, for the sake of clarity.
Vector | The vector type |
SubVector | The sub-vector type |
subVector | The sub-vector | |
blockId | The block index in vector | |
blockSize | The size of the sub-vector | |
[out] | vector | The vector to set the sub-vector into |
|
inline |
Extract the unique vector from the skew-symmetric part of a given matrix.
T | the numeric data type used for arguments and the return value. Can usually be deduced. |
MOpt | the option flags (alignment etc.) used for the matrix argument. Can be deduced. |
matrix | the matrix to compute the skew symmetric part from. |
void SurgSim::Math::solve | ( | const T & | a, |
const T & | b, | ||
const T & | c, | ||
const T & | epsilon, | ||
int * | numRoots, | ||
std::array< T, N > * | roots | ||
) |
Specialized solve routine for quadratic polynomials (3 coefficients)
N | maximum number of roots that can be stored |
T | type of the coefficients and computations |
a | coefficient of the square term |
b | coefficient of the linear term |
c | coefficient of the constant term |
epsilon | tolerance parameter for determining the number of valid, unique roots |
numRoots | [out] number of roots calculated, or DEGENERATE if there are infinitely many |
roots | [out] array containing the calculated roots ordered ascendingly |
if | there are more than N roots |
void SurgSim::Math::solve | ( | const T & | a, |
const T & | b, | ||
const T & | epsilon, | ||
int * | numRoots, | ||
std::array< T, N > * | roots | ||
) |
Specialized solve routine for linear polynomials (2 coefficients)
N | maximum number of roots that can be stored |
T | type of the coefficients and computations |
a | coefficient of the linear term |
b | coefficient of the constant term |
epsilon | tolerance parameter for determining the number of valid, unique roots |
numRoots | [out] number of roots calculated, or DEGENERATE if there are infinitely many |
roots | [out] array containing the calculated roots ordered ascendingly |
if | there are more than N roots |
Polynomial< T, 0 > SurgSim::Math::square | ( | const Polynomial< T, 0 > & | p | ) |
Square a degree 0 polynomial.
T | underlying data type over which the interval is defined. |
p | polynomial of degree 0 |
Polynomial< T, 2 > SurgSim::Math::square | ( | const Polynomial< T, 1 > & | p | ) |
Square a degree 1 polynomial.
T | underlying data type over which the interval is defined. |
p | polynomial of degree 1 |
int SurgSim::Math::timesOfCoplanarityInRange01 | ( | const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> & | A, |
const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> & | B, | ||
const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> & | C, | ||
const std::pair< Eigen::Matrix< T, 3, 1, MOpt >, Eigen::Matrix< T, 3, 1, MOpt >> & | D, | ||
std::array< T, 3 > * | timesOfCoplanarity | ||
) |
Test when 4 points are coplanar in the range [0..1] given their linear motion.
T | The scalar type |
MOpt | The matrix options |
A,B,C,D | the 4 point' motion (each has a pair from -> to) | |
[out] | timesOfCoplanarity | The normalized times (in [0..1]) at which the 4 points are coplanar |
Let's define the following: A(t) = A0 + t * VA with VA = A1 - A0 Similarily for B(t), C(t) and D(t) Therefore we have AB(t) = B(t) - A(t) = B(0) + t * VB - A(0) - t * VA = AB(0) + t * [VB - VA] = AB(0) + t * VAB
The 4 points ABCD are coplanar are time t if they verify: [AB(t).cross(CD(t))].AC(t) = 0 We develop this equation to clearly formulate the resulting cubic equation:
[AB(0).cross(CD(0)) + t*AB(0).cross(VCD) + t*VAB.cross(CD(0)) + t^2*VAB.cross(VCD)] . [AC(0) + t * VAC] = 0 t^0 * [[AB(0).cross(CD(0))].AC(0)] + t^1 * [[AB(0).cross(CD(0))].VAC + [AB(0).cross(VCD)].AC(0) + [VAB.cross(CD(0))].AC(0)] + t^2 * [[AB(0).cross(VCD)].VAC + [VAB.cross(CD(0))].VAC + [VAB.cross(VCD)].AC(0)] + t^3 * [[VAB.cross(VCD)].VAC] = 0
Eigen::AlignedBox<Scalar, Dim> SurgSim::Math::transformAabb | ( | const Eigen::Transform< Scalar, Dim, Eigen::Isometry > & | transform, |
const Eigen::AlignedBox< Scalar, Dim > & | aabb | ||
) |
Rotate the extrema of the aabb, note that that will extend the size of the box.
Scalar | numeric type |
Dim | dimension of the space to be used |
transform | The Rigidtransform to use |
aabb | the aabb to transform |
Interval<T> SurgSim::Math::tripleProduct | ( | const LinearMotionND< T, 3 > & | a, |
const LinearMotionND< T, 3 > & | b, | ||
const LinearMotionND< T, 3 > & | c, | ||
const Interval< T > & | range | ||
) |
Calculate the triple product, as an interval.
T | underlying type of the linear motion |
a | the first linear motion 3 group |
b | the second linear motion 3 group |
c | the third linear motion 3 group |
range | the range over which the triple product is to be evaluated |
Interval< T > SurgSim::Math::valuesOverInterval | ( | const Polynomial< T, N > & | p, |
const Interval< T > & | interval | ||
) |
Calculate the minimum and maximum values of the dependent variable over a specified range of the independent variable.
N | degree of the polynomial being managed |
T | type of the coefficients and computations |
p | polynomial on which the value calculations are based |
interval | an interval on the independent variable over which the values are to be calculated |
void SurgSim::Math::zeroColumn | ( | size_t | column, |
Eigen::DenseBase< Derived > * | matrix | ||
) |
Helper method to zero a column of a matrix.
Matrix | The matrix type |
column | The column to set to zero | |
[in,out] | matrix | The matrix to set the zero column on. |
|
inline |
Helper method to zero a column of a matrix specialized for Sparse Matrices.
column | The column to set to zero | |
[in,out] | matrix | The matrix to set the zero column on. |
void SurgSim::Math::zeroRow | ( | size_t | row, |
Eigen::DenseBase< Derived > * | matrix | ||
) |
Helper method to zero a row of a matrix.
Matrix | The matrix type |
row | The row to set to zero | |
[in,out] | matrix | The matrix to set the zero row on. |
void SurgSim::Math::zeroRow | ( | size_t | row, |
Eigen::SparseMatrix< T, Opt, Index > * | matrix | ||
) |
Helper method to zero a row of a matrix specialized for Sparse Matrices.
row | The row to set to zero | |
[in,out] | matrix | The matrix to set the zero row on. |
const std::array< gaussQuadraturePoint, 100 > SurgSim::Math::gaussQuadrature100Points |
1D 100-points Gauss-Legendre quadrature \({<x_1, w_1>, <x_2, w_2>, <x_3, w_3>, ..., <x_{100}, w_{100}>}\)
const std::array< gaussQuadraturePoint, 1 > SurgSim::Math::gaussQuadrature1Point |
1D 1-point Gauss-Legendre quadrature \({<x_1, w_1>}\)
const std::array< gaussQuadratureTrianglePoint, 12 > SurgSim::Math::gaussQuadrature2DTriangle12Points |
2D triangle Gauss-Legendre quadrature 12-points \({<\xi_1, \eta_1, w_1>, ..., <\xi_{12}, \eta_{12}, w_{12}>}\)
const std::array< gaussQuadratureTrianglePoint, 3 > SurgSim::Math::gaussQuadrature2DTriangle3Points |
2D triangle Gauss-Legendre quadrature 3-points \({<\xi_1, \eta_1, w_1>, ..., <\xi_3, \eta_3, w_3>}\)
const std::array< gaussQuadratureTrianglePoint, 6 > SurgSim::Math::gaussQuadrature2DTriangle6Points |
2D triangle Gauss-Legendre quadrature 6-points \({<\xi_1, \eta_1, w_1>, ..., <\xi_6, \eta_6, w_6>}\)
const std::array< gaussQuadraturePoint, 2 > SurgSim::Math::gaussQuadrature2Points |
1D 2-points Gauss-Legendre quadrature \({<x_1, w_1>, <x_2, w_2>}\)
const std::array< gaussQuadraturePoint, 3 > SurgSim::Math::gaussQuadrature3Points |
1D 3-points Gauss-Legendre quadrature \({<x_1, w_1>, <x_2, w_2>, <x_3, w_3>}\)
const std::array< gaussQuadraturePoint, 4 > SurgSim::Math::gaussQuadrature4Points |
1D 4-points Gauss-Legendre quadrature \({<x_1, w_1>, <x_2, w_2>, <x_3, w_3>, <x_4, w_4>}\)
const std::array< gaussQuadraturePoint, 5 > SurgSim::Math::gaussQuadrature5Points |
1D 5-points Gauss-Legendre quadrature \({<x_1, w_1>, <x_2, w_2>, <x_3, w_3>, <x_4, w_4>, <x_5, w_5>}\)
const std::unordered_map<IntegrationScheme, std::string, std::hash<int> > SurgSim::Math::IntegrationSchemeNames |
const std::unordered_map<LinearSolver, std::string, std::hash<int> > SurgSim::Math::LinearSolverNames |