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