载入中...
搜索中...
未找到
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 float x = 0.f;
64 float y = 0.f;
65};
66
69 uint32_t seed = 1;
71 int width = 6;
72 int depth = 6;
73 int floors = 1;
75 float moduleSize = 1.f;
76 float floorHeight = 3.f;
77 std::string style;
79 std::string footprint = "auto";
81 std::vector<HousePolygonPoint> perimeter;
83 std::string roof = "auto";
85 std::string entrance = "auto";
86 std::vector<std::string> requiredRooms {"living"};
88 int maxAttempts = 32;
89};
90
93 std::string componentId;
95 int x = 0;
96 int y = 0;
97 int z = 0;
99 int rotationDeg = 0;
100};
101
103struct HouseRoom {
104 std::string type;
106 int x = 0;
107 int y = 0;
108 int z = 0;
109 int width = 1;
110 int depth = 1;
111};
112
113} // 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
旋转(度)。
组件材质覆盖(未设置的字段沿用默认材质)。
自由轮廓占地的一个多边形顶点(角坐标,[0,width]×[0,depth])。
一次房屋生成请求(参数集)。
std::vector< HousePolygonPoint > perimeter
自由轮廓占地顶点(footprint="polygon" 时必填,至少 3 个,角坐标)。
std::vector< std::string > requiredRooms
int maxAttempts
生成重试上限。
std::string footprint
auto | rectangle | l_shape | t_shape | polygon。
std::string roof
auto | gable | flat | shed。
std::string entrance
auto | north | east | south | west。
int width
占地尺寸(格)与层数。
float moduleSize
模块尺寸 / 层高(世界单位)。
布局中的房间标记。
int x
格子坐标与尺寸(z = 楼层)。
组件连接点:方向 + 类型 + 可接受类型。
std::vector< std::string > accepts