CGPdocs

trajectory_drawable

Trail of the last positions of a moving point, drawn as a curve.

Fields and methods

Members of the struct trajectory_drawable. Most of what you do with a CGP type goes through the free functions listed below.

Fields

numarray<vec3> position_recordRecorded positions, the most recent first, allocated to N_max_sample points at the first call to add.
curve_drawable visualCurve drawable displaying the first current_size recorded positions, red by default; its color and model can be set at any time, also before the first add.
size_t N_max_sampleMaximal number of positions kept in the trajectory, 100 by default.
size_t current_sizeNumber of valid positions recorded so far, at most N_max_sample.

Methods

Builds an empty trajectory keeping at most N_max_sample positions, the GPU data being created at the first call to add. src
Erases the recorded positions, releases the GPU data of the curve and sets current_size to 0, keeping the color and model of visual. src
Inserts a position at the front of the record, dropping the oldest one when N_max_sample is reached, and re-uploads the whole record to the VBO of the curve (asserts N_max_sample > 0). src

Functions taking a trajectory_drawable

Draw 1

void draw(trajectory_drawable const& drawable, environment_generic_structure const& environment)

Draw the recorded positions of a trajectory_drawable as a polyline, if any.

Functions returning a trajectory_drawable

None.

Operators

None.

CGP - Computer Graphics Programming.