Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/simulation2/helpers/Render.cpp
Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | static void ConstructCircleOrClosedArc( | ||||
// Adapt the circle resolution to look reasonable for small and largeish radiuses | // Adapt the circle resolution to look reasonable for small and largeish radiuses | ||||
size_t numPoints = Clamp<size_t>(radius * (end - start), 12, 48); | size_t numPoints = Clamp<size_t>(radius * (end - start), 12, 48); | ||||
if (!isCircle) | if (!isCircle) | ||||
overlay.m_Coords.reserve((numPoints + 1 + 2) * 3); | overlay.m_Coords.reserve((numPoints + 1 + 2) * 3); | ||||
else | else | ||||
overlay.m_Coords.reserve((numPoints + 1) * 3); | overlay.m_Coords.reserve((numPoints + 1) * 3); | ||||
float cy; | float cy = 0.f; | ||||
if (!isCircle) | if (!isCircle) | ||||
{ | { | ||||
// Start at the center point | // Start at the center point | ||||
cy = std::max(water, cmpTerrain->GetExactGroundLevel(x, z)) + heightOffset; | cy = std::max(water, cmpTerrain->GetExactGroundLevel(x, z)) + heightOffset; | ||||
overlay.PushCoords(x, cy, z); | overlay.PushCoords(x, cy, z); | ||||
} | } | ||||
for (size_t i = 0; i <= numPoints; ++i) // use '<=' so it's a closed loop | for (size_t i = 0; i <= numPoints; ++i) // use '<=' so it's a closed loop | ||||
▲ Show 20 Lines • Show All 526 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator