载入中...
搜索中...
未找到
RoadRecipes.cpp
浏览该文件的文档.
31std::unique_ptr<image::ImageData> generateRoadMarkingsTexture(const Params& params, std::string& error) {
32 const int width = std::clamp(params.getWidth() > 0 ? params.getWidth() : params.getInt("deckWidth", 256), 8, 2048);
93 schema.params.push_back(ParamDescriptor::choice("roadType", "Road Type", "highway", {"highway", "railway"}));
95 schema.params.push_back(ParamDescriptor::floating("bridgeHeight", "Bridge Height", 6.f, 1.f, 64.f, 0.5f));
104 ParamDescriptor::floating("sideObjectSpacing", "Side Object Spacing", 8.f, 0.25f, 100.f, 0.25f));
105 schema.params.push_back(ParamDescriptor::floating("sideObjectOffset", "Side Object Offset", 0.5f, 0.f, 32.f, 0.1f));
107 ParamDescriptor::floating("sideObjectClearance", "Side Object Clearance", 1.5f, 0.f, 32.f, 0.1f));
109 ParamDescriptor::floating("junctionChordError", "Junction Curve Error", 0.10f, 0.01f, 1.f, 0.01f));
111 ParamDescriptor::floating("terrainBlendDistance", "Terrain Surface Blend", 2.f, 0.f, 64.f, 0.25f));
112 schema.params.push_back(ParamDescriptor::floating("chunkSize", "Render Chunk Size", 64.f, 4.f, 1024.f, 1.f));
123 suffix == "X" ? defaults.start.x : (suffix == "Y" ? defaults.start.y : defaults.start.z), -10000.f, 10000.f,
127 suffix == "X" ? defaults.end.x : (suffix == "Y" ? defaults.end.y : defaults.end.z), -10000.f, 10000.f,
130 bridge.params.push_back(ParamDescriptor::floating("deckWidth", "Driving Width", defaults.width, 1.f, 32.f, .5f));
134 bridge.params.push_back(ParamDescriptor::integer("spans", "Spans / Bents", defaults.spans, 1, 64));
135 bridge.params.push_back(ParamDescriptor::integer("panels", "Structural Panels", defaults.panels, 2, 64));
138 bridge.params.push_back(ParamDescriptor::integer("cableSides", "Cable Sides", defaults.cableSides, 3, 16));
140 ParamDescriptor::floating("groundY", "Foundation Level", defaults.groundY, -10000.f, 10000.f, .5f));
142 ParamDescriptor::floating("memberWidth", "Structural Member Width", defaults.memberWidth, .01f, 10.f, .05f));
143 bridge.params.push_back(ParamDescriptor::floating("archRise", "Arch Rise", defaults.archRise, .1f, 100.f, .5f));
145 ParamDescriptor::floating("towerHeight", "Tower Height", defaults.towerHeight, 1.f, 100.f, .5f));
147 ParamDescriptor::floating("trussHeight", "Truss Height", defaults.trussHeight, .1f, 100.f, .5f));
149 ParamDescriptor::floating("cableRadius", "Cable Radius", defaults.cableRadius, .01f, 2.f, .01f));
153 ParamDescriptor::floating("towerInset", "Tower Inset Ratio", defaults.towerInset, .15f, .4f, .01f));
154 bridge.params.push_back(ParamDescriptor::floating("towerTopWidthRatio", "Tower Top Width Ratio",
159 ParamDescriptor::floating("deckThickness", "Deck Thickness", defaults.deckThickness, .1f, 5.f, .05f));
160 bridge.params.push_back(ParamDescriptor::floating("pierWidth", "Pier Width", defaults.pierWidth, .1f, 10.f, .1f));
161 bridge.params.push_back(ParamDescriptor::floating("pierDepth", "Pier Depth", defaults.pierDepth, .1f, 10.f, .1f));
163 ParamDescriptor::floating("railingHeight", "Railing Height", defaults.railingHeight, .1f, 3.f, .1f));
165 ParamDescriptor::floating("railingWidth", "Railing Width", defaults.railingWidth, .1f, 2.f, .05f));
167 ParamDescriptor::floating("sidewalkWidth", "Sidewalk Width", defaults.sidewalkWidth, 0.f, 5.f, .1f));
172 bridge.params.push_back(ParamDescriptor::boolean("connectionDetails", "Gusset Plates and Bolts", true));
173 bridge.params.push_back(ParamDescriptor::integer("railingBars", "Horizontal Rails", defaults.railingBars, 1, 8));
174 bridge.params.push_back(ParamDescriptor::integer("plankCount", "Timber Deck Planks", defaults.plankCount, 8, 2048));
176 ParamDescriptor::floating("memberDepth", "Structural Section Depth", defaults.memberDepth, 0.01f, 10.f, 0.05f));
180 ParamDescriptor::floating("archRibWidth", "Arch Rib Width", defaults.archRibWidth, 0.1f, 10.f, 0.1f));
182 ParamDescriptor::floating("archRibDepth", "Arch Rib Depth", defaults.archRibDepth, 0.1f, 10.f, 0.1f));
188 ParamDescriptor::floating("pierCapHeight", "Pier Capital Height", defaults.pierCapHeight, 0.1f, 5.f, 0.1f));
190 ParamDescriptor::floating("abutmentDepth", "Abutment Depth", defaults.abutmentDepth, 0.1f, 10.f, 0.1f));
194 ParamDescriptor::floating("uvMeters", "Texture Repeat Metres", defaults.uvMeters, 0.01f, 20.f, 0.1f));
196 ParamDescriptor::floating("portalInset", "Sloped Truss End Ratio", defaults.portalInset, 0.f, 0.2f, 0.01f));
197 bridge.params.push_back(ParamDescriptor::floating("cantileverCenterRatio", "Suspended Center Depth Ratio",
200 ParamDescriptor::floating("towerLegWidth", "Tower Leg Width", defaults.towerLegWidth, 0.1f, 10.f, 0.1f));
227 RecipeDescriptor schema = RecipeDescriptor::grid("tex.roadMarkings", "Road Markings Logic", "Road", 8, 8);
228 schema.params.push_back(ParamDescriptor::floating("dashPeriod", "Dash Period", 0.18f, 0.02f, 1.f, 0.01f));
229 schema.params.push_back(ParamDescriptor::floating("dashDuty", "Dash Duty", 0.45f, 0.05f, 0.95f, 0.01f));
const eve::script::BindingContractRegistry & registry
Definition ProjectIndexAutomatic.cpp:24
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
CPU triangle mesh from procedural mesh recipes (e.g. marching cubes). Positions/normals are xyz-packe...
Definition MeshBuild.h:20
Definition TerrainWorldWorkspace.h:12
Result< BridgePlan > planBridge(const BridgeParameters &p)
Plan the selected topology without renderer or terrain providers.
Definition BridgeGenerator.cpp:608
Result< RoadOverlay > generateRoadNetworkOverlay(const Params ¶ms)
Bake navigation overlay for the same Params used by mesh.roadNetwork.
Definition RoadRecipes.cpp:25
std::unique_ptr< image::ImageData > generateRoadMarkingsTexture(const Params ¶ms, std::string &error)
Pure-function road marking atlas (asphalt + edge + dashed center + zebra).
Definition RoadRecipes.cpp:31
Result< BridgeParameters > bridgePreset(BridgeKind kind)
Return an owning reference-aligned preset; unsupported kinds fail without side effects.
Definition BridgeGenerator.cpp:78
Result< MeshBuild > bakeBridge(const BridgePlan &plan)
Bake a validated member plan into independent CPU geometry; upload separately.
Definition BridgeGenerator.cpp:616
Result< BridgeParameters > bridgeParametersFromParams(const Params ¶ms)
Decode recipe parameters into an owning typed authoring value.
Definition BridgeGenerator.cpp:741
bool generateRoadNetworkMesh(const Params ¶ms, MeshBuild &out, std::string &error)
Generate a multi-level interchange mesh from Params (span/height/lanes/seed).
Definition RoadRecipes.cpp:15
Result< RoadBakeResult > bakeRoadNetworkRecipe(const Params ¶ms)
Build the shared road recipe once for mesh, navigation and artifact projections.
Definition RoadRecipeBake.cpp:41
void registerRoadMeshRecipes(MeshRecipeRegistry ®istry)
Registers road mesh recipes.
Definition RoadRecipes.cpp:86
void registerRoadTextureRecipes(TextureRecipeRegistry ®istry)
Registers road texture recipes.
Definition RoadRecipes.cpp:226
static ParamDescriptor boolean(std::string key, std::string label, bool defaultValue)
Construct a Boolean descriptor stored as zero or one in Params.
Definition ParamSchema.cpp:47
static ParamDescriptor choice(std::string key, std::string label, std::string defaultValue, std::vector< std::string > choices)
Construct a finite-choice string descriptor.
Definition ParamSchema.cpp:65
static ParamDescriptor floating(std::string key, std::string label, float defaultValue, float minimum, float maximum, float step)
Construct a bounded floating-point descriptor.
Definition ParamSchema.cpp:33
static ParamDescriptor integer(std::string key, std::string label, int defaultValue, int minimum, int maximum, int step=1)
Construct a bounded integer descriptor.
Definition ParamSchema.cpp:19
Complete metadata and parameter schema shared by every procgen recipe family.
Definition ParamSchema.h:52
static RecipeDescriptor grid(std::string id, std::string displayName, std::string category, int minimumWidth, int minimumHeight, int maximumWidth=4096, int maximumHeight=4096)
Create a schema with common seed, width and height parameters.
Definition ParamSchema.cpp:73
std::vector< ParamDescriptor > params
Definition ParamSchema.h:56