DarkflameServer/dScripts/FrictionVolume.cpp
Aaron Kimbre be551707b8 WIP
2022-08-27 23:27:39 -05:00

18 lines
749 B
C++

#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* phantomPhysicsComponent = self->GetComponent<PhantomPhysicsComponent>();
if (!phantomPhysicsComponent) return;
phantomPhysicsComponent->SetPhysicsEffectActive(true);
phantomPhysicsComponent->SetEffectType(4); // this should be noted in a enum somewhere
phantomPhysicsComponent->SetDirectionalMultiplier(frictionAmount);
}