From 570bc82fcac3356c69488f9462552dc5822dd665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Kie=C5=82czykowski?= Date: Mon, 9 Dec 2024 16:07:16 +0100 Subject: [PATCH] Fix function naming --- .../RandomTraffic/NPCVehicle/NPCVehicleInternalState.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Assets/AWSIM/Scripts/RandomTraffic/NPCVehicle/NPCVehicleInternalState.cs b/Assets/AWSIM/Scripts/RandomTraffic/NPCVehicle/NPCVehicleInternalState.cs index ed9fe6aad..91513665c 100644 --- a/Assets/AWSIM/Scripts/RandomTraffic/NPCVehicle/NPCVehicleInternalState.cs +++ b/Assets/AWSIM/Scripts/RandomTraffic/NPCVehicle/NPCVehicleInternalState.cs @@ -109,7 +109,7 @@ public float DistanceToNextLane => CalculateDistanceToNextLane(); public float DistanceToIntersection => FirstLaneWithIntersection == null ? float.MaxValue - : DistanceToClosestTrafficLane(); + : DistanceToClosestTrafficLightLane(); public bool ObstructedByVehicleBehindIntersection => DistanceToIntersection > DistanceToFrontVehicle; @@ -143,7 +143,7 @@ private float CalculateDistanceToNextLane() return (1f - laneFollowingProgress) * laneLenght; } - public float DistanceToClosestTrafficLane() + public float DistanceToClosestTrafficLightLane() { if (TrafficLightLane is null && !FollowingLanes.Contains(TrafficLightLane)) { @@ -179,12 +179,9 @@ public float DistanceToClosestTrafficLane() } else { - //when distance was calculated once partially/for whole lane it keeps calculating whole lanes - //until meeting traffic light lane distance += laneLenght; } - //if traffic lane, stop computing if (FollowingLanes[i] == TrafficLightLane) { break;