载入中...
搜索中...
未找到
BridgeGenerator.h
浏览该文件的文档.
1#pragma once
2
3#include "procgen/MeshBuild.h"
4#include "procgen/Params.h"
5
6#include <string_view>
7#include <vector>
8
9namespace eve::procgen::road {
10
12enum class BridgeKind {
13 Beam,
14 Slab,
15 Arch,
23};
40enum class BridgePart {
41 Deck,
42 Surface,
43 Pier,
45 Girder,
46 Arch,
47 Truss,
48 Tower,
49 Cable,
50 Hanger,
51 Railing,
52 Marking,
53 Footing,
54 Cap,
57 Anchor
58};
61 float x = 0.f, y = 0.f, z = 0.f;
62};
66 BridgePoint start{-24.f, 12.f, 0.f}, end{24.f, 12.f, 0.f};
67 float width = 7.f, sidewalkWidth = 1.f, deckThickness = .75f, groundY = 0.f;
68 float memberWidth = .4f, pierWidth = 1.3f, pierDepth = 1.3f;
69 float archRise = 6.f, towerHeight = 14.f, trussHeight = 5.f;
70 float cableRadius = .09f, cableSag = .65f, towerInset = .25f, towerTopWidthRatio = .15f;
71 float railingHeight = 1.1f, railingWidth = .12f;
72 float memberDepth = .55f, girderHeight = 1.1f, archRibWidth = .85f, archRibDepth = 1.0f;
74 float abutmentDepth = 2.6f, wingWallLength = 4.f, uvMeters = 2.f;
75 float portalInset = .06f, cantileverCenterRatio = .28f, towerLegWidth = 1.6f;
77 int spans = 3, panels = 12, curveSegments = 32, cableSides = 8;
78 int railingBars = 4, plankCount = 120;
79 bool piers = true, railings = true, markings = true, crossBracing = true, connectionDetails = true;
80};
95struct BridgePlan {
96 std::vector<BridgeMember> members;
97 int cableSides = 8;
98};
100[[nodiscard]] EVENGINE_API_DOMAINS std::string_view bridgeKindName(BridgeKind kind) noexcept;
102[[nodiscard]] EVENGINE_API_DOMAINS std::string_view bridgePartName(BridgePart part) noexcept;
104[[nodiscard]] EVENGINE_API_DOMAINS std::string_view bridgeMaterialName(BridgeMaterial material) noexcept;
136
137} // namespace eve::procgen::road
#define EVENGINE_API_DOMAINS
Definition Export.h:110
std::vector< RecipeParam > params
std::array< uint32_t, 16 > material
std::array< uint32_t, 9 > parameters
std::string kind
Move-only operation result carrying either a value or Status.
Definition Result.h:176
Owning, typed generation parameters.
Definition Params.h:27
BridgeSection
Section construction shared by all bridge topologies.
BridgeMaterial
Orthogonal surface classification carried by each generated member.
BridgeRailing
Editable edge protection rule; presets select the reference's construction.
Result< BridgePlan > planBridge(const BridgeParameters &p)
Plan the selected topology without renderer or terrain providers.
Result< BridgeParameters > bridgePreset(BridgeKind kind)
Return an owning reference-aligned preset; unsupported kinds fail without side effects.
Result< void > applyBridgeRecipeDefaults(Params &params)
Atomically fill absent recipe parameters from the selected bridge preset.
Result< MeshBuild > bakeBridge(const BridgePlan &plan)
Bake a validated member plan into independent CPU geometry; upload separately.
Result< BridgeParameters > bridgeParametersFromParams(const Params &params)
Decode recipe parameters into an owning typed authoring value.
std::string_view bridgeMaterialName(BridgeMaterial material) noexcept
Static surface name, or an empty view for an unknown enum; process-lifetime storage,...
std::string_view bridgePartName(BridgePart part) noexcept
Static semantic name, or an empty view for an unknown enum; process-lifetime storage,...
BridgePart
Semantic mesh groups, independent of graphics materials.
std::string_view bridgeKindName(BridgeKind kind) noexcept
Static protocol name, or an empty view for an unknown enum; process-lifetime storage,...
BridgeKind
Visual bridge topology presets; geometry generation performs no structural load analysis.
One owned editable structural member; width/height are transverse to its longitudinal axis....
float endHeight
Positive far-end dimensions for TaperedBox; zero for other sections.
float uvMeters
Metres per repeat, independent of tessellation.
BridgePoint widthAxis
Projected transverse width direction; zero selects a world-up-derived frame.
Owned bounded authoring parameters; all dimensions are metres, counts are deterministic.
Transient owning member plan; edit members to customize logic before baking. Not a persistent format.
std::vector< BridgeMember > members
Owned world-space position in metres, Y-up.