Incremental static collision projection of authoritative PixelWorld chunks. 更多...
#include <PixelWorldPhysics.h>
类 | |
| struct | Impl |
Public 成员函数 | |
| PixelTerrainCollisionCache () | |
| Pixel terrain collision cache. | |
| ~PixelTerrainCollisionCache () | |
| Pixel terrain collision cache. | |
| PixelTerrainCollisionCache (PixelTerrainCollisionCache &&) noexcept | |
| Pixel terrain collision cache. | |
| PixelTerrainCollisionCache & | operator= (PixelTerrainCollisionCache &&) noexcept |
| Operator =. | |
| PixelTerrainCollisionCache (const PixelTerrainCollisionCache &)=delete | |
| PixelTerrainCollisionCache & | operator= (const PixelTerrainCollisionCache &)=delete |
| eve::Result< TerrainCollisionSyncReceipt > | sync (eve::physics::World &physicsWorld, const eve::pixelworld::PixelWorld &pixelWorld, std::uint32_t maximumFixturesPerChunk=256) |
| Rebuild only chunks newer than the cached source revision. | |
| eve::Result< void > | clearPhysics (eve::physics::World &physicsWorld) |
| Explicitly destroy every resolvable projected body and reset revision tracking. | |
| std::uint64_t | sourceRevision () const noexcept |
| Last authoritative revision fully represented by this cache. | |
| std::size_t | bodyCount () const noexcept |
| Number of chunks currently owning a non-empty static collision body. | |
详细描述
Incremental static collision projection of authoritative PixelWorld chunks.
The cache owns only process-local PhysicsLinks and revision metadata. Physics World owns all bodies/fixtures and PixelWorld owns all material cells. Sync is owner-thread affine, invokes no callbacks, and stages every replacement body before committing.
在文件 PixelWorldPhysics.h 第 173 行定义.
构造及析构函数说明
◆ PixelTerrainCollisionCache() [1/3]
| eve::pixelworld_physics::PixelTerrainCollisionCache::PixelTerrainCollisionCache | ( | ) |
Pixel terrain collision cache.
在文件 PixelWorldPhysics.cpp 第 498 行定义.
◆ ~PixelTerrainCollisionCache()
|
default |
Pixel terrain collision cache.
◆ PixelTerrainCollisionCache() [2/3]
|
defaultnoexcept |
Pixel terrain collision cache.
◆ PixelTerrainCollisionCache() [3/3]
|
delete |
成员函数说明
◆ bodyCount()
|
noexcept |
Number of chunks currently owning a non-empty static collision body.
在文件 PixelWorldPhysics.cpp 第 638 行定义.
◆ clearPhysics()
| eve::Result< void > eve::pixelworld_physics::PixelTerrainCollisionCache::clearPhysics | ( | eve::physics::World & | physicsWorld | ) |
Explicitly destroy every resolvable projected body and reset revision tracking.
在文件 PixelWorldPhysics.cpp 第 619 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::RuntimeHandle< PhysicsWorldHandleTag >::invalid(), eve::physics::World::runtimeHandle(), eve::StaleHandle , 以及 eve::Result< T >::success().
◆ operator=() [1/2]
|
delete |
◆ operator=() [2/2]
|
defaultnoexcept |
Operator =.
◆ sourceRevision()
|
noexcept |
Last authoritative revision fully represented by this cache.
在文件 PixelWorldPhysics.cpp 第 637 行定义.
◆ sync()
| eve::Result< TerrainCollisionSyncReceipt > eve::pixelworld_physics::PixelTerrainCollisionCache::sync | ( | eve::physics::World & | physicsWorld, |
| const eve::pixelworld::PixelWorld & | pixelWorld, | ||
| std::uint32_t | maximumFixturesPerChunk = 256 |
||
| ) |
Rebuild only chunks newer than the cached source revision.
- 参数
-
physicsWorld Borrowed owner of static bodies. pixelWorld Borrowed authoritative material world. maximumFixturesPerChunk Positive deterministic complexity budget.
- 返回
- Applied counters; failure destroys staged candidates and preserves prior cache entries.
- 备注
- A live physics-world binding must be cleared explicitly before rebinding. If the old world has already expired, synchronization may safely discard its stale links and bind the replacement world.
在文件 PixelWorldPhysics.cpp 第 503 行定义.
引用了 eve::pixelworld_physics::TerrainCollisionSyncReceipt::bodiesRemoved, body, eve::pixelworld_physics::TerrainCollisionSyncReceipt::chunksRebuilt, eve::Conflict, dx, dy, error, eve::Diagnostic::error(), eve::pixelworld_physics::extractTerrainContours(), eve::Failed, eve::Result< T >::failure(), fixtures, eve::pixelworld_physics::TerrainCollisionSyncReceipt::fixturesCreated, eve::physics::PhysicsLink::fromBody(), eve::InvalidArgument, eve::pixelworld::kPixelChunkSize, eve::physics::Body::newChainFixture(), eve::PreconditionViolation, eve::pixelworld_physics::TerrainCollisionSyncReceipt::sourceRevision , 以及 eve::Result< T >::success().
该类的文档由以下文件生成:
- src/modules/pixelworld/physics/PixelWorldPhysics.h
- src/modules/pixelworld/physics/PixelWorldPhysics.cpp