terrain

Real-time terrain generation using marching cubes
git clone git://git.christianermann.dev/terrain
Log | Files | Refs | README | LICENSE

commit 009c2505e27cac7facef7653bd897f30ed9c3e9b
parent 1ae6960c52fd10d39c232361c8e31cc4a31e626f
Author: Christian Ermann <christianermann@gmail.com>
Date:   Mon, 16 Aug 2021 14:51:58 -0500

Renamed interpVertex to interpolateVertexPosition

Diffstat:
Msrc/marching_cubes.c | 13++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/marching_cubes.c b/src/marching_cubes.c @@ -304,8 +304,8 @@ int MC_index(const Vec3 corners[8], SDF f, float isolevel) return mc_index; } -static void MC_interpVertex(const Vec3 a, const Vec3 b, SDF f, float isolevel, - Vec3 dst) +static void MC_interpolateVertexPosition(const Vec3 a, const Vec3 b, SDF f, + float isolevel, Vec3 dst) { float fa = f(a); float fb = f(b); @@ -335,15 +335,18 @@ int MC_vertices(const Vec3 corners[8], SDF f, float isolevel, int mc_index, { if (EDGE_TABLE[mc_index] & 1) { - MC_interpVertex(corners[0], corners[1], f, isolevel, vertices[0]); + MC_interpolateVertexPosition(corners[0], corners[1], f, isolevel, + vertices[0]); } if (EDGE_TABLE[mc_index] & 8) { - MC_interpVertex(corners[3], corners[0], f, isolevel, vertices[1]); + MC_interpolateVertexPosition(corners[3], corners[0], f, isolevel, + vertices[1]); } if (EDGE_TABLE[mc_index] & 256) { - MC_interpVertex(corners[0], corners[4], f, isolevel, vertices[2]); + MC_interpolateVertexPosition(corners[0], corners[4], f, isolevel, + vertices[2]); } return 3; }