载入中...
搜索中...
未找到
RoadBakeInternal.h 文件参考
#include <array>
#include <span>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include "common/BorrowedRef.h"
#include "common/Diagnostic.h"
#include "procgen/road/RoadBake.h"
#include "procgen/spline/SplinePath.h"

浏览源代码.

类

struct  eve::procgen::road::detail::RoadSurfaceRows
 One bake's sole owner of retained road frames and shared scan work; no callbacks or cross-bake reuse. 更多...
 
struct  eve::procgen::road::detail::RoadFrameCache
 
struct  eve::procgen::road::detail::RoadSurfacePolyline
 Borrowed section centers plus owned cumulative lengths, valid only during the owning bake/cache lifetime. 更多...
 
struct  eve::procgen::road::detail::V3
 
struct  eve::procgen::road::detail::JunctionPlane
 

命名空间

namespace  eve
 Build metadata (engine git commit, build time, third-party version).
 
namespace  eve::procgen
 
namespace  eve::procgen::road
 
namespace  eve::procgen::road::detail
 

枚举

enum class  eve::procgen::road::detail::TriangulationStatus { eve::procgen::road::detail::Complete , eve::procgen::road::detail::Degenerate }
 Module-private road bake implementation helper. 更多...
 
enum class  eve::procgen::road::detail::BoundaryPointPolicy { eve::procgen::road::detail::IgnoreCollinear , eve::procgen::road::detail::IncludeBoundary }
 
enum class  eve::procgen::road::detail::QuadDiagonal { eve::procgen::road::detail::FirstToThird , eve::procgen::road::detail::SecondToFourth }
 Module-private road bake implementation helper. 更多...
 

函数

ResultRef< const std::vector< SplineFrameSample > > eve::procgen::road::detail::prepareRoadFrames (RoadFrameCache &cache, const SplinePath &path, const RoadEdge &edge, const RoadBakeOptions &options, float length)
 Prepare once per immutable edge/options snapshot. Borrowed result expires with cache destruction. Synchronous bake-owner thread only. At most 4097 frames per edge; scan work shares the network budget.
 
Result< RoadSurfacePolyline > eve::procgen::road::detail::prepareSurfacePolyline (std::span< const SplineFrameSample > frames)
 Prepare a bounded piecewise road-center metric; rejects degenerate segments without publishing output.
 
Result< SplineFrameSample > eve::procgen::road::detail::sampleSurfacePolyline (const RoadSurfacePolyline &path, float distance)
 Sample one owned frame by segment direction; endpoints extrapolate, widths clamp to endpoint values. @cost Logarithmic in retained road rows; no spline scan or allocations per anchor.
 
Result< SplineSample > eve::procgen::road::detail::closestSurfacePolyline (const RoadSurfacePolyline &path, float x, float y, float z)
 Closest owned center sample for collision checks, linear in retained road rows.
 
Result< float > eve::procgen::road::detail::sideTerrainHeight (const RoadSideTerrainRule &rule, eve::IProcgenWorldQuery &query, float x, float z, const ProcgenPoint &pose, const std::array< float, 6 > *assetBounds, const RoadBakeOptions &options, std::size_t &work)
 Bounded height-only projection; provider and options are borrowed synchronously, no callbacks retained.
 
Result< std::vector< SplineFrameSample > > eve::procgen::road::detail::sampleRoadFrames (const SplinePath &path, const RoadEdge &edge, const RoadBakeOptions &options, float length, std::size_t &samplingWork)
 Module-private bounded sampling; zero metric spacing retains explicit fixed interval counts.
 
Result< std::vector< SplineFrameSample > > eve::procgen::road::detail::sampleRoadParametricFrames (const SplinePath &path, const RoadEdge &edge, const RoadBakeOptions &options, std::size_t &samplingWork)
 Module-private bounded parameter scan; pose construction remains owned by SplinePath.
 
Result< void > eve::procgen::road::detail::bakeFacilityPrefab (MeshBuild &mesh, const RoadFacilityPrefab &prefab, const std::vector< SplineFrameSample > &frames, float sourceLow, float sourceHigh, float fullSourceLength, std::size_t budget)
 Clip source triangles into frame slabs and deform their positions and inverse-transpose normals.
 
Result< V3 > eve::procgen::road::detail::sampleSurfaceProfilePoint (const RoadSurfacePolyline &path, float distance, float side, float asphaltHalf)
 Sample a profile-side offset from actual retained row vectors and widths, not a reconstructed normal. @cost Logarithmic row lookup; endpoint offsets clamp while the center extrapolates.
 
float eve::procgen::road::detail::scaledProfileSide (float side, float asphaltHalf, float scale)
 Module-private transverse width transform preserving fixed-width shoulders.
 
float eve::procgen::road::detail::profileAsphaltHalfWidth (const RoadProfile &profile)
 Module-private driving-surface half-width from a generated profile.
 
