#ifdef ASURA_USE_AXON
//////////////////////////////////////////////////////////////////////////////
//
// Axon_BehaviourParams_GS2Spline.h
//
// Copyright (C) 2008 Rebellion. All Rights Reserved.
//
//////////////////////////////////////////////////////////////////////////////

// B E G I N   F I L E   W R A P P E R ///////////////////////////////////////

#ifdef ASURA_USE_PRAGMA_ONCE
#pragma once
#endif

#ifndef __AXON_BEHAVIOURPARAMS_GS2SPLINE_H__
#define __AXON_BEHAVIOURPARAMS_GS2SPLINE_H__ 1

// E N D   F I L E   W R A P P E R ///////////////////////////////////////////

// I N C L U D E S ///////////////////////////////////////////////////////////

// axon
#include "Behaviour/Axon_BehaviourParams.h"
#include "Behaviour/BehaviourTypes/Axon_Behaviour_GS2Spline.h"

// F O R W A R D   D E C L A R A T I O N S ///////////////////////////////////

class Axon_Gamescene_AnimTemplate;
template< typename T > class List;
class Tools_AnimTemplates_Preview;

//////////////////////////////////////////////////////////////////////////////
//
// Axon_BehaviourParams_GS2Spline
//
//////////////////////////////////////////////////////////////////////////////

class Axon_BehaviourParams_GS2Spline : public Axon_BehaviourParams
{
	typedef Axon_BehaviourParams PARENT;

public:
	Axon_BehaviourParams_GS2Spline( const Axon_BehaviourParams_GS2Spline& xSplineParams );
	Axon_BehaviourParams_GS2Spline( const u_int uBehaviourType );

	virtual bool IsBaseOrDerivativeOf( const u_int uParamsType ) const;

	u_int m_uAnimSet;
	int   m_iTraverseMode;
	float m_fArrivalRange;

protected:
	virtual void ReadFromChunkStream( Asura_Chunk_Stream& xStream );
	virtual void WriteToChunkStream( Asura_Chunk_Stream& xStream ) const;

private:
	enum { CURRENT_CHUNK_VERSION = 0 };

#ifdef ASURA_TOOLS
protected:
	virtual void Render();
	virtual void Update();
	virtual void StartPreview();
	virtual bool UpdatePreview();
	virtual void StopPreview();
	virtual void SetToolsNode( Tools_Entity_Node* pxToolsNode );
	virtual void AddOverlayControls( Asura_Tabs_Dialog* pxTabsDialog, Asura_Vector_2& xOffset );
	virtual void AddFilesToExportList( List< Asura_String >& xNameList ) const;
	virtual bool GetParameter( const Asura_Hash_ID uParamID, Tools_Parameter* pxParam ) const;
	virtual bool SetParameter( const Asura_Hash_ID uParamID, const Tools_Parameter* pxParam );
	virtual bool Verify( const bool bAutomatic );
	virtual Axon_BehaviourParams* Clone() const;

protected:
	static const char* s_pszTraverseModeStrings[ AXON_GS2_STM_NUM_CORE_TRAVERSE_MODES ];

private:
	void ResetPreviewVariables();
	void OrientationFromOffset( const Asura_Vector_3& xP0, const Asura_Vector_3& xP1, Asura_Matrix_3x3& xOrientation );

	static bool IsUsingRange( int iThis );
	static void SetStartFromEnd( int iThis );
	static void SetEndFromStart( int iThis );
	static void PickAnimSet( int iThis );

private:
	bool m_bUseArrivalRange;
	bool m_bSetStartFromEnd;
	bool m_bSetEndFromStart;

	bool						 m_bPreviewing;
	float						 m_fPreviewTime;
	float						 m_fPreviewDistance;
	Axon_Gamescene_AnimTemplate* m_pxPreviewAnimTemplate;
	Tools_AnimTemplates_Preview* m_pxPreviewAnimation;
	Asura_Matrix_3x3			 m_xPreviewOrient;
	Asura_Vector_3				 m_xPreviewPosition;
	Asura_Vector_3				 m_xPrevPreviewPosition;
	float						 m_fPreviewPrevFollowSurfaceDistance;
#endif
};

//////////////////////////////////////////////////////////////////////////////
//
// 
//
//////////////////////////////////////////////////////////////////////////////

#endif //__AXON_BEHAVIOURPARAMS_GS2SPLINE_H__
#endif // ASURA_USE_AXON
