summaryrefslogtreecommitdiff
path: root/src/ocean/ocean.cpp
diff options
context:
space:
mode:
authorsotech117 <michael_foiani@brown.edu>2024-04-09 22:31:21 -0400
committersotech117 <michael_foiani@brown.edu>2024-04-09 22:31:21 -0400
commitfd19124693bb32835ad97802ba1950cd5202dbd2 (patch)
tree9b1b8d8e64793c2c7f0c164b7df59fba91e3bab0 /src/ocean/ocean.cpp
parent8d27ce5bd6902ba515a1e3bad5f2e4d5abd825d3 (diff)
fix off by one bug
Diffstat (limited to 'src/ocean/ocean.cpp')
-rw-r--r--src/ocean/ocean.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ocean/ocean.cpp b/src/ocean/ocean.cpp
index 1b0e23c..eabaa8e 100644
--- a/src/ocean/ocean.cpp
+++ b/src/ocean/ocean.cpp
@@ -140,8 +140,8 @@ int ocean::k_index_to_negative_k_index
int x = k_index % length;
int z = k_index / length;
- int x_neg = length - x;
- int z_neg = width - z;
+ int x_neg = length - x - 1;
+ int z_neg = width - z - 1;
return z_neg * length + x_neg;
}
@@ -234,7 +234,7 @@ std::vector<Eigen::Vector3f> ocean::get_vertices()
//if (i < length)
double amplitude = current_h[i].first;
- if (i < length) amplitude = initial_h[i].first;
+ // if (i < length) amplitude = initial_h[i].first;
//if (i==2) std::cout << amplitude << std::endl;