vault backup: 2025-06-25 23:40:45
This commit is contained in:
@@ -154,6 +154,63 @@ void AShaderWorldActor::ReadbacksManagement()
|
||||
```
|
||||
|
||||
### CollisionManagement()
|
||||
```c++
|
||||
void AShaderWorldActor::CollisionManagement(float& DeltaT)
|
||||
{
|
||||
SCOPED_NAMED_EVENT_TEXT("AShaderWorldActor::CollisionManagement", FColor::Magenta);
|
||||
SW_FCT_CYCLE()
|
||||
|
||||
/*
|
||||
* Can we execute compute shader?
|
||||
* Do we need to rebuild collision?
|
||||
* Did ShaderWorld toggled collision generation On/Off?
|
||||
* Are we pending a full rebuild of the Shader World?
|
||||
*/
|
||||
if (!SetupCollisions())
|
||||
return;
|
||||
|
||||
/*
|
||||
* Using collision updates, update Collision meshes
|
||||
*/
|
||||
if (!CollisionFinalizeWork())
|
||||
return;
|
||||
|
||||
if (CollisionProcess.IsFenceComplete())
|
||||
{
|
||||
/*
|
||||
* Convert Compute shader results to actionable collision updates
|
||||
*/
|
||||
if (!CollisionPreprocessGPU())
|
||||
{
|
||||
CollisionProcess.BeginFence(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Process GPU work queue by launching GPU tasks to evaluate the collision of new tiles
|
||||
*/
|
||||
CollisionGPU();
|
||||
|
||||
// Timer
|
||||
{
|
||||
CollisionUpdateTimeAcu += DeltaT;
|
||||
|
||||
if (CollisionUpdateTimeAcu <= 1.f / 10.f || CollisionWorkQueue.Num() > 0 || !CollisionProcess.IsFenceComplete())
|
||||
return;
|
||||
|
||||
CollisionUpdateTimeAcu = 0.f;
|
||||
}
|
||||
|
||||
/*
|
||||
* Gather relevant collision tiles
|
||||
* If an old tile is not relevant anymore, release it.
|
||||
* If a new location needs to be computed: allocate a tile and add its relevant computation work to the GPU work queue
|
||||
*/
|
||||
CollisionCPU();
|
||||
}
|
||||
```
|
||||
#### SetupCollisions()
|
||||
|
||||
### SpawnablesManagement()
|
||||
|
||||
|
Reference in New Issue
Block a user