Runtime owner of bone state, connection strain, and PhysicsLink bindings. 更多...
#include <GeometryCollectionInstance.h>
Public 成员函数 | |
| GeometryCollectionInstance (const GeometryCollectionInstance &)=delete | |
| GeometryCollectionInstance & | operator= (const GeometryCollectionInstance &)=delete |
| ~GeometryCollectionInstance () override | |
| Geometry collection instance. | |
| std::shared_ptr< const FractureGeometry > | fragmentGeometry () const noexcept override |
| Shared immutable geometry; empty for legacy box collections. @ownership Returned shared value keeps geometry alive independently of this instance. @thread Owner thread for acquisition; read-only sharing is safe after publication. | |
| bool | hasLiveWorld () const noexcept |
| Whether the owning world handle still resolves. | |
| void | setStepBudget (DestructionStepBudget budget) noexcept |
| Replace the per-step break/sleep budgets (0 = unlimited). | |
| DestructionStepBudget | stepBudget () const noexcept |
| Return the active per-step budgets. | |
| eve::Result< FieldApplicationReceipt > | applyField (const DestructionField &field) |
| Apply one destruction field; failure leaves instance unchanged. | |
| eve::Result< DestructionStepReceipt > | step (SimulationStep step) |
| Advance connection-graph breaks under the configured budget. | |
| int | boneCount () const noexcept override |
| Stable positive fragment count for this sample. | |
| int | edgeCount () const noexcept |
| BoneRuntimeState | boneState (int boneIndex) const |
| int | boneClusterId (int boneIndex) const |
| float | edgeStrain (int edgeIndex) const |
| bool | isEdgeBroken (int edgeIndex) const |
| Whether the edge at index has already broken. | |
| int | detachEventCount () const noexcept |
| BoneDetachEvent | detachEventAt (int index) const |
| int | clusterBreakEventCount () const noexcept |
| ClusterBreakEvent | clusterBreakEventAt (int index) const |
| Cluster break event at. | |
| int | pendingEdgeBreakCount () const noexcept |
| Edges still waiting because of the break budget. | |
| eve::Result< PhysicsLink > | boneLink (int boneIndex) const |
| Resolve the PhysicsLink for one bone against the live world. | |
| eve::Result< BonePresentation > | bonePresentation (int boneIndex) const override |
| Sample one bone's world pose and proxy extents for presentation. | |
| std::uint64_t | sleepBatchRevision () const noexcept |
| Monotonic revision bumped when any bone enters Sleeping (for batch rebuild). | |
| eve::Result< GeometryCollectionInstanceSnapshot > | captureSnapshot () const |
| Capture a process-portable runtime snapshot (no PhysicsLink handles). @ownership Caller owns the returned snapshot value. | |
| eve::Result< void > | restoreSnapshot (const GeometryCollectionInstanceSnapshot &snapshot) |
| Restore bone/edge state from a snapshot against the live world. | |
| void | releaseBodies () |
| Destroy owned bodies if the world is still live; always clears links. | |
Public 成员函数 继承自 eve::physics::CollapseCaptureSource | |
| virtual | ~CollapseCaptureSource () |
| Release the protocol object; does not transfer ownership to a recorder. | |
静态 Public 成员函数 | |
| static eve::Result< std::unique_ptr< GeometryCollectionInstance > > | create (World3D &world, const GeometryCollectionAsset &asset, float originX, float originY, float originZ) |
| Create bodies for every bone and bind PhysicsLinks. | |
| static eve::Result< std::unique_ptr< GeometryCollectionInstance > > | createFractured (World3D &world, const GeometryCollectionAsset &asset, const FractureGeometry &geometry, float originX, float originY, float originZ) |
| Instantiate exact convex fragments from a cooked mesh/graph pair. | |
详细描述
Runtime owner of bone state, connection strain, and PhysicsLink bindings.
@ownership Owns Body3D objects it creates; never retains raw World3D or Body3D pointers across calls. Borrows World3D only through a process-local handle. @lifetime Instance-first teardown destroys owned bodies then clears links; world-first teardown makes later resolve/step/applyField return StaleHandle. Either order leaves PhysicsLinks resolvable without use-after-free.
在文件 GeometryCollectionInstance.h 第 70 行定义.
构造及析构函数说明
◆ GeometryCollectionInstance()
|
delete |
◆ ~GeometryCollectionInstance()
|
override |
Geometry collection instance.
在文件 GeometryCollectionInstance.cpp 第 38 行定义.
成员函数说明
◆ applyField()
| eve::Result< FieldApplicationReceipt > eve::physics::GeometryCollectionInstance::applyField | ( | const DestructionField & | field | ) |
Apply one destruction field; failure leaves instance unchanged.
在文件 GeometryCollectionInstance.cpp 第 193 行定义.
引用了 body, eve::physics::FieldApplicationReceipt::bonesAffected, dx, dy, dz, edge, eve::physics::FieldApplicationReceipt::edgesAffected, eve::Diagnostic::error(), eve::Result< T >::failure(), impulse, eve::InvalidArgument, link, eve::physics::FieldApplicationReceipt::sleepsDeferred, eve::StaleHandle, state, eve::Result< T >::success(), vx, vy, vz , 以及 weight.
◆ boneClusterId()
| int eve::physics::GeometryCollectionInstance::boneClusterId | ( | int | boneIndex | ) | const |
在文件 GeometryCollectionInstance.cpp 第 446 行定义.
引用了 clusterId.
◆ boneCount()
|
inlineoverridevirtualnoexcept |
Stable positive fragment count for this sample.
实现了 eve::physics::CollapseCaptureSource.
在文件 GeometryCollectionInstance.h 第 131 行定义.
被这些函数引用 eve::physics::GeometryCollectionRenderer::draw() , 以及 eve::physics::GeometryCollectionRenderer::prepareInstance().
◆ boneLink()
| eve::Result< PhysicsLink > eve::physics::GeometryCollectionInstance::boneLink | ( | int | boneIndex | ) | const |
Resolve the PhysicsLink for one bone against the live world.
在文件 GeometryCollectionInstance.cpp 第 471 行定义.
引用了 body, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, link, eve::StaleHandle , 以及 eve::Result< T >::success().
◆ bonePresentation()
|
overridevirtual |
Sample one bone's world pose and proxy extents for presentation.
- 返回
- Owning snapshot, or StaleHandle/InvalidArgument without mutating state.
实现了 eve::physics::CollapseCaptureSource.
在文件 GeometryCollectionInstance.cpp 第 484 行定义.
引用了 body, bone, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, presentation, eve::StaleHandle, eve::physics::BonePresentation::state , 以及 eve::Result< T >::success().
被这些函数引用 eve::physics::GeometryCollectionRenderer::draw() , 以及 eve::physics::GeometryCollectionRenderer::prepareInstance().
◆ boneState()
| BoneRuntimeState eve::physics::GeometryCollectionInstance::boneState | ( | int | boneIndex | ) | const |
在文件 GeometryCollectionInstance.cpp 第 441 行定义.
引用了 state.
◆ captureSnapshot()
| eve::Result< GeometryCollectionInstanceSnapshot > eve::physics::GeometryCollectionInstance::captureSnapshot | ( | ) | const |
Capture a process-portable runtime snapshot (no PhysicsLink handles). @ownership Caller owns the returned snapshot value.
在文件 GeometryCollectionInstance.cpp 第 512 行定义.
引用了 eve::physics::GeometryCollectionInstanceSnapshot::EdgeSnapshot::accumulatedStrain, eve::physics::GeometryCollectionInstanceSnapshot::BoneSnapshot::anchored, bone, eve::physics::GeometryCollectionInstanceSnapshot::EdgeSnapshot::boneA, eve::physics::GeometryCollectionInstanceSnapshot::EdgeSnapshot::boneB, eve::physics::GeometryCollectionInstanceSnapshot::EdgeSnapshot::broken, eve::physics::GeometryCollectionInstanceSnapshot::BoneSnapshot::clusterId, edge, eve::Result< T >::failure(), eve::physics::GeometryCollectionInstanceSnapshot::BoneSnapshot::fractureLevel, eve::physics::GeometryCollectionInstanceSnapshot::BoneSnapshot::halfExtentX, eve::physics::GeometryCollectionInstanceSnapshot::BoneSnapshot::halfExtentY, eve::physics::GeometryCollectionInstanceSnapshot::BoneSnapshot::halfExtentZ, snapshot, eve::physics::GeometryCollectionInstanceSnapshot::BoneSnapshot::state, eve::physics::GeometryCollectionInstanceSnapshot::EdgeSnapshot::strainThreshold, eve::Result< T >::success() , 以及 valid.
◆ clusterBreakEventAt()
| ClusterBreakEvent eve::physics::GeometryCollectionInstance::clusterBreakEventAt | ( | int | index | ) | const |
◆ clusterBreakEventCount()
|
inlinenoexcept |
在文件 GeometryCollectionInstance.h 第 140 行定义.
◆ create()
|
static |
Create bodies for every bone and bind PhysicsLinks.
- 参数
-
world Borrowed World3D that must outlive successful physics writes. asset Immutable bone/edge definition (copied). originX Origin of the collection in world metres. originY Origin of the collection in world metres. originZ Origin of the collection in world metres.
- 返回
- Owning instance, or a structured failure without partial bodies. @ownership Caller owns the returned unique_ptr; Instance owns created bodies. @lifetime World must remain live for physics writes until releaseBodies or Instance destruction; world destruction first yields StaleHandle.
在文件 GeometryCollectionInstance.cpp 第 40 行定义.
◆ createFractured()
|
static |
Instantiate exact convex fragments from a cooked mesh/graph pair.
- 参数
-
geometry Owning immutable copy is retained, shared with captured clips.
- 返回
- Complete owning instance or failure after rolling back all created bodies. @cost Linear hull creation; instantiate once, then reuse for offline baking. @thread Owning physics thread; no callbacks. World is borrowed only during calls. @lifetime Uses the same generation-qualified world and destruction contract as create().
在文件 GeometryCollectionInstance.cpp 第 47 行定义.
引用了 b, eve::physics::GeometryCollectionAsset::bones, eve::Diagnostic::error(), f, geometry, eve::InvalidArgument, v, valid, x, y , 以及 z.
◆ detachEventAt()
| BoneDetachEvent eve::physics::GeometryCollectionInstance::detachEventAt | ( | int | index | ) | const |
在文件 GeometryCollectionInstance.cpp 第 461 行定义.
引用了 index.
◆ detachEventCount()
|
inlinenoexcept |
在文件 GeometryCollectionInstance.h 第 138 行定义.
◆ edgeCount()
|
inlinenoexcept |
在文件 GeometryCollectionInstance.h 第 132 行定义.
◆ edgeStrain()
| float eve::physics::GeometryCollectionInstance::edgeStrain | ( | int | edgeIndex | ) | const |
在文件 GeometryCollectionInstance.cpp 第 451 行定义.
◆ fragmentGeometry()
|
overridevirtualnoexcept |
Shared immutable geometry; empty for legacy box collections. @ownership Returned shared value keeps geometry alive independently of this instance. @thread Owner thread for acquisition; read-only sharing is safe after publication.
实现了 eve::physics::CollapseCaptureSource.
在文件 GeometryCollectionInstance.cpp 第 44 行定义.
被这些函数引用 eve::physics::GeometryCollectionRenderer::draw() , 以及 eve::physics::GeometryCollectionRenderer::prepareInstance().
◆ hasLiveWorld()
|
noexcept |
Whether the owning world handle still resolves.
在文件 GeometryCollectionInstance.cpp 第 163 行定义.
◆ isEdgeBroken()
| bool eve::physics::GeometryCollectionInstance::isEdgeBroken | ( | int | edgeIndex | ) | const |
Whether the edge at index has already broken.
在文件 GeometryCollectionInstance.cpp 第 456 行定义.
◆ operator=()
|
delete |
◆ pendingEdgeBreakCount()
|
inlinenoexcept |
Edges still waiting because of the break budget.
在文件 GeometryCollectionInstance.h 第 146 行定义.
◆ releaseBodies()
| void eve::physics::GeometryCollectionInstance::releaseBodies | ( | ) |
Destroy owned bodies if the world is still live; always clears links.
在文件 GeometryCollectionInstance.cpp 第 640 行定义.
引用了 bone.
◆ restoreSnapshot()
| eve::Result< void > eve::physics::GeometryCollectionInstance::restoreSnapshot | ( | const GeometryCollectionInstanceSnapshot & | snapshot | ) |
Restore bone/edge state from a snapshot against the live world.
- 返回
- Success, or InvalidArgument/StaleHandle without partial mutation.
在文件 GeometryCollectionInstance.cpp 第 546 行定义.
引用了 body, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::physics::Body3D::setType(), snapshot, eve::StaleHandle, state, eve::Result< T >::success() , 以及 valid.
◆ setStepBudget()
|
inlinenoexcept |
Replace the per-step break/sleep budgets (0 = unlimited).
在文件 GeometryCollectionInstance.h 第 115 行定义.
◆ sleepBatchRevision()
|
inlinenoexcept |
Monotonic revision bumped when any bone enters Sleeping (for batch rebuild).
在文件 GeometryCollectionInstance.h 第 159 行定义.
◆ step()
| eve::Result< DestructionStepReceipt > eve::physics::GeometryCollectionInstance::step | ( | SimulationStep | step | ) |
Advance connection-graph breaks under the configured budget.
- 参数
-
step Injected simulation tick/delta; wall clock is never read.
- 返回
- Receipt with broken/deferred edge counts, or a structured failure that leaves topology unchanged.
在文件 GeometryCollectionInstance.cpp 第 393 行定义.
引用了 edge, eve::physics::DestructionStepReceipt::edgesBroken, eve::physics::DestructionStepReceipt::edgesDeferred, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::StaleHandle, step, eve::Result< T >::success() , 以及 tick.
◆ stepBudget()
|
inlinenoexcept |
Return the active per-step budgets.
在文件 GeometryCollectionInstance.h 第 117 行定义.
该类的文档由以下文件生成:
- src/modules/physics/destruction/GeometryCollectionInstance.h
- src/modules/physics/destruction/GeometryCollectionConstraints.cpp
- src/modules/physics/destruction/GeometryCollectionInstance.cpp
Public 成员函数 继承自