#include "ForceVolumeServer.h" #include "PhantomPhysicsComponent.h" #include "EntityManager.h" #include "ePhysicsEffectType.h" void ForceVolumeServer::OnStartup(Entity* self) { auto* phantomPhysicsComponent = self->GetComponent(); if (phantomPhysicsComponent == nullptr) 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(ePhysicsEffectType::PUSH); phantomPhysicsComponent->SetDirectionalMultiplier(forceAmount); phantomPhysicsComponent->SetDirection({ forceX, forceY, forceZ }); phantomPhysicsComponent->SetPhysicsEffectActive(true); Game::entityManager->SerializeEntity(self); }