//////////////////////////////////////////////////////////////////////////////
//
// Asura_3dDecal_System.h
//
// Copyright (c) 2004 Rebellion. All rights reserved.
//
// Description:
//
//     3d objects (e.g. small craters) placed as decals
//
//////////////////////////////////////////////////////////////////////////////

// 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 ___ASURA_3DDECAL_SYSTEM_H___
#define ___ASURA_3DDECAL_SYSTEM_H___ 1

#include "Core/Asura_Hash.h"
#include "Core/Asura_Maths.h"

#define ASURA_3DDECAL_NOFLAG		0x0000
#define ASURA_3DDECAL_GROW			0x0001
#define ASURA_3DDECAL_ANIMATEBLEND  0x0002

static const u_int uASURA_3DDECAL_MAX_BLEND_SHAPES = 8;

class Asura_3dDecal_Template
{
	public:

		Asura_Hash_ID m_uShapeHashID;
		Asura_Hash_ID m_uTopFaceHashID;
		Asura_Hash_ID m_uBlendHashID[uASURA_3DDECAL_MAX_BLEND_SHAPES];
		float m_fTimer;
		u_short m_uFlags;
};

class Asura_3dDecal_System
{

	public:
	
		static void Initialise(void);
		static void Reset(void);
		static void Shutdown(void);

		static void Update(void);
		static void EarlyRender(void);
		static void LateRender(void);

		static bool AddDecal(const Asura_Vector_3& xPosition, const Asura_Vector_3& xSurfaceNormal, u_int uTemplateID, float fRotation = 0.0f, Asura_Vector_3 xScale = Asura_Vector_3(1.0f, 1.0f, 1.0f));


	private:

		static const Asura_3dDecal_Template* Project_GetTemplate(u_int uTemplateID);

};

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

#endif // #ifndef ___ASURA_3DDECAL_SYSTEM_H___
