Skip to content

Instantly share code, notes, and snippets.

@ROBOKiTTY
Created August 30, 2012 23:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ROBOKiTTY/3545624 to your computer and use it in GitHub Desktop.
Save ROBOKiTTY/3545624 to your computer and use it in GitHub Desktop.
Try reading this out loud
boolean phaseThree = false;
if (enablePrecision == true)
{
phaseThree = true;
for (int i = 0; i < components.length; ++i)
{
if (!components[i].isPrecise)
{
phaseThree = false;
}
}
}
if (!phaseThree)
{
for (int i = 0; i < segmentController.timeCycles.length; ++i)
{
timeCycleStates[i].setTime(segmentController.timeCycles[i] instanceof ReverseTimeCycleAnalyser ?
timeCycleStates[i].getDuration() * ( 1 - (normalizedTime - segmentController.timeCycles[i].cycleOffsetValue) ) :
timeCycleStates[i].getDuration() * (normalizedTime - segmentController.timeCycles[i].cycleOffsetValue)
);
}
}
if (speed > speedThreshold)
{
normalizedTime *= speed;
for (int i = 0; i < segmentController.timeAdvancedCycles.length; ++i)
{
segmentController.timeAdvancedCycles[i].time = timeAdvancedCycleStates[i].getDuration() * normalizedTime;
}
analyseCycles();
for (int i = 0; i < segmentController.timeAdvancedCycles.length; ++i)
{
if (segmentController.timeAdvancedCycles[i].getTime() > maxTimeLimit ||
segmentController.timeAdvancedCycles[i].getTime() < minTimeLimit)
{
segmentController.timeAdvancedCycles[i].setTime(
segmentController.timeCycles[i] instanceof ReverseTimeCycleAnalyser ?
timeCycleStates[i].getDuration() * ( 1 - (normalizedTime - segmentController.timeAdvancedCycles[i].cycleOffsetValue) ) :
timeCycleStates[i].getDuration() * (normalizedTime - segmentController.timeAdvancedCycles[i].cycleOffsetValue)
);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment