Fixed raytracing functions
This commit is contained in:
parent
0f5252ad62
commit
e56470659a
|
@ -1,5 +1,6 @@
|
|||
## Latest
|
||||
|
||||
* Fixed bug causing the `world.ground_projection()` function to return an incorrect location at large maps.
|
||||
* Added failure state to vehicles, which can be retrieved by using `Vehicle.get_failure_state()`. Only Rollover failure state is currently supported.
|
||||
* Fixed bug causing the TM to block the simulation when another client teleported a vehicle with no physics.
|
||||
* Fixed bug causing the TM to block the simulation when travelling through a short roads that looped on themselves.
|
||||
|
|
|
@ -30,7 +30,15 @@ std::vector<crp::LabelledPoint> URayTracer::CastRay(
|
|||
UPrimitiveComponent* Component = Hit.GetComponent();
|
||||
crp::CityObjectLabel ComponentTag =
|
||||
ATagger::GetTagOfTaggedComponent(*Component);
|
||||
result.emplace_back(crp::LabelledPoint(Hit.Location, ComponentTag));
|
||||
|
||||
FVector UELocation = Hit.Location;
|
||||
ACarlaGameModeBase* GameMode = UCarlaStatics::GetGameMode(World);
|
||||
ALargeMapManager* LargeMap = GameMode->GetLMManager();
|
||||
if (LargeMap)
|
||||
{
|
||||
UELocation = LargeMap->LocalToGlobalLocation(UELocation);
|
||||
}
|
||||
result.emplace_back(crp::LabelledPoint(UELocation, ComponentTag));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -52,7 +60,15 @@ std::pair<bool, crp::LabelledPoint> URayTracer::ProjectPoint(
|
|||
UPrimitiveComponent* Component = Hit.GetComponent();
|
||||
crp::CityObjectLabel ComponentTag =
|
||||
ATagger::GetTagOfTaggedComponent(*Component);
|
||||
return std::make_pair(bDidHit, crp::LabelledPoint(Hit.Location, ComponentTag));
|
||||
|
||||
FVector UELocation = Hit.Location;
|
||||
ACarlaGameModeBase* GameMode = UCarlaStatics::GetGameMode(World);
|
||||
ALargeMapManager* LargeMap = GameMode->GetLMManager();
|
||||
if (LargeMap)
|
||||
{
|
||||
UELocation = LargeMap->LocalToGlobalLocation(UELocation);
|
||||
}
|
||||
return std::make_pair(bDidHit, crp::LabelledPoint(UELocation, ComponentTag));
|
||||
}
|
||||
return std::make_pair(bDidHit, crp::LabelledPoint(FVector(0.0f,0.0f,0.0f), crp::CityObjectLabel::None));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue