/****************************************************************************************************

		UVMethods.h
		Copyright: (c) 2001 Eovia Corp. All rights reserved.

		Author:	Julien
		Date:	7/24/2003

****************************************************************************************************/

#ifndef __UVMethods__
#define __UVMethods__

#if CP_PRAGMA_ONCE
#pragma once
#endif

#include "Vector2.h"
#include "MCArray.h"

// calculates uv1 * (1-t) + uv2 * t
TVector2 InterpolateUVs(const TVector2& uv1,const TVector2& uv2,real t, const TMCArray<boolean>& wrapping);

// Calculate the average of 2 UV values, doing a wrapping if necessary
TVector2 Average2UVs(const TVector2& uv0, const TVector2& uv1, const TMCArray<boolean>& wrapping);

// Calculate the average of 3 UV values, doing a wrapping if necessary
TVector2 Average3UVs(const TMCArray<TVector2>& uvs, const TMCArray<boolean>& wrapping);

// Calculate the average of n UV values, doing a wrapping if necessary
TVector2 AverageUVs(const TMCArray<TVector2>& uvs, const TMCArray<boolean>& wrapping);

// average on 1 axis ( U or V)
real32 Average(const TMCArray<real32>& values, const boolean wrap);





#endif
