Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
c9b2983224
@ -1,3 +1,3 @@
|
||||
{
|
||||
"CurrentProjectSetting": null
|
||||
"CurrentProjectSetting": "无配置"
|
||||
}
|
BIN
.vs/slnx.sqlite
BIN
.vs/slnx.sqlite
Binary file not shown.
1
02-Note/WY/项目相关.md
Normal file
1
02-Note/WY/项目相关.md
Normal file
@ -0,0 +1 @@
|
||||
# 前言
|
@ -156,6 +156,22 @@ void AShaderWorldActor::ReadbacksManagement()
|
||||
```
|
||||
|
||||
### CollisionManagement()
|
||||
- ThreadSafe
|
||||
- bool
|
||||
- bProcessingGroundCollision
|
||||
- bPreprocessingCollisionUpdate
|
||||
- EditRebuild:传递Bool值给 rebuild。
|
||||
- FSWCollisionManagementShareableData
|
||||
- CollisionShareable
|
||||
- FRenderCommandFence
|
||||
- 1
|
||||
- bool
|
||||
- RedbuildCollisionContext
|
||||
- Array
|
||||
- CollisionWorkQueue:类型为FCollisionProcessingWork。
|
||||
- CollisionReadToProcess
|
||||
|
||||
|
||||
```c++
|
||||
void AShaderWorldActor::CollisionManagement(float& DeltaT)
|
||||
{
|
||||
@ -212,7 +228,87 @@ void AShaderWorldActor::CollisionManagement(float& DeltaT)
|
||||
CollisionCPU();
|
||||
}
|
||||
```
|
||||
|
||||
#### SetupCollisions()
|
||||
```c++
|
||||
bool AShaderWorldActor::SetupCollisions()
|
||||
{
|
||||
SW_FCT_CYCLE()
|
||||
|
||||
if (!bHadGeneratorAtRebuildTime)
|
||||
return false;
|
||||
|
||||
if (!Shareable_ID.IsValid() || Meshes.Num() <= 0)
|
||||
return false;
|
||||
|
||||
//初始化线程安全变量
|
||||
if (!bProcessingGroundCollision.IsValid())
|
||||
bProcessingGroundCollision = MakeShared<FThreadSafeBool, ESPMode::ThreadSafe>();
|
||||
if (!bPreprocessingCollisionUpdate.IsValid())
|
||||
bPreprocessingCollisionUpdate = MakeShared<FThreadSafeBool, ESPMode::ThreadSafe>();
|
||||
|
||||
if (EditRebuild)
|
||||
{
|
||||
EditRebuild.AtomicSet(false);
|
||||
rebuild = true;
|
||||
}
|
||||
|
||||
if (rebuild)
|
||||
RedbuildCollisionContext = true;
|
||||
//重建相关变量初始化
|
||||
if (RedbuildCollisionContext)
|
||||
{
|
||||
if (!(*bProcessingGroundCollision.Get()) && !(*bPreprocessingCollisionUpdate.Get())
|
||||
&& CollisionProcess.IsFenceComplete()
|
||||
&& (CollisionMesh.Num() <= 0)
|
||||
&& (UsedCollisionMesh.Num() <= 0))
|
||||
{
|
||||
|
||||
CollisionShareable = nullptr;
|
||||
|
||||
CollisionWorkQueue.Empty();
|
||||
CollisionReadToProcess.Empty();
|
||||
|
||||
RedbuildCollisionContext = false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (RedbuildCollisionContext)
|
||||
return false;
|
||||
|
||||
if (!GenerateCollision)
|
||||
return false;
|
||||
|
||||
if (!CollisionShareable.IsValid())
|
||||
CollisionShareable = MakeShared<FSWCollisionManagementShareableData, ESPMode::ThreadSafe>(CollisionResolution, CollisionVerticesPerPatch);
|
||||
|
||||
if ((*bProcessingGroundCollision.Get()) || (*bPreprocessingCollisionUpdate.Get()) || !CameraSet || (Meshes.Num() == 0))
|
||||
return false;
|
||||
|
||||
//Let the data layer be computed before generating collisions and trying to extract material IDs
|
||||
if (bExportPhysicalMaterialID && (WorldCycle < 2))
|
||||
return false;
|
||||
|
||||
|
||||
if (CollisionVisibleChanged)
|
||||
{
|
||||
if (GetWorld())
|
||||
{
|
||||
for (auto& ColM : CollisionMesh)
|
||||
{
|
||||
if (auto& Mesh = ColM.Value.Mesh)
|
||||
{
|
||||
Mesh->SetMeshSectionVisible(0, CollisionVisible);
|
||||
}
|
||||
}
|
||||
}
|
||||
CollisionVisibleChanged.AtomicSet(false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
```
|
||||
|
||||
### SpawnablesManagement()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user