//##############################################################################
//------------------------------------------------------------------------------
function Spring(damper)
{
    if(typeof(damper) != 'undefined')
        this.damper = damper;
    else
        this.damper = 8;
    
    this.current = 0;
    this.target = 0;
}

//------------------------------------------------------------------------------
Spring.prototype.setCurrentAndTarget = function(value)
{
	this.current = value;
	this.target = value;
}

//------------------------------------------------------------------------------
Spring.prototype.step = function()
{
	var diff = (this.target - this.current) / this.damper;
	this.current += diff;
	
	return diff;
}


