Line Class Reference

#include <math.h>

Class Description

Represents a line segment in 3d space.

Definition at line 1535 of file math.h.

Public Types

enum  IntersectionResult { PARALLEL, COINCIDENT, NOT_INTERSECTING, INTERSECTING }
 Possible return values of computing intersection of 2 lines. More...
 

Public Member Functions

 Line (const Vector &vStart, const Vector &vEnd)
 Constructor, based on start and end points. More...
 
float RangeFrom (const Vector &vPoint)
 Returns the shortest distance between a given point and this line. More...
 
IntersectionResult Intersection2D (const Line &cOther, Vector &vResult, bool bSegmentOnly=false)
 Calculates intersection of 2 lines in 2D. More...
 

Member Enumeration Documentation

Possible return values of computing intersection of 2 lines.

Enumerator
PARALLEL 
COINCIDENT 
NOT_INTERSECTING 
INTERSECTING 

Definition at line 1556 of file math.h.

Constructor & Destructor Documentation

Line ( const Vector vStart,
const Vector vEnd 
)

Constructor, based on start and end points.

Member Function Documentation

float RangeFrom ( const Vector vPoint)

Returns the shortest distance between a given point and this line.

Note: The line is not logically extended to infinity in this function. Only points between the start and end point are considered part of the line.

IntersectionResult Intersection2D ( const Line cOther,
Vector vResult,
bool  bSegmentOnly = false 
)

Calculates intersection of 2 lines in 2D.

If bSegmentOnly is true it will only result the intersection point if it is between the segment endpoints, otherwise the result apply to whole lines.


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