Open Inventor Reference
SbLine Class Reference

Directed line in 3D. More...

#include <Inventor/SbLinear.h>

Public Member Functions

 SbLine ()
 Constructors.
 
 SbLine (const SbVec3f &p0, const SbVec3f &p1)
 Constructors.
 
void setValue (const SbVec3f &p0, const SbVec3f &p1)
 Sets line to pass through points p0 and p1.
 
bool getClosestPoints (const SbLine &line2, SbVec3f &ptOnThis, SbVec3f &ptOnLine2) const
 Finds the two closest points between this line and line2, and loads them into ptOnThis and ptOnLine2.
 
SbVec3f getClosestPoint (const SbVec3f &point) const
 Returns the closest point on the line to the given point.
 
const SbVec3f & getPosition () const
 Returns position of line origin point and direction vector of line.
 
const SbVec3f & getDirection () const
 Returns position of line origin point and direction vector of line.
 
bool intersect (const SbBox3f &box, SbVec3f &enter, SbVec3f &exit) const
 Intersect the line with a box, point, line, and triangle.
 
bool intersect (float angle, const SbBox3f &box) const
 
bool intersect (float angle, const SbVec3f &point) const
 
bool intersect (float angle, const SbVec3f &v0, const SbVec3f &v1, SbVec3f &pt) const
 
bool intersect (const SbVec3f &v0, const SbVec3f &v1, const SbVec3f &v2, SbVec3f &pt, SbVec3f &barycentric, bool &front) const
 

Detailed Description

Represents a directed line in 3D. This is a basic Inventor datatype that is used for representing a 3D line. It is used as input and output by a variety of Inventor classes. {}

See Also
SbVec3f, SbPlane

Definition at line 1292 of file SbLinear.h.

Constructor & Destructor Documentation

◆ SbLine() [1/2]

SbLine::SbLine ( )
inline

To construct a line from a position and direction, use: SbLine(p0, p0 + dir). The line is directed from p0 to p1.

Definition at line 1296 of file SbLinear.h.

◆ SbLine() [2/2]

SbLine::SbLine ( const SbVec3f &  p0,
const SbVec3f &  p1 
)

To construct a line from a position and direction, use: SbLine(p0, p0 + dir). The line is directed from p0 to p1.

Member Function Documentation

◆ getClosestPoint()

SbVec3f SbLine::getClosestPoint ( const SbVec3f &  point) const

◆ getClosestPoints()

bool SbLine::getClosestPoints ( const SbLine &  line2,
SbVec3f &  ptOnThis,
SbVec3f &  ptOnLine2 
) const

Returns FALSE if the lines are parallel (results undefined), and returns TRUE otherwise.

◆ getDirection()

const SbVec3f & SbLine::getDirection ( ) const
inline

Definition at line 1319 of file SbLinear.h.

◆ getPosition()

const SbVec3f & SbLine::getPosition ( ) const
inline

Definition at line 1317 of file SbLinear.h.

◆ intersect() [1/5]

bool SbLine::intersect ( const SbBox3f &  box,
SbVec3f &  enter,
SbVec3f &  exit 
) const

◆ intersect() [2/5]

bool SbLine::intersect ( const SbVec3f &  v0,
const SbVec3f &  v1,
const SbVec3f &  v2,
SbVec3f &  pt,
SbVec3f &  barycentric,
bool &  front 
) const

◆ intersect() [3/5]

bool SbLine::intersect ( float  angle,
const SbBox3f &  box 
) const

◆ intersect() [4/5]

bool SbLine::intersect ( float  angle,
const SbVec3f &  point 
) const

◆ intersect() [5/5]

bool SbLine::intersect ( float  angle,
const SbVec3f &  v0,
const SbVec3f &  v1,
SbVec3f &  pt 
) const

◆ setValue()

void SbLine::setValue ( const SbVec3f &  p0,
const SbVec3f &  p1 
)

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