#pragma once

//#include "..\DXFunctions\DllInterface.h"
#include "..\DXFunctions\RenderList.h"
#include "..\DXFunctions\Bound.h"

//3 states of visibility
enum VISIBLETYPE 
{
	VT_NONE = 0,
	VT_FULL,
	VT_PARTLY
};

class IRenderAble
{
public:
	virtual void AddToRenderList(RenderList& rl) {}
	virtual void AddToShadowRenderList(RenderList& rl) {}
};

class ICullAble
{
protected:
	OBS m_Bound;
public:
	const OBS& GetBound(void) const { return m_Bound; }
};

class ShadowScene;
class SpatialPartitioningTreeNode;

class SceneObject : public IRenderAble, public ICullAble
{
protected:
	//bool						 m_bVisible;
	ShadowScene*				 m_pScene;
	SpatialPartitioningTreeNode* m_pSPTNode;

public:
	DXMatrix				m_CombinedTransformation;
	DXMatrix				m_SubTransformation;
	LList<SceneObject>		m_Childs;

	SceneObject(ShadowScene* const pScene) { m_pScene = pScene; m_pSPTNode = NULL;}
	virtual ~SceneObject(void) {}

	virtual void Update(void) {}; //for dynamic Objects

	virtual void UpdateTechnique(void) {}

	ShadowScene* GetScene(void) const { return m_pScene; }

	void SetSPTNode(SpatialPartitioningTreeNode* const pNode) { m_pSPTNode = pNode; }
	SpatialPartitioningTreeNode* GetSPTNode(void) const { return m_pSPTNode; }

	/*void SetVisibility(const VISIBLETYPE vt)
	{
		//if (m_Visibility != vt) should be done only once before calling this function
		{
			m_Visibility = vt;

			FOREACH(c, m_Childs, SceneObject)
			{
				c->GetInfo()->SetVisibility(vt);
			}
		}
	}*/
};