float eve::procgen::road::detail::maximumAsphaltHalfWidth (const RoadEdge &edge)
 Module-private conservative half-width bound for varying-width junction sockets.
 
template<class T >
Result< T > eve::procgen::road::detail::bakeFail (DiagnosticCode code, std::string message, std::string path={})
 
V3 eve::procgen::road::detail::operator+ (V3 a, V3 b)
 Module-private road bake implementation helper.
 
V3 eve::procgen::road::detail::operator- (V3 a, V3 b)
 Module-private road bake implementation helper.
 
V3 eve::procgen::road::detail::operator* (V3 a, float s)
 Module-private road bake implementation helper.
 
float eve::procgen::road::detail::dot (V3 a, V3 b)
 Module-private road bake implementation helper.
 
V3 eve::procgen::road::detail::cross (V3 a, V3 b)
 Module-private road bake implementation helper.
 
float eve::procgen::road::detail::length (V3 a)
 Module-private road bake implementation helper.
 
V3 eve::procgen::road::detail::normalize (V3 a)
 Module-private road bake implementation helper.
 
Result< V3 > eve::procgen::road::detail::sideTerrainNormal (eve::IProcgenWorldQuery &query, float x, float z, const RoadBakeOptions &options, std::size_t &work)
 Borrow the center surface normal with the same network-wide projection budget; no retained provider.
 
bool eve::procgen::road::detail::isMeshBudgetExceeded (const MeshBuild &mesh, const RoadBakeOptions &options)
 Module-private road bake implementation helper.
 
float eve::procgen::road::detail::junctionTrimDistance (float pathLength, float requestedRadius)
 Module-private road bake implementation helper.
 
int eve::procgen::road::detail::circularArcSegments (float radius, float angle, float maximumError)
 Module-private road bake implementation helper.
 
int eve::procgen::road::detail::quadraticSegments (V3 start, V3 control, V3 end, float angle, float maximumError)
 Module-private road bake implementation helper.
 
Result< SplinePath > eve::procgen::road::detail::edgeToSpline (const RoadEdge &edge)
 Module-private road bake implementation helper.
 
V3 eve::procgen::road::detail::authoredOutwardDirection (const RoadNode &node, const RoadEdge &edge)
 Module-private road bake implementation helper.
 
float eve::procgen::road::detail::asphaltHalfWidth (const RoadEdge &edge)
 Module-private road bake implementation helper.
 
float eve::procgen::road::detail::junctionSocketDistance (const RoadNetwork &network, const RoadNode &node, const RoadEdge &edge, float pathLength)
 Module-private road bake implementation helper.
 
float eve::procgen::road::detail::planeHeight (const JunctionPlane &plane, float x, float z)
 Module-private road bake implementation helper.
 
JunctionPlane eve::procgen::road::detail::fitJunctionPlane (const RoadNetwork &network, const RoadNode &node)
 Module-private road bake implementation helper.
 
Result< void > eve::procgen::road::detail::validateJunctionGeometry (const RoadNetwork &network, const RoadNode &node)
 Module-private road bake implementation helper.
 
void eve::procgen::road::detail::blendFrameToJunctionPlane (SplineFrameSample &frame, const JunctionPlane &plane, float weight)
 Module-private road bake implementation helper.
 
float eve::procgen::road::detail::signedAreaXZ (const std::vector< V3 > &polygon)
 Module-private road bake implementation helper.
 
float eve::procgen::road::detail::crossXZ (V3 a, V3 b, V3 c)
 Module-private road bake implementation helper.
 
bool eve::procgen::road::detail::isPointInTriangleXZ (V3 p, V3 a, V3 b, V3 c, float orientation)
 Module-private road bake implementation helper.
 
TriangulationStatus eve::procgen::road::detail::triangulateBoundary (const std::vector< V3 > &polygon, std::vector< std::array< std::size_t, 3 > > &triangles, BoundaryPointPolicy boundaryPolicy)
 
float eve::procgen::road::detail::laneCenterOffset (const RoadStyle &style, int lanesForward, int lanesBackward, int laneIndex, RoadLaneDirection direction)
 Module-private road bake implementation helper.
 
void eve::procgen::road::detail::appendBox (MeshBuild &mesh, V3 center, V3 side, V3 up, V3 forward, float hx, float hy, float hz, RoadMaterial material)
 Module-private road bake implementation helper.
 
void eve::procgen::road::detail::appendStripQuad (MeshBuild &mesh, V3 a, V3 b, V3 c, V3 d, V3 normal, float u0, float u1, float v0, float v1, RoadMaterial material, QuadDiagonal diagonal=QuadDiagonal::FirstToThird)
 Emit a bounded strip quad with the selected physical diagonal and unchanged vertex attributes.
 
