Radium Engine
1.5.20
|
#include <Core/Geometry/PolyLine.hpp>
Public Member Functions | |
PolyLine (const Vector3Array &pt) | |
Create a polyline from a given set of points. | |
const Vector3Array & | getPoints () const |
Get the point vector. | |
void | getSegment (uint segment, Vector3 &aOut, Vector3 &abOut) const |
Get the ith segment AB as starting point A and vector AB. | |
const Vector3Array & | getSegmentVectors () const |
Get the segment vector ( Pi+1 - Pi) | |
Aabb | aabb () const |
Get the aabb of the polyline. | |
Scalar | length () const |
Get the total length of the line . | |
void | setPoints (const Vector3Array &pt) |
Update the points of the polyline. | |
Scalar | squaredDistance (const Vector3 &p) const |
Return the squared distance between the line and a given point p. | |
Scalar | distance (const Vector3 &p) const |
Return the distance between the line and a given point p. | |
Scalar | projectOnSegment (const Vector3 &p, uint segment) const |
uint | getNearestSegment (const Vector3 &p) const |
Returns the index of the nearest segment. | |
uint | getSegmentIndex (Scalar t) const |
Returns the index of the segment to which t belons. | |
Scalar | project (const Vector3 &p) const |
Vector3 | f (Scalar t) const |
Protected Member Functions | |
void | update () |
Update the precomputed values after new points have been set. | |
Scalar | getLineParameter (uint segment, Scalar tSegment) const |
A parametrized polyline, i.e. a continuous polygonal chain of segments. Points go from P0 to Pn. The ith segments joins Pi and Pi+1.
Definition at line 14 of file PolyLine.hpp.
|
explicit |
Create a polyline from a given set of points.
Definition at line 21 of file PolyLine.cpp.
|
inline |
Get the aabb of the polyline.
Definition at line 89 of file PolyLine.hpp.
Scalar Ra::Core::Geometry::PolyLine::distance | ( | const Vector3 & | p | ) | const |
Return the distance between the line and a given point p.
Definition at line 39 of file PolyLine.cpp.
Vector3 Ra::Core::Geometry::PolyLine::f | ( | Scalar | t | ) | const |
Return a point on the line corresponding to parameter t in [0;1]. Values of t below 0 map to the first point, and values above 1 to the last.
Definition at line 91 of file PolyLine.cpp.
|
inlineprotected |
Given a point on one of the segments identified by parameter tSegment in [0,1] and segment number, return the t in [0,1] corresponding to the same point in the whole line parametrization.
Definition at line 97 of file PolyLine.hpp.
uint Ra::Core::Geometry::PolyLine::getNearestSegment | ( | const Vector3 & | p | ) | const |
Returns the index of the nearest segment.
Definition at line 109 of file PolyLine.cpp.
|
inline |
Get the point vector.
Definition at line 81 of file PolyLine.hpp.
|
inline |
Get the ith segment AB as starting point A and vector AB.
Definition at line 104 of file PolyLine.hpp.
|
inline |
Returns the index of the segment to which t belons.
Definition at line 114 of file PolyLine.hpp.
|
inline |
Get the segment vector ( Pi+1 - Pi)
Definition at line 110 of file PolyLine.hpp.
|
inline |
Get the total length of the line .
Definition at line 85 of file PolyLine.hpp.
Scalar Ra::Core::Geometry::PolyLine::project | ( | const Vector3 & | p | ) | const |
Returns the parameter t in [0,1] corresponding to the point on the line which is the closest point from p.
Definition at line 49 of file PolyLine.cpp.
Scalar Ra::Core::Geometry::PolyLine::projectOnSegment | ( | const Vector3 & | p, |
uint | segment ) const |
Returns the parameter t in [0,1] corresponding to the point on the ith segment closest from point p.
Definition at line 43 of file PolyLine.cpp.
void Ra::Core::Geometry::PolyLine::setPoints | ( | const Vector3Array & | pt | ) |
Update the points of the polyline.
Definition at line 25 of file PolyLine.cpp.
Scalar Ra::Core::Geometry::PolyLine::squaredDistance | ( | const Vector3 & | p | ) | const |
Return the squared distance between the line and a given point p.
Definition at line 30 of file PolyLine.cpp.
|
protected |
Update the precomputed values after new points have been set.
Definition at line 7 of file PolyLine.cpp.