Something went wrong. Try again.
the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
Something went wrong. Try again.
654 B · 29 lines
C++
at master
1234567891011121314151617181920212223242526272829#include "stdafx.h"#include "SmoothFloat.h"
SmoothFloat::SmoothFloat(){ targetValue = 0.0f; remainingValue = 0.0f; lastAmount = 0.0f;}
float SmoothFloat::getNewDeltaValue(float deltaValue, float accelerationAmount){ targetValue += deltaValue;
deltaValue = (targetValue - remainingValue) * accelerationAmount; lastAmount = lastAmount + (deltaValue - lastAmount) * 0.5f; if ((deltaValue > 0 && deltaValue > lastAmount) || (deltaValue < 0 && deltaValue < lastAmount)) { deltaValue = lastAmount; } remainingValue += deltaValue;
return deltaValue;}
float SmoothFloat::getTargetValue(){ return targetValue;}