From 4f7935499df4b8b1bfdb1104ebda5db117fec434 Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Wed, 7 Jan 2026 16:27:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=84=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E5=92=8Cclashdetective=E6=A3=80=E6=B5=8B=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Core/Animation/PathAnimationManager.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Core/Animation/PathAnimationManager.cs b/src/Core/Animation/PathAnimationManager.cs index 90fb60a..e409eb6 100644 --- a/src/Core/Animation/PathAnimationManager.cs +++ b/src/Core/Animation/PathAnimationManager.cs @@ -596,7 +596,6 @@ namespace NavisworksTransport.Core.Animation { var colliderBox = collider.BoundingBox(); - // 🔥 调试日志:输出包围盒信息 // 使用改进的精确距离检测方法(先检查相交,再计算精确距离) double preciseDistance = BoundingBoxGeometryUtils.CalculatePreciseDistance(virtualBoundingBox, colliderBox); bool intersects = preciseDistance <= _detectionGap; @@ -617,7 +616,17 @@ namespace NavisworksTransport.Core.Animation (virtualBoundingBox.Min.Y + virtualBoundingBox.Max.Y + colliderBox.Min.Y + colliderBox.Max.Y) / 4, (virtualBoundingBox.Min.Z + virtualBoundingBox.Max.Z + colliderBox.Min.Z + colliderBox.Max.Z) / 4 ), - Item1Position = framePosition, + // 🔥 重要:记录虚拟车辆的包围盒中心,而不是底面中心 + // 原因: + // 1. framePosition是路径点,代表车辆在地面上的位置(底面中心) + // 2. ClashDetective移动逻辑使用包围盒中心进行定位 + // 3. 如果记录底面中心,ClashDetective会把包围盒中心移动到底面位置,导致车辆下沉半个高度 + // 4. 记录包围盒中心可以确保ClashDetective移动后的位置与预计算时的虚拟车辆位置一致 + Item1Position = new Point3D( + framePosition.X, + framePosition.Y, + framePosition.Z + (virtualBoundingBox.Max.Z - virtualBoundingBox.Min.Z) / 2 + ), Item2Position = GetObjectPosition(collider), HasPositionInfo = true };