From 12d1bbdfad42996754039ac6aeb1aa2b033a4d72 Mon Sep 17 00:00:00 2001
From: Justin Carpentier <justin.carpentier@inria.fr>
Date: Fri, 5 Jan 2024 19:35:46 +0100
Subject: [PATCH] narrowphase: fix missing computation of local AABB

---
 include/hpp/fcl/internal/traversal_node_hfield_shape.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/hpp/fcl/internal/traversal_node_hfield_shape.h b/include/hpp/fcl/internal/traversal_node_hfield_shape.h
index 47f4bb8d..1774c68f 100644
--- a/include/hpp/fcl/internal/traversal_node_hfield_shape.h
+++ b/include/hpp/fcl/internal/traversal_node_hfield_shape.h
@@ -486,6 +486,12 @@ class HeightFieldShapeCollisionTraversalNode
     ConvexTriangle convex1, convex2;
     details::buildConvexTriangles(node, *this->model1, convex1, convex2);
 
+    // Compute aabb_local for BoundingVolumeGuess case in the GJK solver
+    if (nsolver->gjk_initial_guess == GJKInitialGuess::BoundingVolumeGuess) {
+      convex1.computeLocalAABB();
+      convex2.computeLocalAABB();
+    }
+
     FCL_REAL distance;
     //    Vec3f contact_point, normal;
     Vec3f c1, c2, normal, normal_top;
-- 
GitLab