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

		I3DExTweener.h

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

		I3DExTweener definition

		Author:	Ray Dream
		Date:	3/2/98

		Revision History

		when		who			what & why
		==========	==========	======================================================
		08/26/99	cph			Added family ids

*****************************************************************************************/
#ifndef __I3DEXTWEENER__
#define __I3DEXTWEENER__

#if CP_PRAGMA_ONCE
#pragma once
#endif

#include "IExtension.h"
#include "APITypes.h"
#include "InterfaceIDs.h"
#include "Matrix33Fwd.h"


//****** Globally Unique Ids *************************************************

MCDEFINE_GUID_H(IID_I3DExTweener);
MCDEFINE_GUID_H(IID_I3DExInvertibleTweener);
MCDEFINE_GUID_H(IID_I3DExTweenerEdition);

//****** Family Id *************************************************

const FourCharT kTweenerFamilyID = kRID_TweenerFamilyID;


/*****************************************************************************\
*  I3DExTweener                                                               *
*                                                                             *
*  Animation Tweeners 		                                                  *
*                                                                             *
\*****************************************************************************/

struct I3DShKeyFrame;
struct I3DShTweenerChainLink;
struct I3DShTreeElement;

class TMCRect;

#ifndef qDemoVersion //regular interface


/// \addtogroup ExternalInterface
///
/// \{


/// Defines Animation Tweeners. Tweeners are 3D Components that describe the
/// interpolation between key frames.
///
struct I3DExTweener: public IMCUnknown
{
	virtual MCCOMErr MCCOMAPI SimpleTween(real& result, int32 time, int32 time1, int32 time2) = 0;

	// ****************************************************************************
	//								Tween
	// 
	/// Interpolates a value between two keyframes.
	///
	/// \param res			: keyFrame where the result is stored
	/// \param time			: time at which the tweener should be evaluated
	/// \param alink		: link between the two keyframes where time is located
	///
	/// -Returns:
	///
	/// MC_S_OK if it executed properly. MC_E_NOTIMPL if it is not implemented
	///
	virtual MCCOMErr MCCOMAPI Tween(I3DShKeyFrame* res,int32 time, I3DShTweenerChainLink* alink) = 0;
	
	// ****************************************************************************
	//								Derivate
	// 
	/// Calculate the first derivative of the value as a function of time. This function
	/// is used for motion blur and should be implemented so that your tweener is
	/// compatible with the motion blur.
	///
	/// \param res			: keyFrame where the result is stored
	/// \param time			: time at which the tweener should be evaluated
	/// \param alink		: link between the two keyframes where time is located
	///
	/// \return MC_S_OK if it executed properly. MC_E_NOTIMPL if it is not implemented
	///
	virtual MCCOMErr MCCOMAPI Derivate(I3DShKeyFrame* res,int32 time,I3DShTweenerChainLink* alink) = 0;

	// ****************************************************************************
	//								NeedKeyFrameTangents
	// 
	/// Returns true if the tweener need to have tangents on the keyframes.
	/// 
	virtual boolean	 MCCOMAPI NeedKeyFrameTangents() const = 0;
};

/// \}

#else 	//(qDemoVersion) begin scrambled interface

struct I3DExTweener: public IMCUnknown
{	
	virtual boolean	 MCCOMAPI NeedKeyFrameTangents() const = 0;
	virtual MCCOMErr MCCOMAPI Tween(I3DShKeyFrame* res,int32 time, I3DShTweenerChainLink* alink) = 0;
	virtual MCCOMErr MCCOMAPI SimpleTween(real& result, int32 time, int32 time1, int32 time2) = 0;
};

#endif	//(qDemoVersion) end scrambled

/// \addtogroup ExternalInterface
///
/// \{

/// A Tweener can derive from this interface if it is inversible. (see I3DExTweener).
///
struct I3DExInvertibleTweener: public IMCUnknown
{
	virtual MCCOMErr MCCOMAPI Inverse() = 0;
};

struct I3DExTweenerEdition: public IMCUnknown
{
	virtual MCCOMErr MCCOMAPI PrepareEdit(I3DShTweenerChainLink* alink) = 0;
};
/// \}


#endif
