载入中...
搜索中...
未找到
eve::physics::PhysicsArtifactProvider类 参考final

Real physics-module provider for generated collider publication. 更多...

#include <ArtifactProvider.h>

类 eve::physics::PhysicsArtifactProvider 继承关系图:
eve::artifact::IPhysicsArtifactAdapter eve::artifact::ProviderContract

类

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()

eve::physics::PhysicsArtifactProvider::~PhysicsArtifactProvider ( )
override

Release all staged/committed Box3D resources.

在文件 ArtifactProvider.cpp 第 233 行定义.

引用了 clear().

成员函数说明

◆ 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.

参数
worldLive 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()

PhysicsWorldHandle eve::physics::PhysicsArtifactProvider::boundWorld ( ) const
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()

void eve::physics::PhysicsArtifactProvider::clear ( )
noexcept

Remove all colliders while retiring their runtime handle slots; the world binding is retained.

在文件 ArtifactProvider.cpp 第 488 行定义.

被这些函数引用 ~PhysicsArtifactProvider().

◆ clearState()

void eve::physics::PhysicsArtifactProvider::clearState ( )
inlineoverridevirtualnoexcept

Clear provider state through the common restore-cleanup hook.

重载 eve::artifact::ProviderContract .

在文件 ArtifactProvider.h 第 84 行定义.

◆ emptyState()

bool eve::physics::PhysicsArtifactProvider::emptyState ( ) const
overridevirtualnoexcept

Return whether the physics registry has no committed colliders.

重载 eve::artifact::ProviderContract .

在文件 ArtifactProvider.cpp 第 486 行定义.

◆ find() [1/2]

const PhysicsArtifactCollider * eve::physics::PhysicsArtifactProvider::find ( eve::PersistentId  id) const
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]

const PhysicsArtifactCollider * eve::physics::PhysicsArtifactProvider::find ( PhysicsArtifactHandle  handle) const
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 行定义.

引用了 found , 以及 handle.

◆ isBox3DBacked()

bool eve::physics::PhysicsArtifactProvider::isBox3DBacked ( eve::PersistentId  id) const
noexcept

Return whether a collider currently owns a valid Box3D shape.

在文件 ArtifactProvider.cpp 第 423 行定义.

引用了 found.

◆ isHandleLive()

bool eve::physics::PhysicsArtifactProvider::isHandleLive ( PhysicsArtifactHandle  handle) const
noexcept

Return whether a generation-qualified artifact handle is live.

在文件 ArtifactProvider.cpp 第 369 行定义.

引用了 found , 以及 handle.

◆ isSharedWorldBacked()

bool eve::physics::PhysicsArtifactProvider::isSharedWorldBacked ( eve::PersistentId  id) const
noexcept

Return whether the collider resolves to the currently live shared world binding.

在文件 ArtifactProvider.cpp 第 480 行定义.

◆ prepare()

◆ rayCast()

PhysicsArtifactRayHit eve::physics::PhysicsArtifactProvider::rayCast ( eve::PersistentId  id,
float  ox,
float  oy,
float  oz,
float  dx,
float  dy,
float  dz 
) const
noexcept

◆ restoreState()

◆ setPrepareFailure()

void eve::physics::PhysicsArtifactProvider::setPrepareFailure ( bool  enabled)
inlinenoexcept

Inject a prepare failure for composition tests.

在文件 ArtifactProvider.h 第 142 行定义.

引用了 enabled.

◆ size()

std::size_t eve::physics::PhysicsArtifactProvider::size ( ) const
noexcept

Return the number of committed physics colliders.

在文件 ArtifactProvider.cpp 第 416 行定义.

◆ snapshotState()

eve::Result< eve::Value > eve::physics::PhysicsArtifactProvider::snapshotState ( ) const
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.

参数
worldExpected 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 class PhysicsArtifactStage
friend

在文件 ArtifactProvider.h 第 146 行定义.


该类的文档由以下文件生成: