Use while loop to fix SonarScanner issue
parent
3f7bd9c13e
commit
410f86fc88
|
@ -209,11 +209,11 @@ float fractalsum(const Eigen::Vector2f& p, float freq)
|
||||||
float fractalsum(const Eigen::Vector3f& p, float freq)
|
float fractalsum(const Eigen::Vector3f& p, float freq)
|
||||||
{
|
{
|
||||||
float t = 0.0f;
|
float t = 0.0f;
|
||||||
|
while (freq >= 1.0f)
|
||||||
for (t = 0.0f; freq >= 1.0f; freq *= 0.5f)
|
|
||||||
{
|
{
|
||||||
Eigen::Vector3f vec = freq * p;
|
Eigen::Vector3f vec = freq * p;
|
||||||
t += noise(vec) / freq;
|
t += noise(vec) / freq;
|
||||||
|
freq *= 0.5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
return t;
|
return t;
|
||||||
|
|
Loading…
Reference in New Issue