Stateful CPU sculpting session with explicit bake, restore, and undo semantics. 更多...
#include <MeshDeformationSession.h>
Public 成员函数 | |
| Result< void > | initializeResult (const MeshBuild &mesh) |
| Replace the session with an owning copy of a valid source mesh. | |
| Result< void > | applyBrushResult (std::string_view mode, float x, float y, float z, float radius, float strength, float falloff, float directionX=0.f, float directionY=1.f, float directionZ=0.f) |
| Apply a localized brush to the current mesh. | |
| Result< void > | applyBrushGpuResult (std::string_view mode, float x, float y, float z, float radius, float strength, float falloff, float directionX=0.f, float directionY=1.f, float directionZ=0.f) |
| Apply a sculpt brush through the registered GPU provider; absence returns Unsupported. | |
| Result< void > | applyImpactResult (float x, float y, float z, float impulseX, float impulseY, float impulseZ, float radius, float plasticity, float hardness, float maxDisplacement) |
| Apply one collision-neutral plastic impact to the current mesh. | |
| Result< void > | applyImpactGpuResult (float x, float y, float z, float impulseX, float impulseY, float impulseZ, float radius, float plasticity, float hardness, float maxDisplacement) |
| Apply plastic damage through the registered GPU provider; absence returns Unsupported. | |
| Result< void > | prepareImpactVertexBlocksResult (int divisionsPerAxis) |
| Build a bounded uniform vertex-block index for repeated high-density impact queries. | |
| int | impactVertexBlockCount () const noexcept |
| Return the number of non-empty prepared impact blocks. | |
| bool | hasImpactVertexBlocks () const noexcept |
| Report whether impact queries currently use a prepared vertex-block index. | |
| Result< void > | applySurfaceContactResult (float x, float y, float z, float normalX, float normalY, float normalZ, float velocityX, float velocityY, float velocityZ, float radius, float depth, float drag, float falloff, float plasticity=0.f) |
| Apply one Interactive Surface contact using caller-supplied local-space values. | |
| Result< void > | recoverSurfaceResult (float dt, float recoveryRate) |
| Advance elastic recovery using explicit simulation time. | |
| Result< void > | applySlimeImpulseResult (float x, float y, float z, float impulseX, float impulseY, float impulseZ, float radius, float falloff) |
| Inject one localized velocity impulse into the Mesh Slime simulation state. | |
| Result< void > | stepSlimeResult (float dt, float stiffness, float damping, float maxSpeed) |
| Advance deterministic spring-damper Mesh Slime dynamics using injected time. | |
| Result< void > | configureColliderRefreshResult (std::string_view mode, float intervalSeconds, float offsetX=0.f, float offsetY=0.f, float offsetZ=0.f) |
| Configure collider refresh scheduling and local position offset. | |
| Result< void > | requestColliderRefreshResult () |
| Mark a manual or once collider refresh as pending. | |
| Result< bool > | updateColliderRefreshResult (float dt) |
| Advance the refresh scheduler and consume at most one pending refresh. | |
| Result< MeshBuild > | colliderMeshResult () const |
| Return an owning current triangle-mesh collider snapshot with configured offset applied. | |
| Result< int > | selectVerticesSphereResult (float x, float y, float z, float radius, bool replace=true) |
| Replace or extend vertex selection using a world/local-space sphere. | |
| Result< int > | selectVerticesBoxResult (float minX, float minY, float minZ, float maxX, float maxY, float maxZ, bool replace=true) |
| Replace or extend vertex selection using an axis-aligned world/local-space box. | |
| void | clearVertexSelection () noexcept |
| Clear runtime vertex selection. | |
| int | selectedVertexCount () const noexcept |
| Return selected vertex count. | |
| Result< MeshVertexSelectionCenter > | selectedVertexCenterResult () const |
| Return the arithmetic center of selected vertices for gizmo adapters. | |
| Result< void > | moveSelectedVerticesResult (float x, float y, float z) |
| Translate selected vertices by a finite axis-gizmo delta as one undoable edit. | |
| Result< void > | manipulateSelectedVerticesResult (std::string_view mode, float originX, float originY, float originZ, float directionX, float directionY, float directionZ, float distance) |
| Apply pull, push, or grab to selected vertices as one undoable edit. | |
| Result< void > | restoreResult () |
| Restore the initial mesh and clear undo history. | |
| Result< void > | bakeResult () |
| Make the current mesh the new restore point and clear undo history. | |
| Result< void > | undoResult () |
| Restore the most recent pre-edit snapshot. | |
| Result< MeshBuild > | currentMeshResult () const |
| Return an independent owning snapshot of the current mesh. | |
| std::uint64_t | revision () const noexcept |
| Return the monotonic state revision. | |
| int | undoCount () const noexcept |
| Return the number of available undo snapshots. | |
| bool | isInitialized () const noexcept |
| Report whether the session has been initialized. | |
详细描述
Stateful CPU sculpting session with explicit bake, restore, and undo semantics.
The session owns original, current, and bounded undo mesh snapshots. Calls are synchronous, graph-owning-thread only, and never retain caller memory. Failed edits preserve current state.
在文件 MeshDeformationSession.h 第 25 行定义.
成员函数说明
◆ applyBrushGpuResult()
| Result< void > eve::procgen::MeshDeformationSession::applyBrushGpuResult | ( | std::string_view | mode, |
| float | x, | ||
| float | y, | ||
| float | z, | ||
| float | radius, | ||
| float | strength, | ||
| float | falloff, | ||
| float | directionX = 0.f, |
||
| float | directionY = 1.f, |
||
| float | directionZ = 0.f |
||
| ) |
Apply a sculpt brush through the registered GPU provider; absence returns Unsupported.
在文件 MeshDeformationSession.cpp 第 224 行定义.
引用了 eve::Dent, eve::Directional, eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::Flatten, eve::procgen::MeshBuild::getVertexCount(), eve::procgen::MeshBuild::indices(), eve::Inflate, eve::InvalidArgument, eve::procgen::MeshBuild::normals(), eve::MeshDeformationComputeRequest::positions, eve::procgen::MeshBuild::positions(), eve::PreconditionViolation, radius, request, size, eve::Smooth, strength, eve::Result< T >::success(), triangle, eve::Unsupported, value, x, y , 以及 z.
◆ applyBrushResult()
| Result< void > eve::procgen::MeshDeformationSession::applyBrushResult | ( | std::string_view | mode, |
| float | x, | ||
| float | y, | ||
| float | z, | ||
| float | radius, | ||
| float | strength, | ||
| float | falloff, | ||
| float | directionX = 0.f, |
||
| float | directionY = 1.f, |
||
| float | directionZ = 0.f |
||
| ) |
Apply a localized brush to the current mesh.
- 参数
-
mode inflate, dent, flatten, smooth, or directional. x Brush center X. y Brush center Y. z Brush center Z. radius Positive world-space radius. strength Signed displacement scale. falloff Positive radial exponent. directionX Directional brush X. directionY Directional brush Y. directionZ Directional brush Z.
- 返回
- Applied or a structured diagnostic; failure leaves the mesh unchanged.
在文件 MeshDeformationSession.cpp 第 152 行定义.
引用了 distance, dx, dy, dz, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::procgen::MeshBuild::getVertexCount(), eve::procgen::MeshBuild::indices(), eve::InvalidArgument, eve::procgen::MeshBuild::normals(), positions, eve::procgen::MeshBuild::positions(), eve::PreconditionViolation, radius, size, strength, eve::Result< T >::success(), triangle, vx, vy, vz, weight, x, y , 以及 z.
◆ applyImpactGpuResult()
| Result< void > eve::procgen::MeshDeformationSession::applyImpactGpuResult | ( | float | x, |
| float | y, | ||
| float | z, | ||
| float | impulseX, | ||
| float | impulseY, | ||
| float | impulseZ, | ||
| float | radius, | ||
| float | plasticity, | ||
| float | hardness, | ||
| float | maxDisplacement | ||
| ) |
Apply plastic damage through the registered GPU provider; absence returns Unsupported.
在文件 MeshDeformationSession.cpp 第 346 行定义.
引用了 eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::Impact, eve::InvalidArgument, eve::procgen::MeshBuild::normals(), eve::MeshDeformationComputeRequest::operation, eve::procgen::MeshBuild::positions(), eve::PreconditionViolation, radius, request, eve::Result< T >::success(), eve::Unsupported, value, x, y , 以及 z.
◆ applyImpactResult()
| Result< void > eve::procgen::MeshDeformationSession::applyImpactResult | ( | float | x, |
| float | y, | ||
| float | z, | ||
| float | impulseX, | ||
| float | impulseY, | ||
| float | impulseZ, | ||
| float | radius, | ||
| float | plasticity, | ||
| float | hardness, | ||
| float | maxDisplacement | ||
| ) |
Apply one collision-neutral plastic impact to the current mesh.
- 参数
-
x Impact center X. y Impact center Y. z Impact center Z. impulseX World/local impulse X. impulseY Impulse Y. impulseZ Impulse Z. radius Positive influence radius. plasticity Non-negative impulse-to-displacement scale. hardness Positive radial falloff exponent. maxDisplacement Positive distance each vertex may move from the baked baseline.
- 返回
- Applied atomically, or a diagnostic without changing mesh or history.
Physics adapters remain responsible for coordinate conversion and impulse filtering. This session consumes plain values, retains no contact pointers, and is synchronous/thread-affine.
在文件 MeshDeformationSession.cpp 第 293 行定义.
引用了 distance, dx, dy, dz, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, positions, eve::procgen::MeshBuild::positions(), eve::PreconditionViolation, radius, scale, eve::Result< T >::success(), x, y , 以及 z.
◆ applySlimeImpulseResult()
| Result< void > eve::procgen::MeshDeformationSession::applySlimeImpulseResult | ( | float | x, |
| float | y, | ||
| float | z, | ||
| float | impulseX, | ||
| float | impulseY, | ||
| float | impulseZ, | ||
| float | radius, | ||
| float | falloff | ||
| ) |
Inject one localized velocity impulse into the Mesh Slime simulation state.
在文件 MeshDeformationSession.cpp 第 460 行定义.
引用了 distance, dx, dy, dz, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::procgen::MeshBuild::getVertexCount(), eve::InvalidArgument, positions, eve::procgen::MeshBuild::positions(), eve::PreconditionViolation, radius, eve::Result< T >::success(), weight, x, y , 以及 z.
◆ applySurfaceContactResult()
| Result< void > eve::procgen::MeshDeformationSession::applySurfaceContactResult | ( | float | x, |
| float | y, | ||
| float | z, | ||
| float | normalX, | ||
| float | normalY, | ||
| float | normalZ, | ||
| float | velocityX, | ||
| float | velocityY, | ||
| float | velocityZ, | ||
| float | radius, | ||
| float | depth, | ||
| float | drag, | ||
| float | falloff, | ||
| float | plasticity = 0.f |
||
| ) |
Apply one Interactive Surface contact using caller-supplied local-space values.
- 参数
-
x Contact X. y Contact Y. z Contact Z. normalX Surface normal X. normalY Surface normal Y. normalZ Surface normal Z. velocityX Contact velocity X. velocityY Contact velocity Y. velocityZ Contact velocity Z. radius Positive influence radius. depth Non-negative indentation distance. drag Non-negative tangential velocity scale. falloff Positive radial exponent. plasticity Permanent displacement fraction in [0, 1].
- 返回
- Applied atomically, or a diagnostic preserving mesh, equilibrium state, and history.
在文件 MeshDeformationSession.cpp 第 384 行定义.
引用了 depth, distance, dx, dy, dz, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::procgen::MeshBuild::getVertexCount(), eve::InvalidArgument, positions, eve::procgen::MeshBuild::positions(), eve::PreconditionViolation, radius, source, eve::Result< T >::success(), weight, x, y , 以及 z.
◆ bakeResult()
| Result< void > eve::procgen::MeshDeformationSession::bakeResult | ( | ) |
Make the current mesh the new restore point and clear undo history.
在文件 MeshDeformationSession.cpp 第 749 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::procgen::MeshBuild::positions(), eve::PreconditionViolation , 以及 eve::Result< T >::success().
◆ clearVertexSelection()
|
noexcept |
◆ colliderMeshResult()
Return an owning current triangle-mesh collider snapshot with configured offset applied.
在文件 MeshDeformationSession.cpp 第 580 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), positions, eve::procgen::MeshBuild::positions(), eve::PreconditionViolation, eve::procgen::MeshBuild::setMeta() , 以及 eve::Result< T >::success().
◆ configureColliderRefreshResult()
| Result< void > eve::procgen::MeshDeformationSession::configureColliderRefreshResult | ( | std::string_view | mode, |
| float | intervalSeconds, | ||
| float | offsetX = 0.f, |
||
| float | offsetY = 0.f, |
||
| float | offsetZ = 0.f |
||
| ) |
Configure collider refresh scheduling and local position offset.
在文件 MeshDeformationSession.cpp 第 527 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, offsetX, offsetY, eve::PreconditionViolation , 以及 eve::Result< T >::success().
◆ currentMeshResult()
Return an independent owning snapshot of the current mesh.
在文件 MeshDeformationSession.cpp 第 774 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::PreconditionViolation , 以及 eve::Result< T >::success().
◆ hasImpactVertexBlocks()
|
inlinenoexcept |
Report whether impact queries currently use a prepared vertex-block index.
在文件 MeshDeformationSession.h 第 72 行定义.
◆ impactVertexBlockCount()
|
noexcept |
Return the number of non-empty prepared impact blocks.
在文件 MeshDeformationSession.cpp 第 119 行定义.
◆ initializeResult()
Replace the session with an owning copy of a valid source mesh.
在文件 MeshDeformationSession.cpp 第 52 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, mesh, eve::Result< T >::success() , 以及 u.
◆ isInitialized()
|
inlinenoexcept |
Report whether the session has been initialized.
在文件 MeshDeformationSession.h 第 149 行定义.
◆ manipulateSelectedVerticesResult()
| Result< void > eve::procgen::MeshDeformationSession::manipulateSelectedVerticesResult | ( | std::string_view | mode, |
| float | originX, | ||
| float | originY, | ||
| float | originZ, | ||
| float | directionX, | ||
| float | directionY, | ||
| float | directionZ, | ||
| float | distance | ||
| ) |
Apply pull, push, or grab to selected vertices as one undoable edit.
- 参数
-
mode pull, push, or grab. originX Manipulator origin X. originY Manipulator origin Y. originZ Manipulator origin Z. directionX Grab direction X. directionY Grab direction Y. directionZ Grab direction Z. distance Signed manipulation distance.
在文件 MeshDeformationSession.cpp 第 698 行定义.
引用了 distance, dx, dy, dz, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::procgen::MeshBuild::getVertexCount(), eve::InvalidArgument, length, moveSelectedVerticesResult(), positions, eve::procgen::MeshBuild::positions(), eve::PreconditionViolation, selectedVertexCount() , 以及 eve::Result< T >::success().
◆ moveSelectedVerticesResult()
| Result< void > eve::procgen::MeshDeformationSession::moveSelectedVerticesResult | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
Translate selected vertices by a finite axis-gizmo delta as one undoable edit.
在文件 MeshDeformationSession.cpp 第 670 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::procgen::MeshBuild::getVertexCount(), eve::InvalidArgument, positions, eve::procgen::MeshBuild::positions(), eve::PreconditionViolation, selectedVertexCount(), eve::Result< T >::success(), x, y , 以及 z.
被这些函数引用 manipulateSelectedVerticesResult().
◆ prepareImpactVertexBlocksResult()
| Result< void > eve::procgen::MeshDeformationSession::prepareImpactVertexBlocksResult | ( | int | divisionsPerAxis | ) |
Build a bounded uniform vertex-block index for repeated high-density impact queries.
在文件 MeshDeformationSession.cpp 第 79 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::procgen::MeshBuild::getVertexCount(), index, eve::InvalidArgument, maximum, minimum, positions, eve::procgen::MeshBuild::positions(), eve::PreconditionViolation, eve::Result< T >::success() , 以及 value.
◆ recoverSurfaceResult()
| Result< void > eve::procgen::MeshDeformationSession::recoverSurfaceResult | ( | float | dt, |
| float | recoveryRate | ||
| ) |
Advance elastic recovery using explicit simulation time.
- 参数
-
dt Non-negative injected step duration. recoveryRate Positive exponential recovery rate.
- 返回
- Success without adding undo history; invalid input leaves state unchanged.
在文件 MeshDeformationSession.cpp 第 435 行定义.
引用了 blend, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, positions, eve::procgen::MeshBuild::positions(), eve::PreconditionViolation , 以及 eve::Result< T >::success().
◆ requestColliderRefreshResult()
| Result< void > eve::procgen::MeshDeformationSession::requestColliderRefreshResult | ( | ) |
Mark a manual or once collider refresh as pending.
在文件 MeshDeformationSession.cpp 第 549 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::PreconditionViolation , 以及 eve::Result< T >::success().
◆ restoreResult()
| Result< void > eve::procgen::MeshDeformationSession::restoreResult | ( | ) |
Restore the initial mesh and clear undo history.
在文件 MeshDeformationSession.cpp 第 736 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::procgen::MeshBuild::positions(), eve::PreconditionViolation , 以及 eve::Result< T >::success().
◆ revision()
|
inlinenoexcept |
Return the monotonic state revision.
在文件 MeshDeformationSession.h 第 145 行定义.
◆ selectedVertexCenterResult()
| Result< MeshVertexSelectionCenter > eve::procgen::MeshDeformationSession::selectedVertexCenterResult | ( | ) | const |
Return the arithmetic center of selected vertices for gizmo adapters.
在文件 MeshDeformationSession.cpp 第 648 行定义.
引用了 center, count, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::procgen::MeshBuild::getVertexCount(), positions, eve::procgen::MeshBuild::positions(), eve::PreconditionViolation, selectedVertexCount() , 以及 eve::Result< T >::success().
◆ selectedVertexCount()
|
noexcept |
Return selected vertex count.
在文件 MeshDeformationSession.cpp 第 644 行定义.
被这些函数引用 manipulateSelectedVerticesResult(), moveSelectedVerticesResult(), selectedVertexCenterResult(), selectVerticesBoxResult() , 以及 selectVerticesSphereResult().
◆ selectVerticesBoxResult()
| Result< int > eve::procgen::MeshDeformationSession::selectVerticesBoxResult | ( | float | minX, |
| float | minY, | ||
| float | minZ, | ||
| float | maxX, | ||
| float | maxY, | ||
| float | maxZ, | ||
| bool | replace = true |
||
| ) |
Replace or extend vertex selection using an axis-aligned world/local-space box.
在文件 MeshDeformationSession.cpp 第 618 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::procgen::MeshBuild::getVertexCount(), eve::InvalidArgument, positions, eve::procgen::MeshBuild::positions(), eve::PreconditionViolation, selectedVertexCount(), eve::Result< T >::success() , 以及 u.
◆ selectVerticesSphereResult()
| Result< int > eve::procgen::MeshDeformationSession::selectVerticesSphereResult | ( | float | x, |
| float | y, | ||
| float | z, | ||
| float | radius, | ||
| bool | replace = true |
||
| ) |
Replace or extend vertex selection using a world/local-space sphere.
在文件 MeshDeformationSession.cpp 第 597 行定义.
引用了 dx, dy, dz, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::procgen::MeshBuild::getVertexCount(), eve::InvalidArgument, positions, eve::procgen::MeshBuild::positions(), eve::PreconditionViolation, radius, selectedVertexCount(), eve::Result< T >::success(), u, x, y , 以及 z.
◆ stepSlimeResult()
| Result< void > eve::procgen::MeshDeformationSession::stepSlimeResult | ( | float | dt, |
| float | stiffness, | ||
| float | damping, | ||
| float | maxSpeed | ||
| ) |
Advance deterministic spring-damper Mesh Slime dynamics using injected time.
- 参数
-
dt Positive simulation step. stiffness Non-negative equilibrium attraction. damping Non-negative exponential velocity damping. maxSpeed Positive velocity bound.
在文件 MeshDeformationSession.cpp 第 488 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::procgen::MeshBuild::getVertexCount(), index, eve::InvalidArgument, positions, eve::procgen::MeshBuild::positions(), eve::PreconditionViolation, scale , 以及 eve::Result< T >::success().
◆ undoCount()
|
inlinenoexcept |
Return the number of available undo snapshots.
在文件 MeshDeformationSession.h 第 147 行定义.
◆ undoResult()
| Result< void > eve::procgen::MeshDeformationSession::undoResult | ( | ) |
Restore the most recent pre-edit snapshot.
在文件 MeshDeformationSession.cpp 第 762 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::NotFound , 以及 eve::Result< T >::success().
◆ updateColliderRefreshResult()
| Result< bool > eve::procgen::MeshDeformationSession::updateColliderRefreshResult | ( | float | dt | ) |
Advance the refresh scheduler and consume at most one pending refresh.
在文件 MeshDeformationSession.cpp 第 557 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::PreconditionViolation , 以及 eve::Result< T >::success().
该类的文档由以下文件生成:
- src/modules/procgen/mesh/MeshDeformationSession.h
- src/modules/procgen/mesh/MeshDeformationSession.cpp