static auto hue_offset = 0.0f;
static auto prevScreenPos = ZERO;
auto step = M_PI * 2.0f / 72.0f;
auto screenPos = ZERO;
for (auto rotation = 0.0f; rotation <= M_PI * 2.0f; rotation += step)
{
Vector pos(radius * cos(rotation) + origin.x, radius * sin(rotation) + origin.y, origin.z);
Ray_t ray;
trace_t trace;
CTraceFilter filter;
ray.Init(origin, pos);
filter.pSkip = local;
m_trace()->TraceRay(ray, MASK_SHOT_BRUSHONLY, &filter, &trace);
if (math::w2s(trace.endpos, screenPos))
{
if (!prevScreenPos.is_zero())
{
auto hue = RAD2DEG(rotation) + hue_offset;
float r, g, b;
HSV_TO_RGB(hue / 360.0f, 1.0f, 1.0f, r, g, b);
render::draw_line(prevScreenPos.x, prevScreenPos.y, screenPos.x, screenPos.y, Color(r, g, b));
}
prevScreenPos = screenPos;
}
}
hue_offset += 3.f;