![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Core/Geometry/Line.h>
Common interface of Line and LineSegment. More...
Inheritance diagram for LineBase:Common interface of Line and LineSegment.
Unless stated otherwise, all operations that involve comparisons use the same tolerance epsilon as vec3::isApprox (which is 1e-12).
Public Member Functions | |
| virtual vec3 | direction () const =0 |
| Returns the normalized direction vector. | |
| const vec3 & | point () const |
| Returns a point on the line. | |
| vec3 | closestPoint (const vec3 &p) const |
| Returns the point on the line closest to p. | |
| double | distanceToPoint (const vec3 &p) const |
| Returns the L2 distance between p and the closest point on the line. | |
| bool | includesPoint (const vec3 &p) const |
| Returns if the distance between p and the closest point on the line is less than epsilon. | |
| std::vector< vec3 > | cylinderWallIntersection (const Line &axis, double radius) const |
| Computes the intersection points with the outer wall of a cylinder of infinite length, specified by radius and central axis. | |
Protected Member Functions | |
| LineBase (const vec3 &p) | |
Protected Attributes | |
| vec3 | m_point |
| A point on the line. | |
Point projections | |
| |
| double | pointToLambda (const vec3 &p) const |
| Projects p onto the (extended) line and returns the unclamped lambda. | |
| vec3 | lambdaToPoint (double lambda) const |
| Returns point() + lambda*direction() | |
| virtual double | clampLambda (double lambda) const =0 |
| Clamps lambda to the extent of the line. | |
|
pure virtual |
Returns the normalized direction vector.
If the object has no well defined direction, e.g. a line segment of zero length, the return value will be zero.
Implemented in Line, and LineSegment.
|
pure virtual |
Clamps lambda to the extent of the line.
Implemented in Line, and LineSegment.
| std::vector< vec3 > cylinderWallIntersection | ( | const Line & | axis, |
| double | radius ) const |
Computes the intersection points with the outer wall of a cylinder of infinite length, specified by radius and central axis.
Will return 0, 1 or 2 intersection points.