载入中...
搜索中...
未找到
HouseGenTypes.h
浏览该文件的文档.
1#pragma once
2
3#include <cstdint>
4#include <string>
5#include <vector>
6
7namespace eve::housegen {
8
11
15 std::string type;
16 std::vector<std::string> accepts;
17};
18
21 bool hasBaseColor = false;
22 float baseColorR = 1.f;
23 float baseColorG = 1.f;
24 float baseColorB = 1.f;
25 float baseColorA = 1.f;
26 std::string baseColorTexture;
27 std::string normalTexture;
28 std::string heightTexture;
29 bool hasMetallic = false;
30 float metallic = 0.f;
31 bool hasRoughness = false;
32 float roughness = 1.f;
33 float parallaxScale = 0.f;
34 float parallaxMinLayers = 8.f;
35 float parallaxMaxLayers = 32.f;
36 float cellBombScale = 4.f;
37 float cellBombStrength = 0.f;
38 float cellBombRotation = 1.f;
39};
40
43 std::string id;
44 std::string modelPath;
45 std::string category;
47 int width = 1;
48 int depth = 1;
49 int height = 1;
51 int weight = 1;
53 std::vector<int> rotations {0, 90, 180, 270};
54 std::vector<std::string> tags;
56 std::vector<HouseSocket> sockets;
59};
60
63 uint32_t seed = 1;
65 int width = 6;
66 int depth = 6;
67 int floors = 1;
69 float moduleSize = 1.f;
70 float floorHeight = 3.f;
71 std::string style;
73 std::string footprint = "auto";
75 std::string roof = "auto";
77 std::string entrance = "auto";
78 std::vector<std::string> requiredRooms {"living"};
80 int maxAttempts = 32;
81};
82
85 std::string componentId;
87 int x = 0;
88 int y = 0;
89 int z = 0;
91 int rotationDeg = 0;
92};
93
95struct HouseRoom {
96 std::string type;
98 int x = 0;
99 int y = 0;
100 int width = 1;
101 int depth = 1;
102};
103
104} // namespace eve::housegen
SocketDirection
组件连接点方向(上下 + 四向)。
房屋组件模板(几何 + 连接点 + 权重)。
int width
占地尺寸(格)。
std::vector< int > rotations
允许的旋转(度)。
std::vector< std::string > tags
HouseMaterialOverride material
材质覆盖。
std::vector< HouseSocket > sockets
连接点。
int weight
生成权重(越大越常被选中)。
布局中的单个组件实例(位置 + 旋转)。
int x
格子坐标(x,y,z = 层)。
int rotationDeg
旋转(度)。
组件材质覆盖(未设置的字段沿用默认材质)。
一次房屋生成请求(参数集)。
std::vector< std::string > requiredRooms
int maxAttempts
生成重试上限。
std::string footprint
auto | rectangle | l_shape | t_shape。
std::string roof
auto | gable | flat | shed。
std::string entrance
auto | north | east | south | west。
int width
占地尺寸(格)与层数。
float moduleSize
模块尺寸 / 层高(世界单位)。
布局中的房间标记。
int x
格子坐标与尺寸。
组件连接点:方向 + 类型 + 可接受类型。
std::vector< std::string > accepts