port from perforce
This commit is contained in:
32
evoke-64k/trunk/ev10/TargetValue.h
Normal file
32
evoke-64k/trunk/ev10/TargetValue.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#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;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user