Real physics-module provider for generated collider publication. 更多...
#include <ArtifactProvider.h>
类 | |
| struct | State |
| Owning runtime state for one published collider. 更多... | |
Public 成员函数 | |
| PhysicsArtifactProvider () | |
| Construct an empty provider; all methods use the owner thread. | |
| ~PhysicsArtifactProvider () override | |
| Release all staged/committed Box3D resources. | |
| eve::Result< std::unique_ptr< eve::artifact::PreparedPublication > > | prepare (const eve::artifact::PublicationView &publication) override |
| Stage and copy a collider leaf from a generated publication. | |
| eve::Result< eve::Value > | snapshotState () const override |
| Export collider identity, build keys, handles and CPU geometry. | |
| eve::Result< void > | restoreState (const eve::Value &state) override |
| Replace colliders from validated backend-neutral CPU geometry. | |
| bool | emptyState () const noexcept override |
| Return whether the physics registry has no committed colliders. | |
| void | clearState () noexcept override |
| Clear provider state through the common restore-cleanup hook. | |
| const PhysicsArtifactCollider * | find (eve::PersistentId id) const noexcept |
| Find a committed collider by persistent identity. | |
| const PhysicsArtifactCollider * | find (PhysicsArtifactHandle handle) const noexcept |
| Resolve a live artifact handle. | |
| bool | isHandleLive (PhysicsArtifactHandle handle) const noexcept |
| Return whether a generation-qualified artifact handle is live. | |
| PhysicsArtifactRayHit | rayCast (eve::PersistentId id, float ox, float oy, float oz, float dx, float dy, float dz) const noexcept |
| Ray query one collider through its live Box3D world. | |
| std::size_t | size () const noexcept |
| Return the number of committed physics colliders. | |
| std::string | backendName (eve::PersistentId id) const |
| Return the backend family for a committed collider, or empty. | |
| bool | isBox3DBacked (eve::PersistentId id) const noexcept |
| Return whether a collider currently owns a valid Box3D shape. | |
| eve::Result< void > | bindWorld (World3D &world) |
| Bind future collider publications to a caller-owned shared world. | |
| eve::Result< void > | unbindWorld (PhysicsWorldHandle world) |
| Remove an empty provider's matching shared-world binding. | |
| PhysicsWorldHandle | boundWorld () const noexcept |
| Return the live shared-world binding, or invalid for compatibility-private mode/stale binding. | |
| bool | isSharedWorldBacked (eve::PersistentId id) const noexcept |
| Return whether the collider resolves to the currently live shared world binding. | |
| void | clear () noexcept |
| Remove all colliders while retiring their runtime handle slots; the world binding is retained. | |
| void | setPrepareFailure (bool enabled) noexcept |
| Inject a prepare failure for composition tests. | |
Public 成员函数 继承自 eve::artifact::IPhysicsArtifactAdapter | |
| ~IPhysicsArtifactAdapter () override=default | |
| Releases IPhysicsArtifactAdapter resources. | |
Public 成员函数 继承自 eve::artifact::ProviderContract | |
| virtual | ~ProviderContract ()=default |
| Provider contract. | |
友元 | |
| class | PhysicsArtifactStage |
额外继承的成员函数 | |
静态 Public 属性 继承自 eve::artifact::IPhysicsArtifactAdapter | |
| static constexpr const char * | capabilityName = "eve.procgen.IPhysicsArtifactAdapter" |
详细描述
Real physics-module provider for generated collider publication.
It owns the backend-neutral descriptor plus a real static Box3D body and triangle-mesh shape for every committed collider. By default each collider keeps its historical private compatibility world; bindWorld() instead puts future colliders in one caller-owned simulation authority. Procgen never includes Box3D; the backend remains an implementation detail of this module.
在文件 ArtifactProvider.h 第 67 行定义.
构造及析构函数说明
◆ PhysicsArtifactProvider()
| eve::physics::PhysicsArtifactProvider::PhysicsArtifactProvider | ( | ) |
Construct an empty provider; all methods use the owner thread.
在文件 ArtifactProvider.cpp 第 231 行定义.
◆ ~PhysicsArtifactProvider()
|
override |
成员函数说明
◆ backendName()
| std::string eve::physics::PhysicsArtifactProvider::backendName | ( | eve::PersistentId | id | ) | const |
Return the backend family for a committed collider, or empty.
在文件 ArtifactProvider.cpp 第 418 行定义.
引用了 find().
◆ bindWorld()
| eve::Result< void > eve::physics::PhysicsArtifactProvider::bindWorld | ( | World3D & | world | ) |
Bind future collider publications to a caller-owned shared world.
- 参数
-
world Live world borrowed until unbindWorld() or provider destruction.
- 返回
- Applied, NoOp for the same target, or Conflict while state/stages exist. @ownership The caller retains the world; the provider owns and removes only the bodies and shapes it prepares. @lifetime The caller must keep the world alive through every staged transaction. World destruction after commit makes published runtime colliders stale; clear() safely releases their invalidated wrappers.
- 注解
- prepare() reserves a disabled body in this world. It cannot participate in simulation or queries before commit(); rollback() removes it. Diagnostic body counts may include this disabled reservation while staged. @thread Owner-thread only; publication and world stepping must not run concurrently. @reentrancy Invokes no callbacks.
在文件 ArtifactProvider.cpp 第 433 行定义.
引用了 eve::Applied, eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::RuntimeHandle< Tag >::isValid(), eve::NoOp, eve::Status::success(), eve::Result< T >::success() , 以及 world.
被这些函数引用 eve::scene_physics::ScenePhysics::bindGeneratedColliders().
◆ boundWorld()
|
noexcept |
Return the live shared-world binding, or invalid for compatibility-private mode/stale binding.
在文件 ArtifactProvider.cpp 第 473 行定义.
引用了 eve::RuntimeHandle< PhysicsWorldHandleTag >::invalid(), eve::physics::World3D::isValid() , 以及 eve::physics::World3D::runtimeHandle().
被这些函数引用 eve::scene_physics::ScenePhysics::boundWorld(), restoreState() , 以及 eve::scene_physics::ScenePhysics::unbindGeneratedColliders().
◆ clear()
|
noexcept |
Remove all colliders while retiring their runtime handle slots; the world binding is retained.
在文件 ArtifactProvider.cpp 第 488 行定义.
被这些函数引用 ~PhysicsArtifactProvider().
◆ clearState()
|
inlineoverridevirtualnoexcept |
Clear provider state through the common restore-cleanup hook.
重载 eve::artifact::ProviderContract .
在文件 ArtifactProvider.h 第 84 行定义.
◆ emptyState()
|
overridevirtualnoexcept |
Return whether the physics registry has no committed colliders.
重载 eve::artifact::ProviderContract .
在文件 ArtifactProvider.cpp 第 486 行定义.
◆ find() [1/2]
|
noexcept |
Find a committed collider by persistent identity.
- 返回
- Borrowed nullable collider owned by this provider. @ownership PhysicsArtifactProvider owns committed collider records; callers must not delete or mutate the result. @lifetime Valid until clear(), restoreState(), or provider destruction; retain PhysicsArtifactHandle across frames. @thread Call on the physics provider's owning thread. @reentrancy The lookup invokes no callbacks and is invalid across provider mutation.
在文件 ArtifactProvider.cpp 第 356 行定义.
引用了 found.
被这些函数引用 backendName() , 以及 prepare().
◆ find() [2/2]
|
noexcept |
Resolve a live artifact handle.
- 返回
- Borrowed nullable collider owned by this provider; null denotes a stale or foreign handle. @ownership PhysicsArtifactProvider owns the collider; callers must not delete or mutate the result. @lifetime Valid until provider mutation or destruction; use the handle for later resolution. @thread Call on the physics provider's owning thread. @reentrancy The lookup invokes no callbacks and is invalid across provider mutation.
在文件 ArtifactProvider.cpp 第 362 行定义.
◆ isBox3DBacked()
|
noexcept |
Return whether a collider currently owns a valid Box3D shape.
在文件 ArtifactProvider.cpp 第 423 行定义.
引用了 found.
◆ isHandleLive()
|
noexcept |
Return whether a generation-qualified artifact handle is live.
在文件 ArtifactProvider.cpp 第 369 行定义.
◆ isSharedWorldBacked()
|
noexcept |
Return whether the collider resolves to the currently live shared world binding.
在文件 ArtifactProvider.cpp 第 480 行定义.
◆ prepare()
|
overridevirtual |
Stage and copy a collider leaf from a generated publication.
实现了 eve::artifact::ProviderContract.
在文件 ArtifactProvider.cpp 第 238 行定义.
引用了 eve::physics::PhysicsArtifactCollider::backend, body, eve::artifact::PartView::bounds, eve::physics::PhysicsArtifactCollider::bounds, eve::artifact::PublicationView::buildKey, eve::physics::PhysicsArtifactCollider::buildKey, eve::artifact::Collider, eve::Conflict, error, eve::Failed, find(), eve::physics::PhysicsArtifactCollider::handle, eve::artifact::PublicationView::id, eve::physics::PhysicsArtifactCollider::id, eve::artifact::PartView::indices, eve::physics::PhysicsArtifactCollider::indices, eve::InvalidArgument, eve::RuntimeHandle< PhysicsArtifactHandleTag >::invalidIndex, eve::detail::Id128< Tag >::isNil(), eve::physics::World3D::isValid(), eve::RuntimeHandle< Tag >::isValid(), mesh, eve::physics::World3D::newBody(), eve::artifact::PublicationView::parts, eve::artifact::PartView::positions, eve::PreconditionViolation, eve::physics::World3D::runtimeHandle(), eve::artifact::PartView::schemaVersion, eve::artifact::PublicationView::schemaVersion, shape, eve::physics::PhysicsArtifactCollider::shape, eve::UnknownVersion, eve::physics::PhysicsArtifactCollider::vertices, eve::physics::PhysicsArtifactCollider::world , 以及 world.
◆ rayCast()
|
noexcept |
Ray query one collider through its live Box3D world.
在文件 ArtifactProvider.cpp 第 379 行定义.
引用了 dx, dy, dz, found, eve::physics::PhysicsArtifactRayHit::fraction, eve::physics::PhysicsArtifactRayHit::hit, eve::physics::PhysicsArtifactRayHit::normalX, eve::physics::PhysicsArtifactRayHit::normalY, eve::physics::PhysicsArtifactRayHit::normalZ, ox, oy, eve::physics::PhysicsArtifactRayHit::x, eve::physics::PhysicsArtifactRayHit::y , 以及 eve::physics::PhysicsArtifactRayHit::z.
◆ restoreState()
|
overridevirtual |
Replace colliders from validated backend-neutral CPU geometry.
重载 eve::artifact::ProviderContract .
在文件 ArtifactProvider.cpp 第 525 行定义.
引用了 eve::Applied, eve::physics::PhysicsArtifactCollider::backend, body, eve::physics::PhysicsArtifactCollider::bounds, boundWorld(), eve::physics::PhysicsArtifactCollider::buildKey, eve::Conflict, error, eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::RuntimeHandle< PhysicsArtifactHandleTag >::fromPacked(), eve::Value::getIf(), eve::physics::PhysicsArtifactCollider::handle, eve::physics::PhysicsArtifactCollider::id, eve::physics::PhysicsArtifactCollider::indices, eve::RuntimeHandle< PhysicsArtifactHandleTag >::invalidIndex, member, mesh, eve::detail::Id128< Tag >::parse(), eve::ParseError, shape, eve::physics::PhysicsArtifactCollider::shape, state, eve::Status::success(), eve::Result< T >::success(), eve::Unsupported, eve::physics::PhysicsArtifactCollider::vertices, eve::physics::PhysicsArtifactCollider::world , 以及 world.
◆ setPrepareFailure()
|
inlinenoexcept |
◆ size()
|
noexcept |
Return the number of committed physics colliders.
在文件 ArtifactProvider.cpp 第 416 行定义.
◆ snapshotState()
|
overridevirtual |
Export collider identity, build keys, handles and CPU geometry.
重载 eve::artifact::ProviderContract .
在文件 ArtifactProvider.cpp 第 495 行定义.
引用了 eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), state , 以及 eve::Result< T >::success().
◆ unbindWorld()
| eve::Result< void > eve::physics::PhysicsArtifactProvider::unbindWorld | ( | PhysicsWorldHandle | world | ) |
Remove an empty provider's matching shared-world binding.
- 参数
-
world Expected generation-qualified world identity.
- 返回
- Applied, NotFound for a different/stale binding, or Conflict while publications exist.
在文件 ArtifactProvider.cpp 第 456 行定义.
引用了 eve::Applied, eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::RuntimeHandle< PhysicsWorldHandleTag >::invalid(), eve::NotFound, eve::Status::success(), eve::Result< T >::success() , 以及 world.
被这些函数引用 eve::scene_physics::ScenePhysics::unbindGeneratedColliders().
友元及相关函数文档
◆ PhysicsArtifactStage
|
friend |
在文件 ArtifactProvider.h 第 146 行定义.
该类的文档由以下文件生成:
- src/modules/physics/ArtifactProvider.h
- src/modules/physics/ArtifactProvider.cpp
Public 成员函数 继承自