Avoid sensors to go dormant if they are far from vehicle.

This commit is contained in:
LuisPoveda 2023-02-21 13:01:48 +01:00 committed by bernat
parent 86daa78794
commit 3b86f58e68
1 changed files with 2 additions and 2 deletions

View File

@ -777,7 +777,7 @@ void ALargeMapManager::CheckActiveActors()
float DistanceSquared = (RelativeLocation - HeroLocation).SizeSquared();
if (DistanceSquared > ActorStreamingDistanceSquared)
if (DistanceSquared > ActorStreamingDistanceSquared && View->GetActorType() != FCarlaActor::ActorType::Sensor)
{
// Save to temporal container. Later will be converted to dormant
ActiveToDormantActors.Add(Id);
@ -1076,7 +1076,7 @@ void ALargeMapManager::PrintMapInfo()
int LastMsgIndex = TilesDistMsgIndex;
GEngine->AddOnScreenDebugMessage(LastMsgIndex++, MsgTime, FColor::White,
FString::Printf(TEXT("\nActor Global Position: %s km"), *(FDVector(CurrentActorPosition) / (1000.0 * 100.0)).ToString()) );
FIntVector CurrentTile = GetTileVectorID(CurrentActorPosition);
GEngine->AddOnScreenDebugMessage(LastMsgIndex++, MsgTime, FColor::White,
FString::Printf(TEXT("\nActor Current Tile: %d_%d"), CurrentTile.X, CurrentTile.Y ));