载入中...
搜索中...
未找到
HouseLayout.h
浏览该文件的文档.
1#pragma once
2
4
5#include <string>
6#include <vector>
7
8namespace eve {
9namespace graphics { class Graphics; class Renderable3D; }
10namespace model3d { class Model3D; }
11namespace housegen {
12
13class HouseComponentLibrary;
14
17public:
18 uint32_t seed = 1;
20 float moduleSize = 1.f;
21 float floorHeight = 3.f;
23 std::string footprintStyle = "rectangle";
24 std::string roofStyle = "gable";
25 std::string entranceSide = "north";
27 std::vector<HouseInstance> instances;
28 std::vector<HouseRoom> rooms;
29 std::vector<std::string> diagnostics;
30
32 void clear();
34 std::string toJson() const;
35 bool fromJson(const std::string &json, std::string *error = nullptr);
37 bool validate(const HouseComponentLibrary &library, std::string *error = nullptr) const;
39 std::vector<graphics::Renderable3D *> instantiate(graphics::Graphics *gfx,
40 model3d::Model3D *models,
41 const HouseComponentLibrary &library,
42 std::string *error = nullptr) const;
43};
44
45} // namespace housegen
46} // namespace eve
std::string error
房屋组件注册表(按 id 索引,支持分类/风格查询)。
一次生成的房屋布局:实例 + 房间 + 元信息,可 JSON 序列化 / 实例化。
Definition HouseLayout.h:16
std::string footprintStyle
布局风格结果。
Definition HouseLayout.h:23
std::string toJson() const
序列化为 JSON / 从 JSON 恢复。
std::vector< HouseRoom > rooms
Definition HouseLayout.h:28
bool validate(const HouseComponentLibrary &library, std::string *error=nullptr) const
校验布局是否满足组件库规则。
float moduleSize
生成参数回显。
Definition HouseLayout.h:20
void clear()
清空布局。
std::vector< graphics::Renderable3D * > instantiate(graphics::Graphics *gfx, model3d::Model3D *models, const HouseComponentLibrary &library, std::string *error=nullptr) const
把布局实例化为场景中的 Renderable3D(调用方持有)。
bool fromJson(const std::string &json, std::string *error=nullptr)
std::vector< std::string > diagnostics
Definition HouseLayout.h:29
std::vector< HouseInstance > instances
组件实例 / 房间 / 诊断信息。
Definition HouseLayout.h:27
Resource module for decoding 3D models via medialoader (Assimp). Produces ModelData; GPU upload is gr...
Definition Model3D.h:41
Definition Build.cpp:11