This commit is contained in:
Aaron Kimbre 2022-08-27 23:27:39 -05:00
parent b6fb5f8173
commit be551707b8

View File

@ -1,14 +1,17 @@
#include "FrictionVolume.h" #include "FrictionVolume.h"
#include "PhantomPhysicsComponent.h" #include "PhantomPhysicsComponent.h"
#include "Entity.h" #include "Entity.h"
#include "dLogger.h"
void FrictionVolume::OnStartup(Entity* self) { void FrictionVolume::OnStartup(Entity* self) {
Game::logger->Log("FrictionVolume", "LOT %i", self->GetLOT());
auto frictionAmount = self->GetVarAs<float>(m_FrictionVariable); auto frictionAmount = self->GetVarAs<float>(m_FrictionVariable);
Game::logger->Log("FrictionVolume", "Lvl friction %f", frictionAmount);
if (!frictionAmount) frictionAmount = m_DefaultFriction; if (!frictionAmount) frictionAmount = m_DefaultFriction;
auto* phanPhys = self->GetComponent<PhantomPhysicsComponent>(); auto* phantomPhysicsComponent = self->GetComponent<PhantomPhysicsComponent>();
if (!phanPhys) return; if (!phantomPhysicsComponent) return;
phanPhys->SetPhysicsEffectActive(true); phantomPhysicsComponent->SetPhysicsEffectActive(true);
phanPhys->SetEffectType(4); // this should be noted in a enum somewhere phantomPhysicsComponent->SetEffectType(4); // this should be noted in a enum somewhere
phanPhys->SetDirectionalMultiplier(frictionAmount); phantomPhysicsComponent->SetDirectionalMultiplier(frictionAmount);
} }