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

		APITypes.h

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

		Basic types passed through APIs

		Author:	Ray Dream
		Date:	3/2/98

		Revision History

		when		who					what & why
		==========	==========	======================================================
		11/18/98	Joshua		Moved ECloneMode to APITypes.h from TTimeBased
		11/5/98		Alec		TMatrix33 and TTransform3D type are defines now to
									existing types 
		10/21/98	Alec		added TVector4 definition so that Vec4's can be used
									in the API for the camera, added double bracket
									operators to TMatrix33 so we can replace with TMatrix33
									in the future more easily
		10/20/98	Eml			Moved shading stuff to I3DShShader.h
		9/29/98		Alec		added COMTypes.h and removed duplicate defines
		6/25/98		scooper		change qPowerPc to MAC_POWERPC

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

#ifndef __APITYPES__
#define __APITYPES__

#if CP_PRAGMA_ONCE
#pragma once
#endif

#include "Vector2.h"
#include "Vector3.h"

class TMCColorRGB;
class TMCColorRGBA;

/** Constants **************************************************/


enum
{
	eNoFlags			= 0,
	eExclude3DShaders	= 1,
	eSwapV				= 2,
	eInvalidFlag		= 0xFFFFFFFF
};

/// \addtogroup Data
/// \{

/// Stores the position, normal and uv coordinates of a vertex
///
struct TVertex3D : public TMCObject
{
	TVector3		fVertex;		///< x, y, z vertex coordinates
	TVector3		fNormal;		///< Nx, Ny, Nz normal values at that vertex
	TVector2		fUV;			///< Texture u,v values at that vertex
};

/// TFacet3D defines a 3D triangle with position, normal and UV infos.
///
struct TFacet3D : public TMCObject
{
	TVertex3D		fVertices[3];		///< The facet three vertices
	uint32			fUVSpace;			///< UV Space ID this facet belongs to
	int16			fReserved;			///< Reserved - 0
};

/// \}

/// Deprecated?
///
struct TPatch3D : public TMCObject
{
	TVector3		fVertices[4][4];		// The patch 16 vertices
	real			fu[2];					// u values at the patch boundaries
	real			fv[2];					// v values at the patch boundaries
	int16			fUVSpace;				// UV Space ID this patch belongs to
	int16			fReserved;				// Reserved - 0
};


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

class TMCGraphicContext;
struct I3DShInstance;
typedef void (*EnumPatchesCallback) (TPatch3D* patch, void* privData);

struct LightTraceElement : public TMCObject
{
	TVector3 fPoint1;
	TVector3 fVector1;
	TVector3 fPoint2;
	TVector3 fVector2;
};


// ****************************************************************************
//						EFrameType		
// 
// -Description:
//
// Constants used to store data for previous or next frame (used in Motion Blur)
//
enum EFrameType
{
	kPreviousFrame,
	kCurrentFrame,
	kNextFrame
};



//*********************************************************************************
struct I3DShTreeElement;

/// Stores information for collision detection
///
struct CollisionInfo : public TMCObject
{
	I3DShTreeElement* fObject1;
	I3DShTreeElement* fObject2;
	TVector3 fHitPosition;
	TVector3 fNormal1;
	TVector3 fNormal2;
	TVector3 fVelocity1;
	TVector3 fVelocity2;
};

typedef uint32 TDataKey;

#define kTicksToFile	100					///< this constant is used to store keyframe in a more compact ways in files
#define kTicksPerSecond (1800*kTicksToFile)
#define kInvalidTime	-3
#define kMaxTime		0x7fffffff

typedef int32 MicroTick;
         
#endif