From 06f12a93725fac5eb731eddfc5735623967f88bb Mon Sep 17 00:00:00 2001 From: Kyle Bayes Date: Wed, 15 Jul 2026 07:50:16 -0700 Subject: [PATCH] Set max in hill climbing support. When imax is the optimal index then this reduces from three iterations down to one. PiperOrigin-RevId: 948334160 Change-Id: Ia12fbc853fc65f70c525a617cfdced6e98d30dca --- src/engine/engine_collision_convex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/engine_collision_convex.c b/src/engine/engine_collision_convex.c index f823ec21..02e5bce3 100644 --- a/src/engine/engine_collision_convex.c +++ b/src/engine/engine_collision_convex.c @@ -406,9 +406,9 @@ static void mjc_hillclimbSupport(mjtNum res[3], mjCCDObj* obj, const mjtNum dir[ mjtNum local_dir[3]; mulMatTVec3(local_dir, mat, dir); - mjtNum max = -FLT_MAX; int prev = -1; int imax = obj->meshindex >= 0 ? obj->meshindex : 0; + mjtNum max = dot3f(local_dir, verts + 3*vert_globalid[imax]); // hillclimb until no change while (imax != prev) {