Use while loop to fix SonarScanner issue

pull/1318/head
Andrew Tribick 2022-01-08 17:14:43 +01:00 committed by ajtribick
parent 3f7bd9c13e
commit 410f86fc88
1 changed files with 2 additions and 2 deletions

View File

@ -209,11 +209,11 @@ float fractalsum(const Eigen::Vector2f& p, float freq)
float fractalsum(const Eigen::Vector3f& p, float freq)
{
float t = 0.0f;
for (t = 0.0f; freq >= 1.0f; freq *= 0.5f)
while (freq >= 1.0f)
{
Eigen::Vector3f vec = freq * p;
t += noise(vec) / freq;
freq *= 0.5f;
}
return t;