void eve::procgen::road::detail::appendOrientedQuad (MeshBuild &mesh, V3 a, V3 b, V3 c, V3 d, V3 normal, float u0, float u1, float v0, float v1, RoadMaterial material, QuadDiagonal diagonal)
 Emit a quad whose winding matches normal (mesh3D expects object-space CCW).
 
void eve::procgen::road::detail::appendOrientedTri (MeshBuild &mesh, V3 a, V3 b, V3 c, V3 normal, float uvMeters, RoadMaterial material)
 Module-private road bake implementation helper.
 
Result< void > eve::procgen::road::detail::loftProfileClean (MeshBuild &mesh, const std::vector< SplineFrameSample > &frames, const RoadProfile &profile, float pathLength, float uvMeters, RoadMaterial asphaltMaterial, std::size_t budget, int subdivisions=1)
 Module-private road bake implementation helper.
 
Result< void > eve::procgen::road::detail::capProfileRing (MeshBuild &mesh, const SplineFrameSample &frame, const RoadProfile &profile, bool outward)
 Module-private road bake implementation helper.
 
void eve::procgen::road::detail::capProfileShoulders (MeshBuild &mesh, const SplineFrameSample &frame, const RoadProfile &profile, bool outward)
 Module-private road bake implementation helper.
 
Result< void > eve::procgen::road::detail::addDeckAndPiers (MeshBuild &mesh, const std::vector< SplineFrameSample > &frames, const RoadStyle &style, float halfWidth, float asphaltHalf, bool includePiers, std::size_t budget)
 Module-private road bake implementation helper.
 
Result< void > eve::procgen::road::detail::addLaneMarkings (MeshBuild &mesh, const std::vector< SplineFrameSample > &frames, const RoadEdge &edge, float pathLength, const RoadBakeOptions &options)
 Module-private road bake implementation helper.
 
void eve::procgen::road::detail::appendArrow (MeshBuild &mesh, V3 pos, V3 forward, V3 up, float size)
 Module-private road bake implementation helper.
 
Result< void > eve::procgen::road::detail::bakeStructuralGeometry (MeshBuild &mesh, const std::vector< SplineFrameSample > &frames, const RoadEdge &edge, const RoadProfile &profile, float pathLength, const RoadBakeOptions &options)
 Module-private road bake implementation helper.
 
Result< void > eve::procgen::road::detail::bakeContinuousFacilities (MeshBuild &mesh, const std::vector< SplineFrameSample > &frames, const RoadNetwork &network, const RoadEdge &edge, float pathLength, const RoadBakeOptions &options, const std::unordered_set< std::uint32_t > &activeNodes)
 Sweep continuous facilities and clip them to exact interval/socket boundaries.
 
Result< void > eve::procgen::road::detail::bakeEdgeGeometry (MeshBuild &mesh, RoadOverlay &overlay, const RoadNetwork &network, const RoadEdge &edge, const RoadBakeOptions &options, const std::unordered_set< std::uint32_t > &activeJunctionNodes, const std::unordered_set< std::uint32_t > &terminalNodes, RoadFrameCache &frameCache)
 Bake one edge.
 
Result< void > eve::procgen::road::detail::bakeJunction (MeshBuild &mesh, const RoadNetwork &network, const RoadNode &node, const RoadBakeOptions &options)
 Module-private road bake implementation helper.
 
Result< void > eve::procgen::road::detail::bakeTurnOverlays (MeshBuild &mesh, RoadOverlay &overlay, const RoadNetwork &network, const RoadBakeOptions &options, const std::unordered_set< std::uint32_t > &activeJunctionNodes)
 Module-private road bake implementation helper.
 
Result< void > eve::procgen::road::detail::bakePlacementPoints (PointSet &placements, const RoadNetwork &network, const RoadBakeOptions &options, const std::unordered_set< std::uint32_t > &activeJunctionNodes, RoadFrameCache &frameCache)
 Module-private road bake implementation helper.
 
bool eve::procgen::road::detail::isFacilityContinued (const RoadNetwork &network, std::uint32_t nodeId, const RoadEdge &edge, const RoadContinuousFacility &facility)
 Query compatible degree-two facility continuation; no retained peer pointer.
 
Result< void > eve::procgen::road::detail::bakeFacilityContinuations (MeshBuild &mesh, const RoadNetwork &network, const RoadBakeOptions &options, const std::unordered_set< std::uint32_t > &activeNodes)
 Fill compatible continuous-facility gaps across active degree-two junction sockets.
 
Result< SplinePath > eve::procgen::road::detail::edgeSplineForBake (const RoadEdge &edge)
 
float eve::procgen::road::detail::junctionSocketDistanceForBake (const RoadNetwork &network, const RoadNode &node, const RoadEdge &edge, float pathLength)
 
Result< void > eve::procgen::road::detail::bakeTrafficControlPoints (PointSet &placements, const RoadNetwork &network, const RoadBakeOptions &options)