Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/helpers/Render.cpp
Show First 20 Lines • Show All 555 Lines • ▼ Show 20 Lines | else | ||||
i++; | i++; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
void SimRender::AngularStepFromChordLen(const float maxChordLength, const float radius, float& out_stepAngle, unsigned& out_numSteps) | |||||
{ | |||||
float maxAngle = Geometry::ChordToCentralAngle(maxChordLength, radius); | |||||
out_numSteps = ceilf(float(2*M_PI)/maxAngle); | |||||
out_stepAngle = float(2*M_PI)/out_numSteps; | |||||
} | |||||
// TODO: this serves a similar purpose to SplitLine above, but is more general. Also, SplitLine seems to be implemented more | // TODO: this serves a similar purpose to SplitLine above, but is more general. Also, SplitLine seems to be implemented more | ||||
// efficiently, might be nice to take some cues from it | // efficiently, might be nice to take some cues from it | ||||
void SimRender::SubdividePoints(std::vector<CVector2D>& points, float maxSegmentLength, bool closed) | void SimRender::SubdividePoints(std::vector<CVector2D>& points, float maxSegmentLength, bool closed) | ||||
{ | { | ||||
size_t numControlPoints = points.size(); | size_t numControlPoints = points.size(); | ||||
if (numControlPoints < 2) | if (numControlPoints < 2) | ||||
return; | return; | ||||
Show All 31 Lines |
Wildfire Games · Phabricator