Fixed sensor_tick on cameras

This commit is contained in:
doterop 2020-10-06 16:10:06 +02:00
parent 22c3e9cf55
commit 7e736696e3
5 changed files with 18 additions and 3 deletions

View File

@ -30,5 +30,9 @@ ADepthCamera::ADepthCamera(const FObjectInitializer &ObjectInitializer)
void ADepthCamera::SendPixels(UWorld *World, ELevelTick TickType, float DeltaSeconds)
{
if(ReadyToCapture)
{
FPixelReader::SendPixelsInRenderThread(*this);
ReadyToCapture = false;
}
}

View File

@ -24,5 +24,9 @@ ASceneCaptureCamera::ASceneCaptureCamera(const FObjectInitializer &ObjectInitial
void ASceneCaptureCamera::SendPixels(UWorld *World, ELevelTick TickType, float DeltaSeconds)
{
if(ReadyToCapture)
{
FPixelReader::SendPixelsInRenderThread(*this);
ReadyToCapture = false;
}
}

View File

@ -505,6 +505,7 @@ void ASceneCaptureSensor::Tick(float DeltaTime)
ImageWidth,
ImageWidth / FMath::Tan(CaptureComponent2D->FOVAngle));
ReadyToCapture = true;
}
void ASceneCaptureSensor::EndPlay(const EEndPlayReason::Type EndPlayReason)

View File

@ -307,4 +307,6 @@ protected:
UPROPERTY(EditAnywhere)
bool bEnablePostProcessingEffects = true;
bool ReadyToCapture = false;
};

View File

@ -26,5 +26,9 @@ ASemanticSegmentationCamera::ASemanticSegmentationCamera(
void ASemanticSegmentationCamera::SendPixels(UWorld *World, ELevelTick TickType, float DeltaSeconds)
{
if(ReadyToCapture)
{
FPixelReader::SendPixelsInRenderThread(*this);
ReadyToCapture = false;
}
}