Files
bluflame/evoke-64k/ev10/TargetValue.h
2026-04-18 22:31:51 +02:00

32 lines
525 B
C

#pragma once
struct STargetValue
{
float m_fValue;
float m_fTarget;
float m_fSpeed;
float m_fAcceleration;
float m_fFriction;
STargetValue
( float fValue,
float fTarget,
float fSpeed,
float fAcceleration,
float fFriction )
{
m_fValue= fValue;
m_fTarget= fTarget;
m_fSpeed= fSpeed;
m_fAcceleration= fAcceleration;
m_fFriction= fFriction;
}
void timeStep()
{
m_fValue+= m_fSpeed;
float fDist= m_fTarget - m_fValue;
m_fSpeed+= fDist * m_fAcceleration;
m_fSpeed*= m_fFriction;
}
};