//////////////////////////////////////////////////////////////////////////////////////////
//
// FILE : Asura_Dynamic_Extents.h
//
// Copyright (C) 2002 Rebellion, All Rights Reserved.
//
//////////////////////////////////////////////////////////////////////////////////////////

#ifdef ASURA_USE_PRAGMA_ONCE
    #pragma once
#endif

#ifndef __ASURA_DYNAMIC_EXTENTS_H__
#define __ASURA_DYNAMIC_EXTENTS_H__

//////////////
// Includes //
//////////////
#include "Core/Asura_Hash.h"
#include "Network/Asura_Guid.h"

/////////////
// Defines //
/////////////
#define ASURA_DYNAMIC_BB_DEFAULT -1

//////////////////////////
// Forward declarations //
//////////////////////////
class Asura_Collision_Object;


//////////////////////////////////////////////////////////////////////////////////////////
// Asura_Dynamic_Extents:                                                               //
//    Returns the correct collision object given an index and possible shape ID			//
//    (the guid is also provided to allow project-specific features).					//
//////////////////////////////////////////////////////////////////////////////////////////
class Asura_Dynamic_Extents
{
public:
	typedef const Asura_Collision_Object* (*PFN_Extents_Handler)(int iIndex, Asura_Hash_ID uShapeHash, Asura_Guid uGuid);
	
	// Set the collision object according to the given index and shape ID.
	static const Asura_Collision_Object* GetCollisionObject(int iIndex, Asura_Hash_ID uShapeHash, Asura_Guid uGuid);

	// Set a handler to return project specific box sizes.
	static void SetExtentsHandler(PFN_Extents_Handler pfnHandler);

	// Return a default (human-sized) dynamics collision box.
	static const Asura_Collision_Object* GetDefaultBox();

protected:
	static const Asura_Collision_Object* GetCollisionObjectForShape(const Asura_Hash_ID uShapeHash);
	static const Asura_Collision_Object* GetCollisionObjectForEntity(const Asura_Guid uGuid);

private:
	static PFN_Extents_Handler s_pfnProjectHandler; // Project specific extents handler
};


#endif //__ASURA_DYNAMIC_EXTENTS_H__
