Runtime owner of bone state, connection strain, and PhysicsLink bindings. 更多...
#include <GeometryCollectionInstance.h>
Public 成员函数 | |
| GeometryCollectionInstance (const GeometryCollectionInstance &)=delete | |
| GeometryCollectionInstance & | operator= (const GeometryCollectionInstance &)=delete |
| ~GeometryCollectionInstance () | |
| Geometry collection instance. | |
| 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 |
| 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 |
| 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 成员函数 | |
| 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. | |
详细描述
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 第 96 行定义.
构造及析构函数说明
◆ GeometryCollectionInstance()
|
delete |
◆ ~GeometryCollectionInstance()
| eve::physics::GeometryCollectionInstance::~GeometryCollectionInstance | ( | ) |
Geometry collection instance.
在文件 GeometryCollectionInstance.cpp 第 36 行定义.
成员函数说明
◆ applyField()
| eve::Result< FieldApplicationReceipt > eve::physics::GeometryCollectionInstance::applyField | ( | const DestructionField & | field | ) |
Apply one destruction field; failure leaves instance unchanged.
在文件 GeometryCollectionInstance.cpp 第 136 行定义.
引用了 body, eve::physics::FieldApplicationReceipt::bonesAffected, dx, dy, dz, edge, eve::physics::FieldApplicationReceipt::edgesAffected, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::physics::FieldApplicationReceipt::sleepsDeferred, eve::StaleHandle, state, eve::Result< T >::success(), vx, vy, vz, weight , 以及 world.
◆ boneClusterId()
| int eve::physics::GeometryCollectionInstance::boneClusterId | ( | int | boneIndex | ) | const |
在文件 GeometryCollectionInstance.cpp 第 386 行定义.
引用了 clusterId.
◆ boneCount()
|
inlinenoexcept |
在文件 GeometryCollectionInstance.h 第 141 行定义.
◆ boneLink()
| eve::Result< PhysicsLink > eve::physics::GeometryCollectionInstance::boneLink | ( | int | boneIndex | ) | const |
Resolve the PhysicsLink for one bone against the live world.
在文件 GeometryCollectionInstance.cpp 第 411 行定义.
引用了 body, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::StaleHandle, eve::Result< T >::success() , 以及 world.
◆ bonePresentation()
| eve::Result< BonePresentation > eve::physics::GeometryCollectionInstance::bonePresentation | ( | int | boneIndex | ) | const |
Sample one bone's world pose and proxy extents for presentation.
- 返回
- Owning snapshot, or StaleHandle/InvalidArgument without mutating state.
在文件 GeometryCollectionInstance.cpp 第 424 行定义.
引用了 body, bone, eve::physics::BonePresentation::clusterId, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::physics::BonePresentation::fractureLevel, eve::physics::BonePresentation::halfExtentX, eve::physics::BonePresentation::halfExtentY, eve::physics::BonePresentation::halfExtentZ, eve::InvalidArgument, eve::physics::BonePresentation::rotW, eve::physics::BonePresentation::rotX, eve::physics::BonePresentation::rotY, eve::physics::BonePresentation::rotZ, eve::StaleHandle, eve::physics::BonePresentation::state, eve::Result< T >::success(), world, eve::physics::BonePresentation::worldX, eve::physics::BonePresentation::worldY , 以及 eve::physics::BonePresentation::worldZ.
◆ boneState()
| BoneRuntimeState eve::physics::GeometryCollectionInstance::boneState | ( | int | boneIndex | ) | const |
在文件 GeometryCollectionInstance.cpp 第 381 行定义.
引用了 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 第 452 行定义.
引用了 eve::physics::GeometryCollectionInstanceSnapshot::EdgeSnapshot::accumulatedStrain, eve::physics::GeometryCollectionInstanceSnapshot::BoneSnapshot::anchored, bone, eve::physics::GeometryCollectionInstanceSnapshot::EdgeSnapshot::boneA, eve::physics::GeometryCollectionInstanceSnapshot::EdgeSnapshot::boneB, eve::physics::GeometryCollectionInstanceSnapshot::bones, eve::physics::GeometryCollectionInstanceSnapshot::EdgeSnapshot::broken, eve::physics::GeometryCollectionInstanceSnapshot::BoneSnapshot::clusterId, edge, eve::physics::GeometryCollectionInstanceSnapshot::edges, eve::Result< T >::failure(), eve::physics::GeometryCollectionInstanceSnapshot::BoneSnapshot::fractureLevel, eve::physics::GeometryCollectionInstanceSnapshot::BoneSnapshot::halfExtentX, eve::physics::GeometryCollectionInstanceSnapshot::BoneSnapshot::halfExtentY, eve::physics::GeometryCollectionInstanceSnapshot::BoneSnapshot::halfExtentZ, eve::physics::GeometryCollectionInstanceSnapshot::lastTick, eve::physics::GeometryCollectionInstanceSnapshot::originX, eve::physics::GeometryCollectionInstanceSnapshot::originY, eve::physics::GeometryCollectionInstanceSnapshot::originZ, eve::physics::GeometryCollectionInstanceSnapshot::sleepBatchRevision, eve::physics::GeometryCollectionInstanceSnapshot::BoneSnapshot::state, eve::physics::GeometryCollectionInstanceSnapshot::EdgeSnapshot::strainThreshold, eve::Result< T >::success(), valid , 以及 eve::physics::GeometryCollectionInstanceSnapshot::validate().
◆ clusterBreakEventAt()
| ClusterBreakEvent eve::physics::GeometryCollectionInstance::clusterBreakEventAt | ( | int | index | ) | const |
◆ clusterBreakEventCount()
|
inlinenoexcept |
在文件 GeometryCollectionInstance.h 第 150 行定义.
◆ 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 第 38 行定义.
引用了 body, bone, eve::physics::GeometryCollectionAsset::bones, edge, eve::physics::GeometryCollectionAsset::edges, eve::Diagnostic::error(), eve::Failed, eve::StaleHandle, valid, eve::physics::GeometryCollectionAsset::validate(), world, x, y , 以及 z.
◆ detachEventAt()
| BoneDetachEvent eve::physics::GeometryCollectionInstance::detachEventAt | ( | int | index | ) | const |
在文件 GeometryCollectionInstance.cpp 第 401 行定义.
引用了 index.
◆ detachEventCount()
|
inlinenoexcept |
在文件 GeometryCollectionInstance.h 第 148 行定义.
◆ edgeCount()
|
inlinenoexcept |
在文件 GeometryCollectionInstance.h 第 142 行定义.
◆ edgeStrain()
| float eve::physics::GeometryCollectionInstance::edgeStrain | ( | int | edgeIndex | ) | const |
在文件 GeometryCollectionInstance.cpp 第 391 行定义.
◆ hasLiveWorld()
|
noexcept |
Whether the owning world handle still resolves.
在文件 GeometryCollectionInstance.cpp 第 106 行定义.
◆ isEdgeBroken()
| bool eve::physics::GeometryCollectionInstance::isEdgeBroken | ( | int | edgeIndex | ) | const |
Whether the edge at index has already broken.
在文件 GeometryCollectionInstance.cpp 第 396 行定义.
◆ operator=()
|
delete |
◆ pendingEdgeBreakCount()
|
inlinenoexcept |
Edges still waiting because of the break budget.
在文件 GeometryCollectionInstance.h 第 156 行定义.
◆ releaseBodies()
| void eve::physics::GeometryCollectionInstance::releaseBodies | ( | ) |
Destroy owned bodies if the world is still live; always clears links.
在文件 GeometryCollectionInstance.cpp 第 566 行定义.
◆ 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 第 486 行定义.
引用了 body, eve::physics::GeometryCollectionInstanceSnapshot::bones, eve::physics::GeometryCollectionInstanceSnapshot::edges, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::physics::GeometryCollectionInstanceSnapshot::lastTick, eve::physics::GeometryCollectionInstanceSnapshot::originX, eve::physics::GeometryCollectionInstanceSnapshot::originY, eve::physics::GeometryCollectionInstanceSnapshot::originZ, eve::physics::Body3D::setType(), eve::physics::GeometryCollectionInstanceSnapshot::sleepBatchRevision, eve::StaleHandle, state, eve::Result< T >::success(), valid, eve::physics::GeometryCollectionInstanceSnapshot::validate() , 以及 world.
◆ setStepBudget()
|
inlinenoexcept |
Replace the per-step break/sleep budgets (0 = unlimited).
在文件 GeometryCollectionInstance.h 第 125 行定义.
◆ sleepBatchRevision()
|
inlinenoexcept |
Monotonic revision bumped when any bone enters Sleeping (for batch rebuild).
在文件 GeometryCollectionInstance.h 第 169 行定义.
◆ 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 第 333 行定义.
引用了 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 , 以及 world.
◆ stepBudget()
|
inlinenoexcept |
Return the active per-step budgets.
在文件 GeometryCollectionInstance.h 第 127 行定义.
该类的文档由以下文件生成:
- src/modules/physics/destruction/GeometryCollectionInstance.h
- src/modules/physics/destruction/GeometryCollectionInstance.cpp