[StreamDisplay] Added VelocityMultiplier, VelocityMin, VelocityMax, SpringMultiplier and ViscosityMultiplier metrics.
This commit is contained in:
@@ -8,9 +8,14 @@ ________________________________________________________________________________
|
||||
StepMania 5.0 $next | 20111xxx
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
2011/12/16
|
||||
----------
|
||||
* [StreamDisplay] Added VelocityMultiplier, VelocityMin, VelocityMax,
|
||||
SpringMultiplier and ViscosityMultiplier metrics. [AJ]
|
||||
|
||||
2011/12/12
|
||||
----------
|
||||
* [ScreenEdit] Add the GAMESTATE:InStepEditor LUA binding. [Wolfman2000]
|
||||
* [ScreenEdit] Add the GAMESTATE:InStepEditor Lua binding. [Wolfman2000]
|
||||
* [Player, ScreenGameplay] Allow failing on Oni without crashing. This one
|
||||
took awhile. [Wolfman2000]
|
||||
* [LifeMeterBattery] Fixed various issues (lives not fully disappearing on fail,
|
||||
|
||||
@@ -1339,6 +1339,11 @@ NumPills=20
|
||||
UseThreePartMethod=false
|
||||
ThreePartWidth=128
|
||||
AlwaysBounceNormalBar=false
|
||||
VelocityMultiplier=4
|
||||
VelocityMin=-.06
|
||||
VelocityMax=.02
|
||||
SpringMultiplier=2.0
|
||||
ViscosityMultiplier=0.2
|
||||
|
||||
[TextBanner]
|
||||
TitleOnCommand=
|
||||
|
||||
@@ -29,6 +29,11 @@ void StreamDisplay::Load( const RString &_sMetricsGroup )
|
||||
RString sMetricsGroup = "StreamDisplay";
|
||||
|
||||
m_transformPill.SetFromReference( THEME->GetMetricR(sMetricsGroup,"PillTransformFunction") );
|
||||
VELOCITY_MULTIPLIER.Load(sMetricsGroup, "VelocityMultiplier");
|
||||
VELOCITY_MIN.Load(sMetricsGroup, "VelocityMin");
|
||||
VELOCITY_MAX.Load(sMetricsGroup, "VelocityMax");
|
||||
SPRING_MULTIPLIER.Load(sMetricsGroup, "SpringMultiplier");
|
||||
VISCOSITY_MULTIPLIER.Load(sMetricsGroup, "ViscosityMultiplier");
|
||||
|
||||
float fTextureCoordScaleX = THEME->GetMetricF(sMetricsGroup,"TextureCoordScaleX");
|
||||
int iNumPills = static_cast<int>(THEME->GetMetricF(sMetricsGroup,"NumPills"));
|
||||
@@ -71,19 +76,19 @@ void StreamDisplay::Update( float fDeltaSecs )
|
||||
if( fabsf(fDelta) < 0.00001f )
|
||||
m_fVelocity = 0; // prevent div/0
|
||||
else
|
||||
m_fVelocity = (fDelta / fabsf(fDelta)) * 4;
|
||||
m_fVelocity = (fDelta / fabsf(fDelta)) * VELOCITY_MULTIPLIER;
|
||||
}
|
||||
else
|
||||
{
|
||||
const float fSpringForce = fDelta * 2.0f;
|
||||
const float fSpringForce = fDelta * SPRING_MULTIPLIER;
|
||||
m_fVelocity += fSpringForce * fDeltaSecs;
|
||||
|
||||
const float fViscousForce = -m_fVelocity * 0.2f;
|
||||
const float fViscousForce = -m_fVelocity * VISCOSITY_MULTIPLIER;
|
||||
if( !m_bAlwaysBounce )
|
||||
m_fVelocity += fViscousForce * fDeltaSecs;
|
||||
}
|
||||
|
||||
CLAMP( m_fVelocity, -.06f, +.02f );
|
||||
CLAMP( m_fVelocity, VELOCITY_MIN, VELOCITY_MAX );
|
||||
|
||||
m_fTrailingPercent += m_fVelocity * fDeltaSecs;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "Sprite.h"
|
||||
#include "Quad.h"
|
||||
#include "LuaExpressionTransform.h"
|
||||
#include "ThemeMetric.h"
|
||||
|
||||
enum StreamType
|
||||
{
|
||||
@@ -34,6 +35,11 @@ private:
|
||||
vector<Sprite*> m_vpSprPill[NUM_StreamType];
|
||||
|
||||
LuaExpressionTransform m_transformPill; // params: self,offsetFromCenter,itemIndex,numItems
|
||||
ThemeMetric<float> VELOCITY_MULTIPLIER;
|
||||
ThemeMetric<float> VELOCITY_MIN;
|
||||
ThemeMetric<float> VELOCITY_MAX;
|
||||
ThemeMetric<float> SPRING_MULTIPLIER;
|
||||
ThemeMetric<float> VISCOSITY_MULTIPLIER;
|
||||
|
||||
float m_fPercent; // percent filled
|
||||
float m_fTrailingPercent; // this approaches m_fPercent, use this value to draw
|
||||
|
||||
Reference in New Issue
Block a user