From 8a8153dba0747efe1ad4c7df0cd99bad48e05324 Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Tue, 2 Jun 2026 12:41:31 +0800 Subject: [PATCH] fix: use ShouldUseReferenceBasedRealObjectPlanarPose to guard reference rotation capture Ground and Hoisting paths don't consume fragment reference rotation, only Rail does. Replace manual PathType checks with the existing semantic utility method. Also fix GetPathRouteSync SELECT missing IsTwoPointVertical column. --- src/Core/Animation/PathAnimationManager.cs | 13 +++++++++++-- src/Core/PathDatabase.cs | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Core/Animation/PathAnimationManager.cs b/src/Core/Animation/PathAnimationManager.cs index 8501a95..41b2e84 100644 --- a/src/Core/Animation/PathAnimationManager.cs +++ b/src/Core/Animation/PathAnimationManager.cs @@ -5257,7 +5257,7 @@ namespace NavisworksTransport.Core.Animation return false; } - if (_route?.PathType == PathType.Ground) + if (!ShouldUseReferenceBasedRealObjectPlanarPose(_route?.PathType ?? PathType.Ground)) { return false; } @@ -5350,7 +5350,7 @@ namespace NavisworksTransport.Core.Animation } if (!isVirtualObject && - _route?.PathType == PathType.Ground && + !ShouldUseReferenceBasedRealObjectPlanarPose(_route?.PathType ?? PathType.Ground) && ModelItemTransformHelper.TryGetCurrentGeometryRotation(sourceObject, out var groundActualGeometryRotation)) { _trackedRotation = groundActualGeometryRotation; @@ -5375,6 +5375,15 @@ namespace NavisworksTransport.Core.Animation return; } + if (!ShouldUseReferenceBasedRealObjectPlanarPose(_route?.PathType ?? PathType.Ground)) + { + // Ground/Hoisting 路径:无需参考姿态,使用单位旋转 + _trackedRotation = Rotation3D.Identity; + _hasTrackedRotation = true; + _currentYaw = 0.0; + return; + } + throw new InvalidOperationException( $"[真实物体参考姿态] {sourceObject.DisplayName} 无法同步参考姿态:未能读取当前实际几何姿态,fragment 代表姿态也不可用,已禁止回退 Transform。"); } diff --git a/src/Core/PathDatabase.cs b/src/Core/PathDatabase.cs index f59a00e..c7b8b55 100644 --- a/src/Core/PathDatabase.cs +++ b/src/Core/PathDatabase.cs @@ -2815,7 +2815,7 @@ namespace NavisworksTransport SELECT Id, Name, CreatedTime, LastModified, TurnRadius, IsCurved, MaxObjectLength, MaxObjectWidth, MaxObjectHeight, SafetyMargin, GridSize, PathType, LiftHeight, RailMountMode, RailPathDefinitionMode, - RailNormalOffset, RailPreferredNormalX, RailPreferredNormalY, RailPreferredNormalZ + RailNormalOffset, RailPreferredNormalX, RailPreferredNormalY, RailPreferredNormalZ, IsTwoPointVertical FROM PathRoutes WHERE Id = @Id";