载入中...
搜索中...
未找到
HeightfieldSurface.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
6#include "common/Result.h"
7
8#include <cstdint>
9#include <memory>
10#include <string>
11#include <vector>
12
13namespace eve::building {
14
17public:
19 struct Config {
20 int width = 0;
21 int height = 0;
22 float originX = 0.f;
23 float originY = 0.f;
24 float spacingX = 1.f;
25 float spacingY = 1.f;
26 float heightScale = 1.f;
27 float heightOffset = 0.f;
28 std::string surfaceId;
29 uint64_t surfaceRevision = 0;
30 std::vector<std::string> tags;
31 };
32
40 create(Config config, std::vector<float> samples);
41
51 sample(const PlacementWorld &world, float planeX, float planeY) const;
52
54 const Config &config() const { return config_; }
55
56private:
57 HeightfieldSurface(Config config, std::vector<float> samples);
58
59 Config config_;
60 std::vector<float> samples_;
61};
62
63} // namespace eve::building
#define EVENGINE_API_WORLD
Definition Export.h:109
std::uint32_t height
std::uint32_t width
World3D * world
Move-only, checked operation results for the common layer.
double spacingX
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Immutable regularly sampled heightfield usable as an XY or XZ placement surface.
const Config & config() const
Return the immutable construction configuration.
格子型建筑放置世界(脚本可直接操作)。
建筑放置模块入口:定义 / 放置世界 / 鬼影 / 变更事件的脚本绑定点。 设计文档:docs/dev/建筑放置系统设计.md
Definition Building.cpp:7
Owning construction data. Samples are row-major plane-axis heights.