From c287d40aff2b62b50721681f6a4a7fd07f1331bb Mon Sep 17 00:00:00 2001 From: Ramine Agoune Date: Mon, 15 Dec 2025 17:32:48 +0100 Subject: [PATCH] fix(polytope): add point to centroid The centroid was always equal to 0, due to forgotten set condition --- epa/polytope.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epa/polytope.go b/epa/polytope.go index a2d611e..8980367 100644 --- a/epa/polytope.go +++ b/epa/polytope.go @@ -212,6 +212,8 @@ func (b *PolytopeBuilder) calculateCentroid() mgl64.Vec3 { b.uniquePoints = append(b.uniquePoints, mgl64.Vec3{}) // Add space copy(b.uniquePoints[insertIdx+1:], b.uniquePoints[insertIdx:]) b.uniquePoints[insertIdx] = point + } else { + b.uniquePoints = append(b.uniquePoints, point) } } }