mirror of
				https://github.com/DarkflameUniverse/DarkflameServer.git
				synced 2025-11-03 22:21:59 +00:00 
			
		
		
		
	WIP
This commit is contained in:
		@@ -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);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user