auto draw_square_beam = [&](const Vector vecStartPosition, const float square_size = 10.0f)
{
Vector v1(vecStartPosition.x - square_size, vecStartPosition.y - square_size, vecStartPosition.z); // bottom left
Vector v2(vecStartPosition.x + square_size, vecStartPosition.y - square_size, vecStartPosition.z); // bottom right
Vector v3(vecStartPosition.x + square_size, vecStartPosition.y + square_size, vecStartPosition.z); // top right
Vector v4(vecStartPosition.x - square_size, vecStartPosition.y + square_size, vecStartPosition.z); // top left
BeamInfo_t beam_info;
beam_info.m_vecStart = v1;
beam_info.m_vecEnd = v2;
beam_info.m_nType = TE_BEAMPOINTS;
beam_info.m_pszModelName = "sprites/purplelaser1.vmt";
beam_info.modelindex = -1;
beam_info.m_flHaloScale = 0.0f;
beam_info.m_flLife = 1.0f;
beam_info.m_flWidth = 2.0f;
beam_info.m_flEndWidth = 2.0f;
beam_info.m_flFadeLength = 0.0f;
beam_info.m_flAmplitude = 2.0f;
beam_info.m_flBrightness = (float)Color(120, 120, 255, 255).a();
beam_info.m_flSpeed = 0.2f;
beam_info.m_nStartFrame = 0;
beam_info.m_flFrameRate = 0.0f;
beam_info.m_flRed = (float)Color(120, 120, 255, 255).r();
beam_info.m_flGreen = (float)Color(120, 120, 255, 255).g();
beam_info.m_flBlue = (float)Color(120, 120, 255, 255).b();
beam_info.m_nSegments = 2;
beam_info.m_bRenderable = true;
beam_info.m_nFlags = FBEAM_SHADEIN | FBEAM_ONLYNOISEONCE | FBEAM_NOTILE | FBEAM_HALOBEAM;
auto beam = Interfaces::Beams->CreateBeamPoints(beam_info);
if (beam)
Interfaces::Beams->DrawBeam(beam);
beam_info.m_vecStart = v2;
beam_info.m_vecEnd = v3;
beam = Interfaces::Beams->CreateBeamPoints(beam_info);
if (beam)
Interfaces::Beams->DrawBeam(beam);
beam_info.m_vecStart = v3;
beam_info.m_vecEnd = v4;
beam = Interfaces::Beams->CreateBeamPoints(beam_info);
if (beam)
Interfaces::Beams->DrawBeam(beam);
beam_info.m_vecStart = v4;
beam_info.m_vecEnd = v1;
beam = Interfaces::Beams->CreateBeamPoints(beam_info);
if (beam)
Interfaces::Beams->DrawBeam(beam);
};