From f0f278a9a2945821415fb5bb93474f17aeb3bd4e Mon Sep 17 00:00:00 2001 From: Adam Rohdin Date: Tue, 7 Mar 2023 16:19:33 +0100 Subject: [PATCH] Updated comments in order to adhere to the repo line length standard --- .../rendering/renderabletrailtrajectory.cpp | 22 +++++++++++++------ .../rendering/renderabletrailtrajectory.h | 7 +++--- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/modules/base/rendering/renderabletrailtrajectory.cpp b/modules/base/rendering/renderabletrailtrajectory.cpp index 5883360365..68120b0427 100644 --- a/modules/base/rendering/renderabletrailtrajectory.cpp +++ b/modules/base/rendering/renderabletrailtrajectory.cpp @@ -86,7 +86,8 @@ namespace { constexpr openspace::properties::Property::PropertyInfo SweepChunkSizeInfo = { "SweepChunkSize", "Sweep Chunk Size", - "The number of vertices that will be calculated each frame whenever the trail needs to be recalculated. " + "The number of vertices that will be calculated each frame whenever the trail " + "needs to be recalculated. " "A greater value will result in more calculations per frame." }; @@ -206,12 +207,18 @@ void RenderableTrailTrajectory::update(const UpdateData& data) { _totalSampleInterval = _sampleInterval / _timeStampSubsamplingFactor; - // Cap _numberOfVertices in order to prevent overflow and extreme performance degredation/RAM usage - _numberOfVertices = std::min(static_cast(timespan / _totalSampleInterval), maxNumberOfVertices); + // Cap _numberOfVertices in order to prevent overflow and extreme performance + // degredation/RAM usage + _numberOfVertices = std::min( + static_cast(timespan / _totalSampleInterval), + maxNumberOfVertices + ); - // We need to recalcuate the _totalSampleInterval if _numberOfVertices eqals maxNumberOfVertices - // If we don't do this the position for each vertex will not be correct for the number of vertices we are doing along the trail. - _totalSampleInterval = (_numberOfVertices == maxNumberOfVertices) ? (timespan / _numberOfVertices) : _totalSampleInterval; + // We need to recalcuate the _totalSampleInterval if _numberOfVertices eqals + // maxNumberOfVertices. If we don't do this the position for each vertex + // will not be correct for the number of vertices we are doing along the trail. + _totalSampleInterval = (_numberOfVertices == maxNumberOfVertices) ? + (timespan / _numberOfVertices) : _totalSampleInterval; // Make space for the vertices _vertexArray.clear(); @@ -243,7 +250,8 @@ void RenderableTrailTrajectory::update(const UpdateData& data) { setBoundingSphere(glm::distance(_maxVertex, _minVertex) / 2.f); } else { - // Early return as we don't need to render if we are still doing full sweep calculations + // Early return as we don't need to render if we are still + // doing full sweep calculations return; } diff --git a/modules/base/rendering/renderabletrailtrajectory.h b/modules/base/rendering/renderabletrailtrajectory.h index eb3d8e8988..704e072dae 100644 --- a/modules/base/rendering/renderabletrailtrajectory.h +++ b/modules/base/rendering/renderabletrailtrajectory.h @@ -64,7 +64,7 @@ private: /// Reset some variables to default state void reset(); - /// The number of vertices that we do calculations for during each frame of the full sweep pass + /// The number of vertices that we calculate during each frame of the full sweep pass unsigned int _sweepChunkSize = 200; /// The start time of the trail @@ -92,10 +92,11 @@ private: /// The conversion of the _endTime into the internal time format double _end = 0.0; - /// Keeps track of the sweep iteration and is used to calculate which vertices we work on each frame. + /// Tracks sweep iteration, is used to calculate which vertices to work on per frame int _sweepIteration = 0; - /// How many values do we need to compute given the distance between the start and end date and the desired sample interval + /// How many points do we need to compute given the distance between the + /// start and end date and the desired sample interval unsigned int _numberOfVertices = 0; double _totalSampleInterval = 0.0;