本文整理汇总了C++中TimingData::size方法的典型用法代码示例。如果您正苦于以下问题:C++ TimingData::size方法的具体用法?C++ TimingData::size怎么用?C++ TimingData::size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimingData
的用法示例。
在下文中一共展示了TimingData::size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessVSpeeds
void Difficulty::ProcessVSpeeds(TimingData& BPS, TimingData& VerticalSpeeds, double SpeedConstant)
{
VerticalSpeeds.clear();
if (SpeedConstant) // We're using a CMod, so further processing is pointless
{
TimingSegment VSpeed;
VSpeed.Time = 0;
VSpeed.Value = SpeedConstant;
VerticalSpeeds.push_back(VSpeed);
return;
}
// Calculate velocity at time based on BPM at time
for (auto Time = BPS.begin();
Time != BPS.end();
++Time)
{
float VerticalSpeed;
TimingSegment VSpeed;
if (Time->Value)
{
float spb = 1 / Time->Value;
VerticalSpeed = MeasureBaseSpacing / (spb * 4);
}
else
VerticalSpeed = 0;
VSpeed.Value = VerticalSpeed;
VSpeed.Time = Time->Time; // We blindly take the BPS time that had offset and drift applied.
VerticalSpeeds.push_back(VSpeed);
}
// Let first speed be not-null.
if (VerticalSpeeds.size() && VerticalSpeeds[0].Value == 0)
{
for (auto i = VerticalSpeeds.begin();
i != VerticalSpeeds.end();
++i)
{
if (i->Value != 0)
VerticalSpeeds[0].Value = i->Value;
}
}
}