CARLA
 
载入中...
搜索中...
未找到
NormalsCamera.cpp
浏览该文件的文档.
1// Copyright (c) 2022 Computer Vision Center (CVC) at the Universitat Autonoma
2// de Barcelona (UAB).
3//
4// This work is licensed under the terms of the MIT license.
5// For a copy, see <https://opensource.org/licenses/MIT>.
6
7#include "Carla.h"
9
11
13
14// 返回传感器定义,使用 MakeNormalsCameraDefinition 函数创建该定义
19
20// ANormalsCamera 类的构造函数
21// 主要进行后处理材质的添加和16位格式的启用或禁用
22ANormalsCamera::ANormalsCamera(const FObjectInitializer &ObjectInitializer)
23 : Super(ObjectInitializer)
24{
25 Enable16BitFormat(false);
27 TEXT("Material'/Carla/PostProcessingMaterials/PhysicLensDistortion.PhysicLensDistortion'"));
29 TEXT("Material'/Carla/PostProcessingMaterials/NormalsEffectMaterial.NormalsEffectMaterial'"));
30}
31
32// ANormalsCamera 的 PostPhysTick 函数
33// 该函数在物理计算完成后调用,用于图像或像素的处理
34void ANormalsCamera::PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaSeconds)
35{
36 TRACE_CPUPROFILER_EVENT_SCOPE(ANormalsCamera::PostPhysTick);
37 FPixelReader::SendPixelsInRenderThread<ANormalsCamera, FColor>(*this);
38}
TSharedPtr< const FActorInfo > carla::rpc::ActorState UWorld * World
static FActorDefinition GetSensorDefinition()
void PostPhysTick(UWorld *World, ELevelTick TickType, float DeltaSeconds) override
ANormalsCamera(const FObjectInitializer &ObjectInitializer)
void Enable16BitFormat(bool Enable=false)
bool AddPostProcessingMaterial(const FString &Path)
Load the UMaterialInstanceDynamic at the given Path and append it to the list of shaders with Weight.
static FActorDefinition MakeNormalsCameraDefinition()
创建一个法线相机参与者定义。