/* -----------------------------------------------------------------------------
	GSFramework
	Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
----------------------------------------------------------------------------- */


#ifndef	__NINSTANCE__
#define	__NINSTANCE__


		#include "scene3d/mitem.h"


namespace GS {
	namespace S3D {
		class Group;

/*!
	@short	Scene instance proxy.
	@author Emmanuel Julien (ejulien@gsworks.fr)
*/
struct	Instance : public MItem, public Core::Item
{
static	MItemType		GetMItemClassType() { return Type_Instance; }

		String			template_path;
		bool			do_not_parent;

		Group			*instance_group;

		bool			Instantiate(Scene *);

virtual	Core::Item		*GetBaseItem() { return this; }
virtual	Core::Renderable *GetRenderable() { return 0; }

virtual	void			RenderSetup(Core::ResourceFactories * = 0);

		void			ComputeMinMax(MinMax &) const;

/*!
	@name	Editor specific.
	@{
*/
		AutoPtr <Scene>	instance_scene;		///< Used by the editor.

		void			FreeEditorInstance();
/// @}

		bool			FromMetaTag(NML::Tag &);
		NML::Tag		*AsMetaTag();

		Instance();
		~Instance();
};

	} // S3D
} // GS


#endif // __NINSTANCE__
