CARLA
 
载入中...
搜索中...
未找到
MaterialParameter.cpp
浏览该文件的文档.
1// Copyright (c) 2021 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 "MaterialParameter.h"
8
9namespace carla {
10namespace rpc {
11
12// 函数:将 MaterialParameter 枚举类型转换为对应的字符串表示
13std::string MaterialParameterToString(MaterialParameter material_parameter)
14{
15 // 使用 switch 语句根据不同的 MaterialParameter 枚举值进行分支判断
16 switch(material_parameter)
17 {
18 // 当枚举值为 Tex_Normal 时,返回字符串 "Normal"
19 case MaterialParameter::Tex_Normal: return "Normal";
20 // 当枚举值为 Tex_Ao_Roughness_Metallic_Emissive 时,返回字符串 "AO / Roughness / Metallic / Emissive"
21 case MaterialParameter::Tex_Ao_Roughness_Metallic_Emissive: return "AO / Roughness / Metallic / Emissive";
22 // 当枚举值为 Tex_Diffuse 时,返回字符串 "Diffuse"
23 case MaterialParameter::Tex_Diffuse: return "Diffuse";
24 // 当枚举值为 Tex_Emissive 时,返回字符串 "Emissive"
25 case MaterialParameter::Tex_Emissive: return "Emissive";
26 // 对于未匹配到上述枚举值的情况,返回字符串 "Invalid"
27 default: return "Invalid";
28 }
29}
30
31}
32}
std::string MaterialParameterToString(MaterialParameter material_parameter)
CARLA模拟器的主命名空间。
Definition Carla.cpp:139