CARLA
OpticalFlowCamera.cpp
Go to the documentation of this file.
1 #include "Carla.h"
3 #include "HAL/IConsoleManager.h"
4 
6 
8 {
9  return UActorBlueprintFunctionLibrary::MakeCameraDefinition(TEXT("optical_flow"));
10 }
11 
12 AOpticalFlowCamera::AOpticalFlowCamera(const FObjectInitializer &ObjectInitializer)
13  : Super(ObjectInitializer)
14 {
15  Enable16BitFormat(true);
17  TEXT("Material'/Carla/PostProcessingMaterials/PhysicLensDistortion.PhysicLensDistortion'"));
19  TEXT("Material'/Carla/PostProcessingMaterials/VelocityMaterial.VelocityMaterial'"));
20 }
21 
22 void AOpticalFlowCamera::PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaSeconds)
23 {
24  auto CVarForceOutputsVelocity = IConsoleManager::Get().FindConsoleVariable(TEXT("r.BasePassForceOutputsVelocity"));
25  int32 OldValue = CVarForceOutputsVelocity->GetInt();
26  CVarForceOutputsVelocity->Set(1);
28  CVarForceOutputsVelocity->Set(OldValue);
29 }
void PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaSeconds) override
AOpticalFlowCamera(const FObjectInitializer &ObjectInitializer)
bool AddPostProcessingMaterial(const FString &Path)
Load the UMaterialInstanceDynamic at the given Path and append it to the list of shaders with Weight...
A definition of a Carla Actor with all the variation and attributes.
static T Get(carla::rpc::Response< T > &response)
static void SendPixelsInRenderThread(TSensor &Sensor, bool use16BitFormat=false)
Convenience function to enqueue a render command that sends the pixels down the Sensor&#39;s data stream...
Definition: PixelReader.h:86
static FActorDefinition GetSensorDefinition()
static FActorDefinition MakeCameraDefinition(const FString &Id, bool bEnableModifyingPostProcessEffects=false)
void Enable16BitFormat(bool Enable=false)