AGX Dynamics  2.37.2.0
agxCollide::agxGeometryQueries::LineSegment Class Reference

A line segment. Note that the direction does not have to be normalized. More...

#include <LineSegmentIntersectionFinder.h>

Public Member Functions

 LineSegment (const agx::Vec3 &point0, const agx::Vec3 &point1)
 Creates a line segment given two end points. More...
 
 LineSegment ()
 Creates an empty line segment, with both end points at origin. More...
 
bool containsPoint (const agx::Vec3 &point, const agx::Real epsilon=agx::RealEpsilon) const
 Does the line segment contain the point, given an epsilon threshold? More...
 
const agx::Vec3 & dir () const
 Gets the direction; not necessarily normalized. More...
 
agx::Real dirLength2 () const
 Gets the squared length of the line direction. More...
 
agx::Vec3 evaluateAt (const agx::Real lineParameter) const
 Evaluates the line equation at the parameter. More...
 
agxGeometryQueries::Line getLine () const
 Gets the line segment's line. More...
 
bool isDegeneratedToPoint () const
 Is the line segment degenerated to a point? More...
 
const agx::Vec3 & point0 () const
 Gets the line segment's first point. More...
 
const agx::Vec3 & point1 () const
 Gets the line segment's second point. More...
 
agx::Real projectPointToInfiniteLine (const agx::Vec3 &point) const
 Computes the scalar value of the projection of a point along the segment's line. More...
 

Detailed Description

A line segment. Note that the direction does not have to be normalized.

Definition at line 83 of file LineSegmentIntersectionFinder.h.

Constructor & Destructor Documentation

◆ LineSegment() [1/2]

agxCollide::agxGeometryQueries::LineSegment::LineSegment ( const agx::Vec3 &  point0,
const agx::Vec3 &  point1 
)

Creates a line segment given two end points.

Definition at line 301 of file LineSegmentIntersectionFinder.h.

◆ LineSegment() [2/2]

agxCollide::agxGeometryQueries::LineSegment::LineSegment ( )

Creates an empty line segment, with both end points at origin.

Definition at line 307 of file LineSegmentIntersectionFinder.h.

Member Function Documentation

◆ containsPoint()

bool agxCollide::agxGeometryQueries::LineSegment::containsPoint ( const agx::Vec3 &  point,
const agx::Real  epsilon = agx::RealEpsilon 
) const

Does the line segment contain the point, given an epsilon threshold?

Definition at line 321 of file LineSegmentIntersectionFinder.h.

References agx::Vec3T< T >::length2(), and projectPointToInfiniteLine().

◆ dir()

const agx::Vec3 & agxCollide::agxGeometryQueries::LineSegment::dir ( ) const

Gets the direction; not necessarily normalized.

Definition at line 356 of file LineSegmentIntersectionFinder.h.

Referenced by getLine().

◆ dirLength2()

agx::Real agxCollide::agxGeometryQueries::LineSegment::dirLength2 ( ) const

Gets the squared length of the line direction.

Definition at line 362 of file LineSegmentIntersectionFinder.h.

◆ evaluateAt()

agx::Vec3 agxCollide::agxGeometryQueries::LineSegment::evaluateAt ( const agx::Real  lineParameter) const

Evaluates the line equation at the parameter.

Note that no sanity check on the parameter is being done, only values between 0 and 1 make sense.

Parameters
lineParameterThe line parameter (should be in [0,1]).
Return values
Thepoint at the line segment given the parameter.

Definition at line 368 of file LineSegmentIntersectionFinder.h.

Referenced by agxCollide::agxGeometryQueries::SweptLineSegment::evaluateAt().

◆ getLine()

agxGeometryQueries::Line agxCollide::agxGeometryQueries::LineSegment::getLine ( ) const

Gets the line segment's line.

Definition at line 338 of file LineSegmentIntersectionFinder.h.

References dir(), and point0().

◆ isDegeneratedToPoint()

bool agxCollide::agxGeometryQueries::LineSegment::isDegeneratedToPoint ( ) const

◆ point0()

◆ point1()

◆ projectPointToInfiniteLine()

agx::Real agxCollide::agxGeometryQueries::LineSegment::projectPointToInfiniteLine ( const agx::Vec3 &  point) const

Computes the scalar value of the projection of a point along the segment's line.

Definition at line 312 of file LineSegmentIntersectionFinder.h.

References isDegeneratedToPoint().

Referenced by containsPoint().


The documentation for this class was generated from the following file: