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.
This commit is contained in:
tian 2026-06-02 12:41:31 +08:00
parent 93c143f75b
commit 8a8153dba0
2 changed files with 12 additions and 3 deletions

View File

@ -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。");
}

View File

@ -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";