Sfoglia il codice sorgente

simplex_interpolator: bug fix on negative values.

undefined
Guillaume Bittoun Sam Hocevar <sam@hocevar.net> 10 anni fa
parent
commit
a815a788e6
2 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. +1
    -1
      src/lol/math/simplex_interpolator.h
  2. +2
    -2
      src/t/math/simplex_interpolator.cpp

+ 1
- 1
src/lol/math/simplex_interpolator.h Vedi File

@@ -117,7 +117,7 @@ protected:
{
// Finding floor point index
for (int i = 0 ; i < N ; ++i)
floor_point[i] = (int) simplex_position[i];
floor_point[i] = ((int) simplex_position[i]) - (simplex_position[i] < 0 ? 1 : 0);

// Extracting decimal part from simplex sample
for (int i = 0 ; i < N ; ++i)


+ 2
- 2
src/t/math/simplex_interpolator.cpp Vedi File

@@ -226,9 +226,9 @@ lolunit_declare_fixture(SimplexInterpolatorTest)
s.SetGradients(gradients);

std::cout << std::endl;
for (int i = 0 ; i < 32 ; ++i)
for (int i = -64 ; i < 64 ; ++i)
{
for (int j = 0 ; j < 32 ; ++j)
for (int j = -64 ; j < 64 ; ++j)
{
std::cout << s.Interp(vec_t<float, 2>({i * 0.1f, j * 0.1f})) << ", ";
}


Caricamento…
Annulla
Salva