//===========================================================================//
// File:	SimpleChannelAnimator.cpp                                                 
// Project: MechWarrior 4
// Contents: 
//			
//---------------------------------------------------------------------------//
//   Date    Who  Modification                                               //
// --------  ---  ---------------------------------------------------------- //
// 12/17/99  JSE  Initial coding, 
//---------------------------------------------------------------------------//
// Copyright (C) 1998, Fasa Interactive, Inc.
// All Rights reserved worldwide
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL
//===========================================================================//

#include "MW4Headers.hpp"
#include "SimpleChannelAnimator.hpp"


void
	SimpleChannelAnimatorOf<Scalar>::UpdatePosition(void)
{
	Scalar lerp;

	dirtyFlag = false;
	if (currentTime >= totalTime)
	{
		currentPosition = endPosition;
		return;
	}
	
	lerp = currentTime/totalTime;

	currentPosition = Lerp(startPosition, endPosition, lerp);

}

void
	SimpleChannelAnimatorOf<Point3D>::UpdatePosition(void)
{
	Scalar lerp;

	dirtyFlag = false;
	if (currentTime >= totalTime)
	{
		currentPosition = endPosition;
		return;
	}

	lerp = currentTime/totalTime;

	currentPosition.Lerp(startPosition, endPosition, lerp);
}

void
	SimpleChannelAnimatorOf<Vector3D>::UpdatePosition(void)
{
	Scalar lerp;

	dirtyFlag = false;
	if (currentTime >= totalTime)
	{
		currentPosition = endPosition;
		return;
	}

	lerp = currentTime/totalTime;

	currentPosition.Lerp(startPosition, endPosition, lerp);
}

void
	SimpleChannelAnimatorOf<UnitQuaternion>::UpdatePosition(void)
{
	Scalar lerp;

	dirtyFlag = false;
	if (currentTime >= totalTime)
	{
		currentPosition = endPosition;
		return;
	}

	lerp = currentTime/totalTime;

	currentPosition.Lerp(startPosition, endPosition, lerp);
}

void
	SimpleChannelAnimatorOf<YawPitchRoll>::UpdatePosition(void)
{
	Scalar lerp;

	dirtyFlag = false;
	if (currentTime >= totalTime)
	{
		currentPosition = endPosition;
		return;
	}

	lerp = currentTime/totalTime;

	currentPosition.Lerp(startPosition, endPosition, lerp);
}