if(t<=swptime && t>swptime-swplength)
{
Real amount=(swptime-t)/swplength;
// if amount==0.0, then we are after
// if amount==1.0, then we are before
if(t<=swptime && t>swptime-swplength)
{
Real amount=(swptime-t)/swplength;
// if amount==0.0, then we are after
// if amount==1.0, then we are before