#include "ForceVolumeServer.h" #include "PhantomPhysicsComponent.h" #include "EntityManager.h" #include "dLogger.h" void ForceVolumeServer::OnStartup(Entity* self) { auto* phantomPhysicsComponent = self->GetComponent(); if (phantomPhysicsComponent == nullptr) { Game::logger->Log("ForceVolumeServer", "Failed to find PhantomPhysicsComponent\n"); return; } const auto forceAmount = self->GetVar(u"ForceAmt"); const auto forceX = self->GetVar(u"ForceX"); const auto forceY = self->GetVar(u"ForceY"); const auto forceZ = self->GetVar(u"ForceZ"); phantomPhysicsComponent->SetEffectType(0); // PUSH phantomPhysicsComponent->SetDirectionalMultiplier(forceAmount); phantomPhysicsComponent->SetDirection({ forceX, forceY, forceZ }); phantomPhysicsComponent->SetPhysicsEffectActive(true); EntityManager::Instance()->SerializeEntity(self); }