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

		I3dExAnimation.h

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

		I3DExTimeManager definition
		I3DExTimeBaseData definition
		I3DExTimeLineM definition
		I3DExTimeIKBehavior definition

		Author:	Ray Dream
		Date:	03/02/98

		Revision History

		when		who			what & why
		==========	==========	======================================================
		11/18/98	Eml			Animation engine cleanup

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

#ifndef __I3DExAnimation__
#define __I3DExAnimation__

#if CP_PRAGMA_ONCE
#pragma once
#endif

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


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

MCDEFINE_GUID_H(IID_I3DExAnimated);
MCDEFINE_GUID_H(IID_I3DExTreeIKBehavior);

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


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


// ****************************************************************************
//								I3DExAnimated
// 
/// Your object should derive from this interface if you want to register extra
/// parameters (parameters that are not in the parameter map). This allows you
/// to register a dynamic number of parameters
///
///
struct I3DExAnimated: public IMCUnknown
{
	// ****************************************************************************
	//								RegisterParams
	// 
	/// This functions is called by the shell to register extra parameters for the
	/// object. Here an example of how to register an extra parameter:
	///
	/// \code
	///
	/// TMCCountedPtr<ITimeBased> timeBased;
	/// QueryInterface(IID_ITimeBased, (void**)&timeBased);
	/// ThrowIfNil(timeBased);
	///   
	/// I3DShTimeBasedData* timeBasedData = timeBased->GetTimeBasedDataNoAddRef();
	///   
	/// if (MCVerify(timeBasedData))
	/// {
	///   real param=0;
	///   timeBasedData->SetParam(&param,"Dynamic Param",'temp',kReal32ParamType);
	/// }
	///
	/// \endcode
	///
	virtual MCCOMErr MCCOMAPI RegisterParams() = 0;

	// ****************************************************************************
	//								InvalidateCaches
	// 
	/// Invalidates caches associated with an animated parameter. In most cases
	/// this method should do nothing.
	///
	/// \param itsID		The ID of the parameter.
	/// \param itsIndex		The index of the parameter.
	///
	virtual MCCOMErr MCCOMAPI InvalidateCaches(int32 itsID, int32 itsIndex) = 0;

	// ****************************************************************************
	//								CopyTimeData
	// 
	/// Is called during clone to copy the animation data associated with the
	/// extra parameters registered in RegisterParams().
	///
	/// \param dest A pointer to the destination component.
	///
	virtual MCCOMErr MCCOMAPI CopyTimeData(IMCUnknown *dest) = 0;
};

// ****************************************************************************
//								I3DExTreeIKBehavior
// 
///  
///
struct I3DExTreeIKBehavior: public IMCUnknown
{
	virtual MCCOMErr MCCOMAPI SetGlobalTransform(I3DShTreeElement *atree, const TMatrix33 *RR, const TVector3 *TT, int16 mode) = 0;

	//If the ik behavior wants to, it can store a target and track it in this function
	//myTree: the tree on which this behavior is applied
	virtual void	 MCCOMAPI TrackTarget		(I3DShTreeElement* myTree) = 0;
};

/// \}


#endif