Progress on Animation Queue Pipeline

This commit is contained in:
2023-09-15 00:01:41 -04:00
parent 7b58dea692
commit afa0cfbe6d
15 changed files with 342 additions and 30 deletions

View File

@@ -2,8 +2,10 @@
#include "TangibleManager.h"
#include "TangibleInterface.h"
#include "DebugPrint.h"
using AActorPtr = AActor*;
using namespace DebugPrint;
FTangibleManager::FTangibleManager() {
World = nullptr;
@@ -19,8 +21,8 @@ void FTangibleManager::Init(UWorld *world, UClass* tanact) {
Near = IdView();
}
AActorPtr FTangibleManager::GetTangible(int64 id) {
AActorPtr *p = IdToActor.Find(id);
UTangible *FTangibleManager::GetTangible(int64 id) {
UTangible **p = IdToTangible.Find(id);
if (p == nullptr) {
return nullptr;
} else {
@@ -28,14 +30,17 @@ AActorPtr FTangibleManager::GetTangible(int64 id) {
}
}
AActorPtr FTangibleManager::MakeTangible(int64 id) {
AActorPtr& p = IdToActor.FindOrAdd(id);
UTangible *FTangibleManager::MakeTangible(int64 id) {
UTangible *& p = IdToTangible.FindOrAdd(id);
if (p == nullptr) {
FVector location(0,0,0);
FRotator rotation(0, 0, 0);
FActorSpawnParameters params;
p = World->SpawnActor(ClassTangibleActor, &location, &rotation, params);
check(p != nullptr);
AActor* a = World->SpawnActor(ClassTangibleActor, &location, &rotation, params);
check(a != nullptr);
check(a->GetClass()->ImplementsInterface(UTangibleInterface::StaticClass()));
p = NewObject<UTangible>();
p->Init(a);
}
return p;
}
@@ -46,9 +51,9 @@ void FTangibleManager::DeleteTangible(int64 id) {
FTangibleManager::IdArray FTangibleManager::GetLive() {
IdArray result;
result.SetNum(IdToActor.Num());
result.SetNum(IdToTangible.Num());
int next = 0;
for (auto &pair : IdToActor) {
for (auto &pair : IdToTangible) {
result[next++] = pair.Key;
}
return result;