From 262667e8dd29a428dcf4098cf02e96e0e562c6f4 Mon Sep 17 00:00:00 2001 From: Priyatham Sai Chand Date: Tue, 8 Nov 2022 22:47:32 -0800 Subject: [PATCH] navmesh variable name change --- NavMesh.pde | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/NavMesh.pde b/NavMesh.pde index ef27a00..997037f 100644 --- a/NavMesh.pde +++ b/NavMesh.pde @@ -265,28 +265,25 @@ class NavMesh } - - - - + PVector index_point = vertices.get(convex_index); int next_index = convex_index + 1; if (next_index >= vertices.size()) next_index = 0; - int lastIndex = convex_index - 1; - if (lastIndex < 0) lastIndex = vertices.size() - 1; + int last_index = convex_index - 1; + if (last_index < 0) last_index = vertices.size() - 1; - for (int conn_point = vertices.size()-1; conn_point>=0; conn_point--) + for (int i = vertices.size()-1; i>=0; i--) { - if (conn_point == next_index || conn_point == convex_index || conn_point == lastIndex) continue; + if (i == next_index || i == convex_index || i == last_index) continue; - PVector conn_pointPoint = vertices.get(conn_point); + PVector point_vertex = vertices.get(i); - if (!intersectsWall(pointAtIndex, conn_pointPoint)) + if (!intersectsWall(index_point, point_vertex)) { - return conn_point; + return i; } }