载入中...
搜索中...
未找到
EvpackInstanceSetLoader.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
7
8#include <array>
9#include <cstdint>
10#include <string>
11#include <vector>
12
13namespace eve::asset_procgen {
14
17 std::string prototype;
18 std::array<float, 3> position{};
19 std::array<float, 4> rotation{};
20 std::array<float, 3> scale{1.f, 1.f, 1.f};
21};
22
25 std::string prototype;
26 std::string renderMode;
27 bool usePrototypeMesh = false;
28 bool useInstancing = false;
29 float minWidth = 1.f, maxWidth = 1.f, minHeight = 1.f, maxHeight = 1.f;
30 std::int64_t noiseSeed = 0;
31 float noiseSpread = .1f, density = 1.f, alignToGround = 0.f, positionJitter = 0.f;
33 std::string resourceAsset;
34 std::array<float, 4> healthyColor{1.f, 1.f, 1.f, 1.f};
35 std::array<float, 4> dryColor{1.f, 1.f, 1.f, 1.f};
36 float bendFactor = 0.f;
37 float holeEdgePadding = 0.f;
38 bool useDensityScaling = true;
39};
40
43 std::uint32_t maximumInstances = 10'000'000;
44 std::uint32_t maximumStringBytes = 1024 * 1024;
45 std::uint64_t maximumDecodedBytes = 1024ull * 1024ull * 1024ull;
46};
47
51 float wavingGrassAmount = 0.f;
52 float wavingGrassSpeed = 0.f;
54 std::array<float, 4> wavingGrassTint{1.f, 1.f, 1.f, 1.f};
55 std::vector<RuntimeInstancePrototype> prototypes;
56 std::vector<RuntimeInstance> instances;
58};
59
62public:
64 explicit EvpackInstanceSetLoader(const asset::EvpackResourceReader& reader) noexcept : reader_(reader) {}
65
71 [[nodiscard]] Result<LoadedInstanceSet> load(const AssetRef& instances,
72 const asset::EvpackCapabilities& capabilities,
73 const InstanceSetLoadLimits& limits = {}) const;
74
75private:
76 const asset::EvpackResourceReader& reader_;
77};
78
79} // namespace eve::asset_procgen
std::vector< BuildingInstanceSnapshot > instances
Typed capability-aware runtime access to admitted packs.
#define EVENGINE_API_ORCHESTRATION
Definition Export.h:111
const AssetImportLimits & limits
Stable asset identity backed by PersistentId.
Definition ResourceRef.h:53
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Immutable reader retaining an admitted pack by shared ownership.
Capability-aware eve.instance-set/5 EVINST decoder with v1-v4 compatibility.
EvpackInstanceSetLoader(const asset::EvpackResourceReader &reader) noexcept
Bind a borrowed immutable reader that must outlive this loader.
Actual runtime device capabilities used for variant selection.
Definition Evpack.h:92
Result of ordered capability variant selection.
Definition Evpack.h:155
Bounds applied before allocating untrusted instance records and strings.
Owning exact static-instance set selected for one runtime variant.
std::vector< RuntimeInstance > instances
std::vector< RuntimeInstancePrototype > prototypes
Runtime vegetation prototype metadata retained from the source terrain.
One exact canonical static instance using meters and an XYZW quaternion.