Allow UE4 tick rate in sensors

This commit is contained in:
Marc Garcia Puig 2020-12-07 18:46:58 +01:00 committed by bernat
parent 961622862c
commit c0a3ee4a3a
4 changed files with 8 additions and 6 deletions

View File

@ -64,7 +64,6 @@ static void WritePixelsToBuffer_Vulkan(
gPixels,
FReadSurfaceDataFlags(RCM_UNorm, CubeFace_MAX));
Buffer.copy_from(Offset, gPixels);
UE_LOG(LogCarla, Warning, TEXT("After - ReadSurfaceData() - %d, %d, %d"), GFrameCounter, GFrameNumber, GFrameNumberRenderThread);
}
// =============================================================================
@ -130,7 +129,6 @@ void FPixelReader::WritePixelsToBuffer(
FRHICommandListImmediate &InRHICmdList
)
{
UE_LOG(LogCarla, Warning, TEXT("WritePixelsToBuffer() - %d, %d, %d"), GFrameCounter, GFrameNumber, GFrameNumberRenderThread);
check(IsInRenderingThread());
if (IsVulkanPlatform(GMaxRHIShaderPlatform) || IsD3DPlatform(GMaxRHIShaderPlatform, false))

View File

@ -57,9 +57,6 @@ void ARayCastLidar::Set(const FLidarDescription &LidarDescription)
void ARayCastLidar::PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaTime)
{
// ASensor::Tick(DeltaTime);
// UE_LOG(LogCarla, Warning, TEXT("PrePhysTick: %f"), DeltaTime);
UE_LOG(LogCarla, Warning, TEXT("ARayCastLidar::PostPhysTick() - %d, %d, %d"), GFrameCounter, GFrameNumber, GFrameNumberRenderThread);
SimulateLidar(DeltaTime);
auto DataStream = GetDataStream(*this);

View File

@ -496,6 +496,12 @@ void ASceneCaptureSensor::BeginPlay()
Super::BeginPlay();
}
void ASceneCaptureSensor::PrePhysTick(float DeltaSeconds)
{
// Allows the sensor to tick with the tick rate from UE4.
ReadyToCapture = true;
}
void ASceneCaptureSensor::PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaTime)
{
// Add the view information every tick. It's only used for one tick and then

View File

@ -281,8 +281,9 @@ protected:
virtual void BeginPlay() override;
// virtual void PrePhysTick(float DeltaTime) override;
virtual void PrePhysTick(float DeltaSeconds) override;
virtual void PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaTime) override;
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
virtual void SetUpSceneCaptureComponent(USceneCaptureComponent2D &SceneCapture) {}