EVENGINE_API_WORLD public API. 更多...
#include <BuildingFx.h>
类 | |
| struct | CurveControlPoint |
| One cubic Bezier control point in logical grid-vertex coordinates. 更多... | |
| struct | CurveMeshData |
| Owning backend-neutral indexed extrusion generated along an edge curve. 更多... | |
| struct | CurveSurfaceSample |
| One committed world-space centerline frame for terrain-conforming extrusion. 更多... | |
Public 类型 | |
| using | MeshResolver = std::function< graphics::Mesh *(const std::string &resourceId)> |
| Resolve a stable visual resource id to a borrowed graphics mesh. | |
Public 成员函数 | |
| Module_REG (BuildingFx) | |
| BuildingFx ()=default | |
| ~BuildingFx () override=default | |
| bool | attach (building::PlacementWorld *world) |
| bool | detach (building::PlacementWorld *world) |
| bool | isAttached (building::PlacementWorld *world) const |
| int | getAttachedCount () const |
| void | sync (building::PlacementWorld *world) |
| int | getVisualCount (building::PlacementWorld *world) const |
| void | setMeshResolver (MeshResolver resolver) |
Install the synchronous mesh resolver used by visual3d mesh metadata. @lifetime Returned meshes remain provider-owned and must outlive every referencing visual. @reentrancy The callback runs without a BuildingFx lock and must not call sync recursively. | |
| void | clearMeshResolver () |
| Remove the mesh resolver; configured resources fall back to the primitive cube. | |
| std::string | getVisualVariant (building::PlacementWorld *world, int instanceId) const |
| Current derived topology variant for one visual, or empty when unavailable. | |
| std::string | getVisualResource (building::PlacementWorld *world, int instanceId) const |
| Selected configured resource id after mask, class, and base resolution. | |
| std::string | getVisualFallbackReason (building::PlacementWorld *world, int instanceId) const |
| Empty on resolved resources, otherwise a stable observable degradation reason. | |
| void | setLevelVisibilityMode (building::PlacementWorld *world, const std::string &mode) |
Set per-world floor visibility: all, active, or active_and_below. | |
| std::string | getLevelVisibilityMode (building::PlacementWorld *world) const |
| Return the stable per-world floor visibility token. | |
| bool | isVisualVisible (building::PlacementWorld *world, int instanceId) const |
| Return whether one synchronized instance is currently visible. | |
| int | getCurveGroupCount (building::PlacementWorld *world) const |
| Number of authoritative curve groups observed by the last sync. | |
| int | getContinuousCurveVisualCount (building::PlacementWorld *world) const |
| Number of curve groups currently rendered as one continuous 3D mesh. | |
| std::string | getCurveVisualFallbackReason (building::PlacementWorld *world, int instanceId) const |
| Stable degradation reason for the curve group containing an instance. | |
| eve::Result< void > | updateEdgeCurvePreview (building::PlacementWorld *world, const std::string &buildingId, const std::vector< CurveControlPoint > &controlPoints, int subdivisions, int level=0) |
| Build and present a transient continuous curve draft without mutating placement. | |
| eve::Result< void > | updateEdgeCurveSurfacePreview (building::PlacementWorld *world, building::PlacementSession *session, int subdivisions, const std::string &surfaceName) |
| Present the active session curve using frames from a named custom surface. | |
| CurvePreviewUpdateStatus | updateEdgeCurveSurfacePreviewStatus (building::PlacementWorld *world, building::PlacementSession *session, int subdivisions, const std::string &surfaceName) |
| Script projection of updateEdgeCurveSurfacePreview's structured result. | |
| void | clearEdgeCurvePreview (building::PlacementWorld *world) |
| Remove the transient continuous curve draft for a world. | |
| bool | hasEdgeCurvePreview (building::PlacementWorld *world) const |
| Return whether the world owns a current CPU curve-preview mesh. | |
| std::string | getEdgeCurvePreviewFallbackReason (building::PlacementWorld *world) const |
| Return the stable backend degradation reason for the transient curve preview. | |
| std::string | getEdgeCurvePreviewSurfaceId (building::PlacementWorld *world) const |
| Surface identity represented by the current preview, or empty. | |
| std::uint64_t | getEdgeCurvePreviewSurfaceRevision (building::PlacementWorld *world) const |
| Surface revision represented by the current preview, or zero. | |
| void | updateGhost (building::PlacementWorld *world, building::Ghost *ghost) |
| void | hideGhost (building::PlacementWorld *world) |
| void | updateAreaPreview (building::PlacementWorld *world, building::PlacementSession *session) |
| Copy the session's owning area-preview projection for 2D/3D heatmap rendering. | |
| void | clearAreaPreview (building::PlacementWorld *world) |
| Clear all area-preview cells and their derived render entities. | |
| int | getAreaPreviewCount (building::PlacementWorld *world) const |
| bool | getAreaPreviewAccepted (building::PlacementWorld *world, int index) const |
| void | setGridVisible (building::PlacementWorld *world, bool visible) |
| bool | getGridVisible (building::PlacementWorld *world) const |
| void | drawGrid2D (building::PlacementWorld *world, graphics::Graphics *gfx) |
| void | drawGrid3D (building::PlacementWorld *world, graphics::Graphics *gfx, float height=0.f) |
Public 成员函数 继承自 eve::Module | |
| virtual | ~Module () |
| Module. | |
| virtual std::string | getName () const =0 |
| Returns the name. | |
静态 Public 成员函数 | |
| static eve::Result< CurveMeshData > | buildEdgeCurveMesh (const building::PlacementWorld &world, const std::vector< CurveControlPoint > &controlPoints, int subdivisions, float width, float height, float elevation=0.f) |
| Generate a continuous rectangular wall extrusion along a cubic Bezier curve. | |
| static eve::Result< CurveMeshData > | buildSurfaceCurveMesh (const std::vector< CurveSurfaceSample > &samples, float width, float height) |
| Extrude a wall from committed world-space surface frames. | |
| static eve::Result< CurveMeshData > | buildEdgeCurveGroupMeshForInstance (const building::PlacementWorld &world, int instanceId, float width, float height, float elevation=0.f) |
| Generate the continuous mesh owned by the curve group containing an edge instance. | |
详细描述
EVENGINE_API_WORLD public API.
在文件 BuildingFx.h 第 41 行定义.
成员类型定义说明
◆ MeshResolver
| using eve::buildingfx::BuildingFx::MeshResolver = std::function<graphics::Mesh *(const std::string &resourceId)> |
Resolve a stable visual resource id to a borrowed graphics mesh.
在文件 BuildingFx.h 第 69 行定义.
构造及析构函数说明
◆ BuildingFx()
|
default |
◆ ~BuildingFx()
|
overridedefault |
成员函数说明
◆ attach()
| bool eve::buildingfx::BuildingFx::attach | ( | building::PlacementWorld * | world | ) |
◆ buildEdgeCurveGroupMeshForInstance()
|
static |
Generate the continuous mesh owned by the curve group containing an edge instance.
- 参数
-
world Borrowed authoritative placement world used only during this call. instanceId Positive edge instance id linked to a curve group. width Positive wall thickness in world units. height Positive extrusion height along the grid-plane normal. elevation Base elevation along the grid-plane normal.
- 返回
- Owning CPU mesh data, or the placement/group diagnostic without mutation.
在文件 BuildingFx.cpp 第 422 行定义.
引用了 buildSurfaceCurveMesh(), eve::Diagnostic::error(), eve::Result< T >::failure(), group, height, eve::InvalidArgument, width , 以及 world.
◆ buildEdgeCurveMesh()
|
static |
Generate a continuous rectangular wall extrusion along a cubic Bezier curve.
- 参数
-
world Borrowed world used only during this synchronous call for grid projection. controlPoints Exactly four finite logical grid control points. subdivisions Number of analytic curve segments in the range 2..4096. width Positive wall thickness in world units. height Positive extrusion height along the grid-plane normal. elevation Base elevation along the grid-plane normal.
- 返回
- Owning CPU mesh data, or a structured diagnostic without graphics-side mutation.
在文件 BuildingFx.cpp 第 169 行定义.
引用了 a, b, elevation, eve::Diagnostic::error(), eve::Result< T >::failure(), halfWidth, height, eve::grid::Hexagon, indices, eve::InvalidArgument, layout, left, mesh, nx, ny, point, px, py, right, eve::buildingfx::BuildingFx::CurveMeshData::sampleCount, eve::grid::Staggered, start, eve::Result< T >::success(), t, tangent, u, eve::Unsupported, v, width, world, x, eve::grid::XZ , 以及 y.
◆ buildSurfaceCurveMesh()
|
static |
Extrude a wall from committed world-space surface frames.
在文件 BuildingFx.cpp 第 323 行定义.
引用了 a, b, center, eve::Diagnostic::error(), eve::Result< T >::failure(), halfWidth, height, index, eve::InvalidArgument, left, mesh, normal, normals, position, right, eve::buildingfx::BuildingFx::CurveMeshData::sampleCount, start, eve::Result< T >::success(), tangent, u, v , 以及 width.
被这些函数引用 buildEdgeCurveGroupMeshForInstance().
◆ clearAreaPreview()
| void eve::buildingfx::BuildingFx::clearAreaPreview | ( | building::PlacementWorld * | world | ) |
Clear all area-preview cells and their derived render entities.
在文件 BuildingFx.cpp 第 1404 行定义.
引用了 world.
◆ clearEdgeCurvePreview()
| void eve::buildingfx::BuildingFx::clearEdgeCurvePreview | ( | building::PlacementWorld * | world | ) |
Remove the transient continuous curve draft for a world.
在文件 BuildingFx.cpp 第 581 行定义.
引用了 eve::buildingfx::BuildingFx::WorldState::CurveVisual::active, eve::buildingfx::BuildingFx::WorldState::CurveVisual::controlPoints, eve::buildingfx::BuildingFx::WorldState::CurveVisual::cpuMesh, eve::buildingfx::BuildingFx::WorldState::CurveVisual::fallbackReason, eve::buildingfx::BuildingFx::WorldState::CurveVisual::renderable, state , 以及 world.
◆ clearMeshResolver()
|
inline |
Remove the mesh resolver; configured resources fall back to the primitive cube.
在文件 BuildingFx.h 第 86 行定义.
◆ detach()
| bool eve::buildingfx::BuildingFx::detach | ( | building::PlacementWorld * | world | ) |
在文件 BuildingFx.cpp 第 630 行定义.
引用了 world.
◆ drawGrid2D()
| void eve::buildingfx::BuildingFx::drawGrid2D | ( | building::PlacementWorld * | world, |
| graphics::Graphics * | gfx | ||
| ) |
2D 网格叠加(立即模式;在渲染循环中、tilemap 绘制之后调用)。
在文件 BuildingFx.cpp 第 1432 行定义.
引用了 cell, eve::graphics::Graphics::drawSolidRect(), px, py, world, x , 以及 y.
◆ drawGrid3D()
| void eve::buildingfx::BuildingFx::drawGrid3D | ( | building::PlacementWorld * | world, |
| graphics::Graphics * | gfx, | ||
| float | height = 0.f |
||
| ) |
◆ getAreaPreviewAccepted()
| bool eve::buildingfx::BuildingFx::getAreaPreviewAccepted | ( | building::PlacementWorld * | world, |
| int | index | ||
| ) | const |
在文件 BuildingFx.cpp 第 1416 行定义.
◆ getAreaPreviewCount()
| int eve::buildingfx::BuildingFx::getAreaPreviewCount | ( | building::PlacementWorld * | world | ) | const |
在文件 BuildingFx.cpp 第 1411 行定义.
引用了 world.
◆ getAttachedCount()
| int eve::buildingfx::BuildingFx::getAttachedCount | ( | ) | const |
在文件 BuildingFx.cpp 第 643 行定义.
◆ getContinuousCurveVisualCount()
| int eve::buildingfx::BuildingFx::getContinuousCurveVisualCount | ( | building::PlacementWorld * | world | ) | const |
Number of curve groups currently rendered as one continuous 3D mesh.
在文件 BuildingFx.cpp 第 1076 行定义.
◆ getCurveGroupCount()
| int eve::buildingfx::BuildingFx::getCurveGroupCount | ( | building::PlacementWorld * | world | ) | const |
Number of authoritative curve groups observed by the last sync.
在文件 BuildingFx.cpp 第 1068 行定义.
◆ getCurveVisualFallbackReason()
| std::string eve::buildingfx::BuildingFx::getCurveVisualFallbackReason | ( | building::PlacementWorld * | world, |
| int | instanceId | ||
| ) | const |
Stable degradation reason for the curve group containing an instance.
在文件 BuildingFx.cpp 第 1087 行定义.
◆ getEdgeCurvePreviewFallbackReason()
| std::string eve::buildingfx::BuildingFx::getEdgeCurvePreviewFallbackReason | ( | building::PlacementWorld * | world | ) | const |
Return the stable backend degradation reason for the transient curve preview.
在文件 BuildingFx.cpp 第 601 行定义.
◆ getEdgeCurvePreviewSurfaceId()
| std::string eve::buildingfx::BuildingFx::getEdgeCurvePreviewSurfaceId | ( | building::PlacementWorld * | world | ) | const |
Surface identity represented by the current preview, or empty.
在文件 BuildingFx.cpp 第 610 行定义.
◆ getEdgeCurvePreviewSurfaceRevision()
| std::uint64_t eve::buildingfx::BuildingFx::getEdgeCurvePreviewSurfaceRevision | ( | building::PlacementWorld * | world | ) | const |
Surface revision represented by the current preview, or zero.
在文件 BuildingFx.cpp 第 617 行定义.
◆ getGridVisible()
| bool eve::buildingfx::BuildingFx::getGridVisible | ( | building::PlacementWorld * | world | ) | const |
在文件 BuildingFx.cpp 第 1427 行定义.
引用了 world.
◆ getLevelVisibilityMode()
| std::string eve::buildingfx::BuildingFx::getLevelVisibilityMode | ( | building::PlacementWorld * | world | ) | const |
Return the stable per-world floor visibility token.
在文件 BuildingFx.cpp 第 1118 行定义.
◆ getVisualCount()
| int eve::buildingfx::BuildingFx::getVisualCount | ( | building::PlacementWorld * | world | ) | const |
在文件 BuildingFx.cpp 第 1063 行定义.
引用了 world.
◆ getVisualFallbackReason()
| std::string eve::buildingfx::BuildingFx::getVisualFallbackReason | ( | building::PlacementWorld * | world, |
| int | instanceId | ||
| ) | const |
Empty on resolved resources, otherwise a stable observable degradation reason.
在文件 BuildingFx.cpp 第 1152 行定义.
◆ getVisualResource()
| std::string eve::buildingfx::BuildingFx::getVisualResource | ( | building::PlacementWorld * | world, |
| int | instanceId | ||
| ) | const |
Selected configured resource id after mask, class, and base resolution.
在文件 BuildingFx.cpp 第 1145 行定义.
◆ getVisualVariant()
| std::string eve::buildingfx::BuildingFx::getVisualVariant | ( | building::PlacementWorld * | world, |
| int | instanceId | ||
| ) | const |
Current derived topology variant for one visual, or empty when unavailable.
在文件 BuildingFx.cpp 第 1137 行定义.
◆ hasEdgeCurvePreview()
| bool eve::buildingfx::BuildingFx::hasEdgeCurvePreview | ( | building::PlacementWorld * | world | ) | const |
Return whether the world owns a current CPU curve-preview mesh.
在文件 BuildingFx.cpp 第 595 行定义.
◆ hideGhost()
| void eve::buildingfx::BuildingFx::hideGhost | ( | building::PlacementWorld * | world | ) |
在文件 BuildingFx.cpp 第 1379 行定义.
引用了 world.
◆ isAttached()
| bool eve::buildingfx::BuildingFx::isAttached | ( | building::PlacementWorld * | world | ) | const |
在文件 BuildingFx.cpp 第 639 行定义.
引用了 world.
◆ isVisualVisible()
| bool eve::buildingfx::BuildingFx::isVisualVisible | ( | building::PlacementWorld * | world, |
| int | instanceId | ||
| ) | const |
Return whether one synchronized instance is currently visible.
在文件 BuildingFx.cpp 第 1128 行定义.
◆ Module_REG()
| eve::buildingfx::BuildingFx::Module_REG | ( | BuildingFx | ) |
◆ setGridVisible()
| void eve::buildingfx::BuildingFx::setGridVisible | ( | building::PlacementWorld * | world, |
| bool | visible | ||
| ) |
在文件 BuildingFx.cpp 第 1422 行定义.
◆ setLevelVisibilityMode()
| void eve::buildingfx::BuildingFx::setLevelVisibilityMode | ( | building::PlacementWorld * | world, |
| const std::string & | mode | ||
| ) |
Set per-world floor visibility: all, active, or active_and_below.
在文件 BuildingFx.cpp 第 1101 行定义.
◆ setMeshResolver()
|
inline |
Install the synchronous mesh resolver used by visual3d mesh metadata. @lifetime Returned meshes remain provider-owned and must outlive every referencing visual. @reentrancy The callback runs without a BuildingFx lock and must not call sync recursively.
在文件 BuildingFx.h 第 84 行定义.
◆ sync()
| void eve::buildingfx::BuildingFx::sync | ( | building::PlacementWorld * | world | ) |
与当前建筑实例做 diff:创建缺失视觉、刷新位姿、销毁移除的视觉。
在文件 BuildingFx.cpp 第 903 行定义.
引用了 eve::building::BuildingRegistry::find(), n, v, visible , 以及 world.
◆ updateAreaPreview()
| void eve::buildingfx::BuildingFx::updateAreaPreview | ( | building::PlacementWorld * | world, |
| building::PlacementSession * | session | ||
| ) |
Copy the session's owning area-preview projection for 2D/3D heatmap rendering.
在文件 BuildingFx.cpp 第 1388 行定义.
◆ updateEdgeCurvePreview()
| eve::Result< void > eve::buildingfx::BuildingFx::updateEdgeCurvePreview | ( | building::PlacementWorld * | world, |
| const std::string & | buildingId, | ||
| const std::vector< CurveControlPoint > & | controlPoints, | ||
| int | subdivisions, | ||
| int | level = 0 |
||
| ) |
Build and present a transient continuous curve draft without mutating placement.
在文件 BuildingFx.cpp 第 449 行定义.
引用了 elevation, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::building::BuildingRegistry::find(), height, level, eve::PreconditionViolation, state, width , 以及 world.
◆ updateEdgeCurveSurfacePreview()
| eve::Result< void > eve::buildingfx::BuildingFx::updateEdgeCurveSurfacePreview | ( | building::PlacementWorld * | world, |
| building::PlacementSession * | session, | ||
| int | subdivisions, | ||
| const std::string & | surfaceName | ||
| ) |
Present the active session curve using frames from a named custom surface.
- 参数
-
world Attached authoritative world, borrowed for this call. session Active placement session owning exactly four curve controls. subdivisions Analytic surface sample segment count. surfaceName Registered surface provider used by a subsequent matching commit.
- 返回
- Success after CPU generation (including explicit graphics-unavailable degradation), or a diagnostic without replacing the last valid preview.
在文件 BuildingFx.cpp 第 473 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::building::BuildingRegistry::find(), eve::PreconditionViolation, eve::building::PlacementSystem::sampleEdgeCurveSurface(), session, state , 以及 world.
◆ updateEdgeCurveSurfacePreviewStatus()
| CurvePreviewUpdateStatus eve::buildingfx::BuildingFx::updateEdgeCurveSurfacePreviewStatus | ( | building::PlacementWorld * | world, |
| building::PlacementSession * | session, | ||
| int | subdivisions, | ||
| const std::string & | surfaceName | ||
| ) |
Script projection of updateEdgeCurveSurfacePreview's structured result.
在文件 BuildingFx.cpp 第 516 行定义.
◆ updateGhost()
| void eve::buildingfx::BuildingFx::updateGhost | ( | building::PlacementWorld * | world, |
| building::Ghost * | ghost | ||
| ) |
每帧调用:按 ghost 位姿与合法性更新预览与占地光标(绿=合法 / 红=非法)。
在文件 BuildingFx.cpp 第 1161 行定义.
引用了 eve::building::PlacedBuilding::buildingId, eve::building::PlacedBuilding::corner, eve::building::PlacementSystem::effectiveFootprint(), eve::building::PlacedBuilding::elevation, eve::building::BuildingRegistry::find(), eve::building::BuildingDefinition::footprintH, eve::building::BuildingDefinition::footprintW, eve::building::Ghost::getBuildingId(), eve::building::Ghost::getCellX(), eve::building::Ghost::getCellY(), eve::building::Ghost::getElevation(), eve::building::Ghost::getPlacementKind(), eve::building::Ghost::getRotationDeg(), eve::building::Ghost::getSurfaceId(), eve::building::Ghost::getSurfaceNormalX(), eve::building::Ghost::getSurfaceNormalY(), eve::building::Ghost::getSurfaceNormalZ(), eve::building::Ghost::getSurfaceTangentX(), eve::building::Ghost::getSurfaceTangentY(), eve::building::Ghost::getSurfaceTangentZ(), eve::building::Ghost::getWorldX(), eve::building::Ghost::getWorldY(), eve::building::Ghost::isValid(), mr, eve::building::PlacedBuilding::originCellX, eve::building::PlacedBuilding::originCellY, placed, eve::building::PlacedBuilding::placementKind, r, eve::building::PlacedBuilding::rotationDeg, eve::building::PlacedBuilding::surfaceId, eve::building::PlacedBuilding::surfaceNormalX, eve::building::PlacedBuilding::surfaceNormalY, eve::building::PlacedBuilding::surfaceNormalZ, eve::building::PlacedBuilding::surfaceTangentX, eve::building::PlacedBuilding::surfaceTangentY, eve::building::PlacedBuilding::surfaceTangentZ, tr, valid, world, eve::building::PlacedBuilding::worldX, eve::building::PlacedBuilding::worldY , 以及 eve::grid::XZ.
该类的文档由以下文件生成:
- src/modules/building/fx/BuildingFx.h
- src/modules/building/fx/BuildingFx.cpp
Public 成员函数 继承自