void CCollision::GenerateWorm(vec2 Pos, int Length) {
m_Noise.SetNoiseType(FastNoiseLite::NoiseType_Perlin);
for (int i = 0; i < Length; ++i) {
Pos += direction(
(m_Noise.GetNoise(Pos.x * 10.f, Pos.y * 10) + 1) * M_PI);
for (int dx = -1; dx <= 1; ++dx) {
for (int dy = -1; dy <= 1; ++dy) {
const int Index = std::clamp(((int)Pos.y + dy) * m_GridSize.x +
((int)Pos.x + dx),
0, (int)m_vGrid.size() - 1);
m_vGrid[Index] = 0;
}
}
}
}