#include "grafTransAverage.h"

grafTransAverage::grafTransAverage()
{
    //ctor
}

grafTransAverage::~grafTransAverage()
{
    //dtor
}

void grafTransAverage::averagePoints( grafTag * PR, float pct )
{
    float pctSis = (1-pct) * .5f;

    for( int i = 2; i < PR->pts.size(); i++)
    {
        PR->pts[i-1].pos.x = (pctSis * PR->pts[i-2].pos.x) + (pct * PR->pts[i-1].pos.x) + (pctSis * PR->pts[i].pos.x);
        PR->pts[i-1].pos.y = (pctSis * PR->pts[i-2].pos.y) + (pct * PR->pts[i-1].pos.y) + (pctSis * PR->pts[i].pos.y);
        //PR->pts[i-1].dist  = (pctSis * PR->pts[i-2].dist)  + (pct * PR->pts[i-1].dist)  + (pctSis * PR->pts[i].dist);
    }

    //for( int i = 0; i < PR->pts.size(); i++)
        //PR->pts[i].dist  *= .5;//1-((PR->pts[i].dist/PR->distMax)*.5f);
}
