Tangible creation and destruction in place

This commit is contained in:
2023-09-28 14:32:48 -04:00
parent 9116a7b8fe
commit 642b444d13
7 changed files with 174 additions and 32 deletions

View File

@@ -109,42 +109,26 @@ void AIntegrationGameModeBase::MaybeTriggerUpdateTask(float deltaseconds) {
}
}
//#pragma optimize( "", off )
//void SetLocal(UObject* obj, const char *name, int value) {
// FString sname((const UTF8CHAR *)name);
// FName nname(sname);
// UClass* uclass = obj->GetClass();
// FProperty* fprop = FindFProperty<FProperty>(uclass, nname);
// FStructProperty* sprop = FindFProperty<FStructProperty>(uclass, nname);
//}
#pragma optimize("", off)
void AIntegrationGameModeBase::UpdateTangibles() {
double radius = 1000.0; // Hardwired for now.
using TanArray = UlxTangibleManager::TanArray;
if (!Playing) return;
FlxLockedWrapper w(LockableWrapper);
int64 player = w.GetActor();
TangibleManager->UpdateNear(w.GetNear(player, 100, 100, 100));
IdView nearids = w.GetNear(player, radius, radius, radius);
TangibleManager->UpdateNearAccordingToLuprex(nearids);
TanArray alltans = TangibleManager->GetAllTangibles();
IdArray allids = TangibleManager->GetIds(alltans);
StringViewVec allqueues = w.GetAnimationQueues(allids);
for (int i = 0; i < alltans.Num(); i++) {
UlxTangible *t = alltans[i];
t->AnimTracker.Update(allqueues[i]);
TArray<uint64> aborted = t->AnimTracker.GetAborted();
for (uint64 hash : aborted) {
IlxTangibleInterface::Execute_AbortAnimation(t->GetActor(), hash);
}
FlxAnimationStep step;
ElxAnimationMode mode = t->AnimTracker.GetNextStep(step);
if (mode != ElxAnimationMode::INVALID) {
bool started = IlxTangibleInterface::Execute_StartAnimation(t->GetActor(), mode, step);
if (started) {
t->AnimTracker.StartedStep(step.Hash);
}
}
alltans[i]->UpdateAnimationQueue(allqueues[i]);
}
TangibleManager->RecalcNearAccordingToUnreal(player, radius);
TangibleManager->DeleteFarawayTangibles();
}
void AIntegrationGameModeBase::ConsoleSendInput(const FString& fs)