Represents a simple straight line segment between two 3D points.
More...
#include <line_segment.h>
Represents a simple straight line segment between two 3D points.
Inherits from PathSegment and implements waypoint generation along the line.
◆ LineSegment()
Constructs a LineSegment with specified start and end points.
- Parameters
-
start | The starting point of the line segment. |
end | The ending point of the line segment. |
◆ generateWaypoints()
std::vector< easy3d::vec3 > LineSegment::generateWaypoints |
( |
float |
spacing | ) |
const |
|
overridevirtual |
Generates a set of waypoints spaced along the line segment.
Generates waypoints spaced along the line segment.
- Parameters
-
spacing | The distance between consecutive waypoints. |
- Returns
- A vector of 3D points representing the waypoints on the segment.
The function calculates equally spaced points starting from the start point up to the end point based on the given spacing.
- Parameters
-
spacing | Distance between consecutive waypoints. |
- Returns
- std::vector<easy3d::vec3> A vector containing the generated waypoints.
Implements PathSegment.
◆ end_
End point of the line segment
◆ start_
Start point of the line segment
The documentation for this class was generated from the following files: