Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/helpers/Render.h
Show First 20 Lines • Show All 174 Lines • ▼ Show 20 Lines | |||||
* @param[out] dashedLineOut The dashed line returned as a list of smaller lines | * @param[out] dashedLineOut The dashed line returned as a list of smaller lines | ||||
* @param[in] dashLength Length of a single dash. Must be strictly positive. | * @param[in] dashLength Length of a single dash. Must be strictly positive. | ||||
* @param[in] blankLength Length of a single blank between dashes. Must be strictly positive. | * @param[in] blankLength Length of a single blank between dashes. Must be strictly positive. | ||||
*/ | */ | ||||
void ConstructDashedLine(const std::vector<CVector2D>& linePoints, SDashedLine& dashedLineOut, | void ConstructDashedLine(const std::vector<CVector2D>& linePoints, SDashedLine& dashedLineOut, | ||||
const float dashLength, const float blankLength); | const float dashLength, const float blankLength); | ||||
/** | /** | ||||
* Computes angular step parameters @p out_stepAngle and @p out_numSteps, given a @p maxChordLength on a circle of radius @p radius. | |||||
* The resulting values satisfy @p out_numSteps * @p out_stepAngle = 2*PI. | |||||
* | |||||
* This function is used to find the angular step parameters when drawing a circle outline approximated by several connected chords; | |||||
* it returns the step angle and number of steps such that the length of each resulting chord is less than or equal to @p maxChordLength. | |||||
* By stating that each chord cannot be longer than a particular length, a certain level of visual smoothness of the resulting circle | |||||
* outline can be guaranteed independently of the radius of the outline. | |||||
* | |||||
* @param radius Radius of the circle. Must be strictly positive. | |||||
* @param maxChordLength Desired maximum length of individual chords. Must be strictly positive. | |||||
*/ | |||||
void AngularStepFromChordLen(const float maxChordLength, const float radius, float& out_stepAngle, unsigned& out_numSteps); | |||||
/** | |||||
* Subdivides a list of @p points into segments of maximum length @p maxSegmentLength that are of equal size between every two | * Subdivides a list of @p points into segments of maximum length @p maxSegmentLength that are of equal size between every two | ||||
* control points. The resulting subdivided list of points is written back to @p points. | * control points. The resulting subdivided list of points is written back to @p points. | ||||
* | * | ||||
* @param points The list of intermediate points to subdivide. | * @param points The list of intermediate points to subdivide. | ||||
* @param maxSegmentLength The maximum length of a single segment after subdivision. Must be strictly positive. | * @param maxSegmentLength The maximum length of a single segment after subdivision. Must be strictly positive. | ||||
* @param closed Should the provided list of points be treated as a closed shape? If true, the resulting list of points will include | * @param closed Should the provided list of points be treated as a closed shape? If true, the resulting list of points will include | ||||
* extra subdivided points between the last and the first point. | * extra subdivided points between the last and the first point. | ||||
*/ | */ | ||||
void SubdividePoints(std::vector<CVector2D>& points, float maxSegmentLength, bool closed); | void SubdividePoints(std::vector<CVector2D>& points, float maxSegmentLength, bool closed); | ||||
} // namespace | } // namespace | ||||
#endif // INCLUDED_HELPER_RENDER | #endif // INCLUDED_HELPER_RENDER |
Wildfire Games · Phabricator