// creating vertex declaration, vertex buffers etc for grannyloader and similar geometry generation
// large parts of this file are automatically generated by iris/scripts/luabindheader.lua

#include "lugre_prefix.h"
#include "lugre_luabind.h"
#include "lugre_luabind_direct.h"
#include "lugre_luabind_ogrehelper.h"
#include "lugre_ogrewrapper.h"
#include "lugre_scripting.h"
#include "lugre_fifo.h"
#include <Ogre.h>
#include <OgreRenderOperation.h>
#include <OgreHardwareVertexBuffer.h> 
#include <OgreAnimationTrack.h> 

extern "C" {
	#include "lua.h"
	#include "lauxlib.h"
	#include "lualib.h"
}

using namespace Ogre;

class lua_State;


namespace Lugre {

// String ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME = "General";
	
// SceneManager, viewport, window ?
// Light
// Entity
// material, technique, pass, texture_unit
// image
// rendertexture
	
//~ lugre_camera_L.cpp
//~ lugre_image_L.cpp
//~ lugre_material_L.cpp
//~ lugre_rendertexture_L.cpp
//~ lugre_viewport_L.cpp

	/*
// ogre mesh, entity, sub mesh, sub entity :  bone assignments seem to be meshbased ? 
	// sub->addBoneAssignment(assign);
	weird : mlBodySamples
	
// TODO : getRenderSystem -> name ?
	*/


class cLugreLuaBind_Ogre_MovableObject : public cLuaBindDirect<Ogre::MovableObject>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE 
		// unknown syntax:class _OgreExport Listener;
		// unknown syntax:MovableObject();
		// unknown syntax:MovableObject(String name);
		// unknown syntax:~MovableObject();
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_notifyCreator,										,(ParamMovableObjectFactory*(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushMovableObjectFactory*,						_getCreator,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_notifyManager,										,(ParamSceneManager(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushSceneManager,								_getManager,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushString,								getName,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushString,								getMovableType,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNode,								getParentNode,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSceneNode,							getParentSceneNode,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isParentTagPoint,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													_notifyAttached,								,(ParamNode(L,2),ParamBool(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,								isAttached,									,()	);
#if OGRE_VERSION < 0x10700
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													detatchFromParent,							,()	);
#else
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													detachFromParent,							,()	);
#endif
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,								isInScene,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													_notifyMoved,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													_notifyCurrentCamera,						,(ParamCamera(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushAxisAlignedBox,						getBoundingBox,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,								getBoundingRadius,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushAxisAlignedBox,								getWorldBoundingBox,								,(ParamBool(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSphere,										getWorldBoundingSphere,								,(ParamBool(L,2))	);
		//~ RENDERQUEUE not yet bound ? LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_updateRenderQueue,									,(ParamRenderQueue(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													setVisible,									,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,								getVisible,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,								isVisible,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													setRenderingDistance,						,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,								getRenderingDistance,						,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setUserAny,											,(ParamAny(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushAny,										getUserAny,											,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushUserObjectBindings,							getUserObjectBindings,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushUserObjectBindings,							getUserObjectBindings,2								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													setRenderQueueGroup,							,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setRenderQueueGroupAndPriority,						,(ParamInt(L,2),ParamInt(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,								getRenderQueueGroup,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushMatrix4,									_getParentNodeFullTransform,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													setQueryFlags,								,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													addQueryFlags,								,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													removeQueryFlags,							,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,								getQueryFlags,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													setDefaultQueryFlags,						,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,								getDefaultQueryFlags,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													setVisibilityFlags,							,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													addVisibilityFlags,							,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													removeVisibilityFlags,						,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,								getVisibilityFlags,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													setDefaultVisibilityFlags,					,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,								getDefaultVisibilityFlags,					,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setListener,										,(ParamListener*(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushListener*,									getListener,										,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushLightList,									queryLights,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getLightMask,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setLightMask,										,(ParamInt(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushLightList*,									_getLightList,										,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushEdgeData*,									getEdgeList,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasEdgeList,										,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushShadowRenderableListIterator,				getShadowVolumeRenderableIterator,					,(ParamShadowTechnique(L,2),ParamLight(L,3),ParamHardwareIndexBufferSharedPtr*(L,4),ParamBool(L,5),ParamNumber(L,6),ParamInt(L,7))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushAxisAlignedBox,						getLightCapBounds,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushAxisAlignedBox,								getDarkCapBounds,									,(ParamByRefLight(L,2),ParamNumber(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													setCastShadows,								,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,								getCastShadows,								,()	);
		#if OGRE_VERSION >= 0x10604
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getReceivesShadows,									,()	);
		#endif
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,								getPointExtrusionDistance,					,(ParamLight(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,								getTypeFlags,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															visitRenderables,									,(ParamRenderable::Visitor*(L,2),ParamBool(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													setDebugDisplayEnabled,						,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,								isDebugDisplayEnabled,						,()	);
		
		
		LUABIND_PrefixConstant(Ogre,RENDER_QUEUE_BACKGROUND)
		LUABIND_PrefixConstant(Ogre,RENDER_QUEUE_SKIES_EARLY)
		LUABIND_PrefixConstant(Ogre,RENDER_QUEUE_1)
		LUABIND_PrefixConstant(Ogre,RENDER_QUEUE_2)
		LUABIND_PrefixConstant(Ogre,RENDER_QUEUE_WORLD_GEOMETRY_1)
		LUABIND_PrefixConstant(Ogre,RENDER_QUEUE_3)
		LUABIND_PrefixConstant(Ogre,RENDER_QUEUE_4)
		LUABIND_PrefixConstant(Ogre,RENDER_QUEUE_MAIN)	/// The default render queue
		LUABIND_PrefixConstant(Ogre,RENDER_QUEUE_6)
		LUABIND_PrefixConstant(Ogre,RENDER_QUEUE_7)
		LUABIND_PrefixConstant(Ogre,RENDER_QUEUE_WORLD_GEOMETRY_2)
		LUABIND_PrefixConstant(Ogre,RENDER_QUEUE_8)
		LUABIND_PrefixConstant(Ogre,RENDER_QUEUE_9)
		LUABIND_PrefixConstant(Ogre,RENDER_QUEUE_SKIES_LATE)
		LUABIND_PrefixConstant(Ogre,RENDER_QUEUE_OVERLAY)
		LUABIND_PrefixConstant(Ogre,RENDER_QUEUE_MAX)
		
		/*
		Sphere & 			getWorldBoundingSphere,			(ParamBoolDefault(L,2,false))   );
		Matrix4 & 			_getParentNodeFullTransform,	()                          	 );
		Node * 				getParentNode,				 	()                          	 );
		SceneNode * 		getParentSceneNode,				()
		*/
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.MovableObject"; }
};

class cLugreLuaBind_Ogre_Renderable : public cLuaBindDirect<Ogre::Renderable>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE 
		// unknown syntax:class RenderSystemData;
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushRenderable():,								mPolygonModeOverrideable,							,(Paramtrue)(L,2),ParammUseIdentityProjection(false)(L,3),ParammUseIdentityView(false)(L,4),ParammRenderSystemData(NULL(L,5))	);
		// unknown syntax:~Renderable();
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushMaterialPtr,								getMaterial,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushTechnique,									getTechnique,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																getRenderOperation,									,(ParamByRefRenderOperation(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,										preRender,											,(ParamSceneManager(L,2),ParamRenderSystem*(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															postRender,											,(ParamSceneManager(L,2),ParamRenderSystem*(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															getWorldTransforms,									,(ParamMatrix4*(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(		PushNumber,	 	getNumWorldTransforms,		,() );
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(						setUseIdentityProjection,	,(ParamBool(L,2)) );
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(		PushBool, 		getUseIdentityProjection,	,() );
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(						setUseIdentityView,			,(ParamBool(L,2)) );
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(		PushBool,		getUseIdentityView,			,() );
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getSquaredViewDepth,								,(ParamCamera(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushLightList,									getLights,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(		PushBool,		getCastsShadows,			,() );
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setCustomParameter,									,(ParamInt(L,2),ParamVector4(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(		PushVector4,	getCustomParameter,			,(ParamInt(L,2)) );
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_updateCustomGpuParameter,							,(ParamGpuProgramParameters::AutoConstantEntry(L,2),ParamGpuProgramParameters*(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(						setPolygonModeOverrideable,	,(ParamBool(L,2)) );
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(		PushBool,		getPolygonModeOverrideable,	,() );
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setUserAny,											,(ParamAny(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushAny,										getUserAny,											,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushUserObjectBindings,							getUserObjectBindings,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushUserObjectBindings,							getUserObjectBindings,2								,()	);
		// unknown syntax:class Visitor;
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushRenderSystemData*,							getRenderSystemData,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setRenderSystemData,								,(ParamRenderSystemData*(L,2))	);
		
		/*
						getWorldTransforms (Matrix4 *xform) 
		
		MaterialPtr & 	getMaterial ()
		Technique * 	getTechnique ()
						getRenderOperation (RenderOperation &op)
		bool 			preRender (SceneManager *sm, RenderSystem *rsys)
						postRender (SceneManager *sm, RenderSystem *rsys)
						
		Real 			getSquaredViewDepth (Camera *cam) 
		LightList & 	getLights () 
						_updateCustomGpuParameter (GpuProgramParameters::AutoConstantEntry &constantEntry, GpuProgramParameters *params)
				
		*/
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.Renderable"; }
};

class cLugreLuaBind_Ogre_Resource : public cLuaBindDirect<Ogre::Resource>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE
		// adding try/catch to load to avoid segfault in case texture not found etc
		LUABIND_QUICKWRAP(load,	{ 
				try {
					Ogre::Resource* o = checkudata_alive(L);
					o->load(ParamBoolDefault(L,2,false));
					PushBool(L,true);
					return 1;
				}
				catch (std::exception& e) { PushBool(L,false); PushString(L,e.what()); return 2; }
				catch (...) { PushBool(L,false); PushString(L,"Ogre_Resource:Load: unknown error"); return 2; }
			});
			
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																load,												,(ParamBool(L,2))	);
		
		// unknown syntax:OGRE_AUTO_MUTEX class Listener;
		// unknown syntax:enum LoadingState;
		// unknown syntax:Resource(ResourceManager* creator,String name,ResourceHandle handle,String group,bool isManual,ManualResourceLoader* loader);
		// unknown syntax:~Resource();
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																prepare,											,(ParamBool(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																load,												,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																reload,												,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isReloadable,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isManuallyLoaded,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																unload,												,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getSize,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																touch,												,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getName,											,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushResourceHandle,								getHandle,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isPrepared,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isLoaded,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isLoading,											,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushLoadingState,								getLoadingState,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isBackgroundLoaded,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setBackgroundLoaded,								,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																escalateLoading,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															addListener,										,(ParamListener*(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															removeListener,										,(ParamListener*(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getGroup,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																changeGroupOwnership,								,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushResourceManager*,							getCreator,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getOrigin,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_notifyOrigin,										,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getStateCount,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_dirtyState,										,()	);
#if OGRE_VERSION < 0x10700
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_fireBackgroundLoadingComplete,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_fireBackgroundPreparingComplete,					,()	);
#endif
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_fireLoadingComplete,								,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_firePreparingComplete,								,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_fireUnloadingComplete,								,()	);
		
		LUABIND_PrefixConstant(Ogre::Resource,LOADSTATE_UNLOADED)
		LUABIND_PrefixConstant(Ogre::Resource,LOADSTATE_LOADING)
		LUABIND_PrefixConstant(Ogre::Resource,LOADSTATE_LOADED)
		LUABIND_PrefixConstant(Ogre::Resource,LOADSTATE_UNLOADING)
		LUABIND_PrefixConstant(Ogre::Resource,LOADSTATE_PREPARED)
		LUABIND_PrefixConstant(Ogre::Resource,LOADSTATE_PREPARING)
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.Resource"; }
};

class cLugreLuaBind_Ogre_Node : public cLuaBindDirect<Ogre::Node>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE 
		LUABIND_DIRECTWRAP_BASECLASS(Ogre::Renderable);
		
		LUABIND_QUICKWRAP(	getRealAddress,		{ return PushPointer(L,checkudata_alive(L)); }); // for compare/hierarchy
		
		// unknown syntax:enum TransformSpace;
		// unknown syntax:typedef HashMap<String,Node* > ChildNodeMap;
		// unknown syntax:typedef MapIterator<ChildNodeMap> ChildNodeIterator;
		// unknown syntax:typedef ConstMapIterator<ChildNodeMap> ConstChildNodeIterator;
		// unknown syntax:class _OgreExport Listener;
		// unknown syntax:class DebugRenderable : public Renderable,public NodeAlloc;
		// unknown syntax:Node();
		// unknown syntax:Node(String name);
		// unknown syntax:~Node();
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(	PushString				,getName,					,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNode,										getParent,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(	PushQuaternion			,getOrientation,			,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setOrientation,										,(ParamQuaternion(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setOrientation,2									,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4),ParamNumber(L,5))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(							 resetOrientation,			,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setPosition,										,(ParamVector3(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setPosition,2										,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(	PushVector3				,getPosition,				,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setScale,											,(ParamVector3(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setScale,2											,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(	PushVector3				,getScale,					,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(							 setInheritOrientation,		,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(	PushBool				,getInheritOrientation,		,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(							 setInheritScale,			,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(	PushBool				,getInheritScale,			,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																scale,												,(ParamVector3(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																scale,2												,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																translate,											,(ParamVector3(L,2),ParamTransformSpace(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																translate,2											,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4),ParamTransformSpace(L,5))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															translate,3											,(ParamMatrix3(L,2),ParamVector3(L,3),ParamTransformSpace(L,4))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															translate,4											,(ParamMatrix3(L,2),ParamNumber(L,3),ParamNumber(L,4),ParamNumber(L,5),ParamTransformSpace(L,6))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(							 roll,						,(ParamRadian(L,2),ParamTransformSpace(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(							 pitch,						,(ParamRadian(L,2),ParamTransformSpace(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(							 yaw,						,(ParamRadian(L,2),ParamTransformSpace(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																rotate,												,(ParamVector3(L,2),ParamRadian(L,3),ParamTransformSpace(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																rotate,2											,(ParamQuaternion(L,2),ParamTransformSpace(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushMatrix3,									getLocalAxes,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNode,										createChild,										,(ParamVector3(L,2),ParamQuaternion(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNode,										createChild,2										,(ParamString(L,2),ParamVector3(L,3),ParamQuaternion(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																addChild,											,(ParamNode(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(	PushNumber				,numChildren,				,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNode,										getChild,											,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNode,										getChild,2											,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushChildNodeIterator,							getChildIterator,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushConstChildNodeIterator,						getChildIterator,2									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNode,										removeChild,										,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNode,										removeChild,2										,(ParamNode(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNode,										removeChild,3										,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(							 removeAllChildren,			,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_setDerivedPosition,								,(ParamVector3(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_setDerivedOrientation,								,(ParamQuaternion(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(	PushQuaternion			,_getDerivedOrientation,	,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(	PushVector3				,_getDerivedPosition,		,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(	PushVector3				,_getDerivedScale,			,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushMatrix4,									_getFullTransform,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(							 _update,					,(ParamBool(L,2),ParamBool(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setListener,										,(ParamListener*(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushListener*,									getListener,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(							 setInitialState,			,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(							 resetToInitialState,		,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(	PushVector3				,getInitialPosition,		,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushVector3,									convertWorldToLocalPosition,						,(ParamVector3(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushVector3,									convertLocalToWorldPosition,						,(ParamVector3(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushQuaternion,									convertWorldToLocalOrientation,						,(ParamQuaternion(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushQuaternion,									convertLocalToWorldOrientation,						,(ParamQuaternion(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(	PushQuaternion			,getInitialOrientation,		,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(	PushVector3				,getInitialScale,			,()	);
		// in parent: Real getSquaredViewDepth(Camera* cam);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																needUpdate,											,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																requestUpdate,										,(ParamNode(L,2),ParamBool(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																cancelUpdate,										,(ParamNode(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushDebugRenderable*,							getDebugRenderable,									,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																queueNeedUpdate,									,(ParamNode(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																processQueuedUpdates,								,()	);
		// in parent: void setUserAny(Any anything);
		// in parent: Any getUserAny(void);
		// in parent: UserObjectBindings getUserObjectBindings();
		// in parent: UserObjectBindings getUserObjectBindings();
		
		LUABIND_PrefixConstant(Ogre::Node,TS_LOCAL)
		LUABIND_PrefixConstant(Ogre::Node,TS_PARENT)
		LUABIND_PrefixConstant(Ogre::Node,TS_WORLD)
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.Node"; }
};

class cLugreLuaBind_Ogre_Light : public cLuaBindDirect<Ogre::Light>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE 
		LUABIND_DIRECTWRAP_BASECLASS(Ogre::MovableObject);
		
		// unknown syntax:Real tempSquareDist;
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_calcTempSquareDist,								,(ParamVector3(L,2))	);
		// unknown syntax:enum LightTypes;
		// unknown syntax:Light();
		// unknown syntax:Light(String name);
		// unknown syntax:~Light();
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setType,											,(ParamLightTypes(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,										getType,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setDiffuseColour,									,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setDiffuseColour,2									,(ParamColourValue(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushColourValue,								getDiffuseColour,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setSpecularColour,									,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setSpecularColour,2									,(ParamColourValue(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushColourValue,								getSpecularColour,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setAttenuation,										,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4),ParamNumber(L,5))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,										getAttenuationRange,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,										getAttenuationConstant,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,										getAttenuationLinear,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,										getAttenuationQuadric,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setPosition,										,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setPosition,2										,(ParamVector3(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVector3,									getPosition,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setDirection,										,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setDirection,2										,(ParamVector3(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVector3,									getDirection,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setSpotlightRange,									,(ParamRadian(L,2),ParamRadian(L,3),ParamNumber(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushRadian,										getSpotlightInnerAngle,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushRadian,										getSpotlightOuterAngle,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,										getSpotlightFalloff,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setSpotlightInnerAngle,								,(ParamRadian(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setSpotlightOuterAngle,								,(ParamRadian(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setSpotlightFalloff,								,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setPowerScale,										,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,										getPowerScale,										,()	);
		// in parent: void _notifyAttached(Node* parent,bool isTagPoint);
		// in parent: void _notifyMoved(void);
		// in parent: AxisAlignedBox getBoundingBox(void);
		// in parent: void _updateRenderQueue(RenderQueue* queue);
		// in parent: String getMovableType(void);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVector3,									getDerivedPosition,									,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVector3,									getDerivedDirection,								,()	);
		// in parent: void setVisible(bool visible);
		// in parent: Real getBoundingRadius(void);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVector4,									getAs4DVector,										,(ParamBool(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(		PushPlaneBoundedVolume,							_getNearClipVolume,									,(ParamCamera(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(		PushPlaneBoundedVolumeList,						_getFrustumClipVolumes,								,(ParamCamera(L,2))	);
		// in parent: uint32 getTypeFlags(void);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(		PushAnimableValuePtr,							createAnimableValue,								,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setCustomShadowCameraSetup,							,(ParamShadowCameraSetupPtr(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															resetCustomShadowCameraSetup,						,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(		PushShadowCameraSetupPtr,						getCustomShadowCameraSetup,							,()	);
		// in parent: void visitRenderables(Renderable::Visitor* visitor,bool debugRenderables);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,										_getIndexInFrame,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_notifyIndexInFrame,								,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setShadowFarDistance,								,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															resetShadowFarDistance,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,										getShadowFarDistance,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,										getShadowFarDistanceSquared,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setShadowNearClipDistance,							,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getShadowNearClipDistance,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										_deriveShadowNearClipDistance,						,(ParamCamera(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setShadowFarClipDistance,							,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getShadowFarClipDistance,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										_deriveShadowFarClipDistance,						,(ParamCamera(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_setCameraRelative,									,(ParamCamera(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setCustomParameter,									,(Paramuint16(L,2),ParamVector4(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVector4,									getCustomParameter,									,(Paramuint16(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_updateCustomGpuParameter,							,(Paramuint16(L,2),ParamGpuProgramParameters::AutoConstantEntry(L,3),ParamGpuProgramParameters*(L,4))	);
	
		LUABIND_PrefixConstant(Ogre::Light,LT_POINT)
		LUABIND_PrefixConstant(Ogre::Light,LT_DIRECTIONAL)
		LUABIND_PrefixConstant(Ogre::Light,LT_SPOTLIGHT)
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.Light"; }
};	
	
class cLugreLuaBind_Ogre_SceneManager : public cLuaBindDirect<Ogre::SceneManager>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE 
		LUABIND_QUICKWRAP_STATIC(GetSceneManager, { return CreateUData(L,cOgreWrapper::GetSingleton().GetSceneManager(ParamStringDefault(L,1,"main").c_str())); });

		// unknown syntax:uint32 WORLD_GEOMETRY_TYPE_MASK; 
		// unknown syntax:uint32 ENTITY_TYPE_MASK;
		// unknown syntax:uint32 FX_TYPE_MASK;
		// unknown syntax:uint32 STATICGEOMETRY_TYPE_MASK;
		// unknown syntax:uint32 LIGHT_TYPE_MASK;
		// unknown syntax:uint32 FRUSTUM_TYPE_MASK;
		// unknown syntax:uint32 USER_TYPE_MASK_LIMIT;
		// unknown syntax:struct materialLess;
		// unknown syntax:struct lightLess;
		// unknown syntax:enum IlluminationRenderStage;
		// unknown syntax:enum SpecialCaseRenderQueueMode;
		// unknown syntax:struct SkyDomeGenParameters;
		// unknown syntax:struct SkyPlaneGenParameters;
		// unknown syntax:struct SkyBoxGenParameters;
		// unknown syntax:class Listener;
		// unknown syntax:class _OgreExport SceneMgrQueuedRenderableVisitor : public QueuedRenderableVisitor;
		// unknown syntax:friend class SceneMgrQueuedRenderableVisitor;
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															prepareShadowTextures,								,(ParamCamera(L,2),ParamViewport(L,3),ParamLightList*(L,4))	);
		// unknown syntax:struct RenderContext;
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushRenderContext*,								_pauseRendering,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_resumeRendering,									,(ParamRenderContext*(L,2))	);
		// unknown syntax:SceneManager(String instanceName);
		// unknown syntax:~SceneManager();
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushString,									getName,												,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushString,									getTypeName,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushCamera,									createCamera,										,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushCamera,									getCamera,											,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									hasCamera,											,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														destroyCamera,										,(ParamCamera(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyCamera,2										,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														destroyAllCameras,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushLight,									createLight,											,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushLight,										createLight,2										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushLight,									getLight,											,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									hasLight,											,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushPlaneList,									getLightClippingPlanes,								,(ParamLight(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushRealRect,									getLightScissorRect,								,(ParamLight(L,2),ParamCamera(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyLight,										,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyLight,2										,(ParamLight(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														destroyAllLights,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														_notifyLightsDirty,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,									_getLightsDirtyCounter,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushLightList,									_getLightsAffectingFrustum,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_populateLightList,									,(ParamVector3(L,2),ParamNumber(L,3),ParamLightList(L,4),ParamInt(L,5))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_populateLightList,2								,(ParamSceneNode(L,2),ParamNumber(L,3),ParamLightList(L,4),ParamInt(L,5))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushSceneNode,									createSceneNode,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushSceneNode,									createSceneNode,2									,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroySceneNode,									,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroySceneNode,2									,(ParamSceneNode(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSceneNode,								getRootSceneNode,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSceneNode,								getSceneNode,										,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									hasSceneNode,										,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushEntity,										createEntity,										,(ParamString(L,2),ParamString(L,3),ParamString(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushEntity,										createEntity,2										,(ParamString(L,2))	);
		// unknown syntax:enum PrefabType;
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushEntity,										createEntity,3										,(ParamString(L,2),ParamPrefabType(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushEntity,										createEntity,4										,(ParamPrefabType(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushEntity,										getEntity,											,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									hasEntity,											,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyEntity,										,(ParamEntity(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyEntity,2										,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														destroyAllEntities,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushManualObject*,								createManualObject,									,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushManualObject*,								createManualObject,2								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushManualObject*,								getManualObject,									,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasManualObject,									,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															destroyManualObject,								,(ParamManualObject*(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyManualObject,2								,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyAllManualObjects,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBillboardChain*,							createBillboardChain,								,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBillboardChain*,							createBillboardChain,2								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBillboardChain*,							getBillboardChain,									,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasBillboardChain,									,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															destroyBillboardChain,								,(ParamBillboardChain*(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyBillboardChain,2								,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyAllBillboardChains,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushRibbonTrail*,								createRibbonTrail,									,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushRibbonTrail*,								createRibbonTrail,2									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushRibbonTrail*,								getRibbonTrail,										,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasRibbonTrail,										,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															destroyRibbonTrail,									,(ParamRibbonTrail*(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyRibbonTrail,2								,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyAllRibbonTrails,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushParticleSystem*,							createParticleSystem,								,(ParamString(L,2),ParamString(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushParticleSystem*,							createParticleSystem,2								,(ParamString(L,2),ParamInt(L,3),ParamString(L,4))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushParticleSystem*,							createParticleSystem,3								,(ParamInt(L,2),ParamString(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushParticleSystem*,							getParticleSystem,									,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasParticleSystem,									,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															destroyParticleSystem,								,(ParamParticleSystem*(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyParticleSystem,2								,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyAllParticleSystems,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														clearScene,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setAmbientLight,										,(ParamColourValue(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushColourValue,							getAmbientLight,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														prepareWorldGeometry,								,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															prepareWorldGeometry,2								,(ParamDataStreamPtr(L,2),ParamString(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setWorldGeometry,									,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setWorldGeometry,2									,(ParamDataStreamPtr(L,2),ParamString(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,										estimateWorldGeometry,								,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,										estimateWorldGeometry,2								,(ParamDataStreamPtr(L,2),ParamString(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushViewPoint,									getSuggestedViewpoint,								,(ParamBool(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,										setOption,											,(ParamString(L,2),Paramvoid*(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,										getOption,											,(ParamString(L,2),Paramvoid*(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									hasOption,											,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,										getOptionValues,									,(ParamString(L,2),ParamStringVector(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,										getOptionKeys,										,(ParamStringVector(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														_updateSceneGraph,									,(ParamCamera(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_findVisibleObjects,								,(ParamCamera(L,2),ParamVisibleObjectsBoundsInfo*(L,3),ParamBool(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														_applySceneAnimations,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														_renderVisibleObjects,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														_renderScene,										,(ParamCamera(L,2),ParamViewport(L,3),ParamBool(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														_queueSkiesForRendering,								,(ParamCamera(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_setDestinationRenderSystem,						,(ParamRenderSystem*(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setSkyPlane,										,(ParamBool(L,2),ParamPlane(L,3),ParamString(L,4),ParamNumber(L,5),ParamNumber(L,6),ParamBool(L,7),ParamNumber(L,8),ParamInt(L,9),ParamInt(L,10),ParamString(L,11))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_setSkyPlane,										,(ParamBool(L,2),ParamPlane(L,3),ParamString(L,4),ParamNumber(L,5),ParamNumber(L,6),ParamInt(L,7),ParamNumber(L,8),ParamInt(L,9),ParamInt(L,10),ParamString(L,11))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									isSkyPlaneEnabled,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSceneNode,								getSkyPlaneNode,										,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSkyPlaneGenParameters,						getSkyPlaneGenParameters,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setSkyBox,											,(ParamBool(L,2),ParamString(L,3),ParamNumber(L,4),ParamBool(L,5),ParamQuaternion(L,6),ParamString(L,7))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														_setSkyBox,											,(ParamBool(L,2),ParamString(L,3),ParamNumber(L,4),ParamInt(L,5),ParamQuaternion(L,6),ParamString(L,7))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									isSkyBoxEnabled,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSceneNode,								getSkyBoxNode,										,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSkyBoxGenParameters,						getSkyBoxGenParameters,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setSkyDome,											,(ParamBool(L,2),ParamString(L,3),ParamNumber(L,4),ParamNumber(L,5),ParamNumber(L,6),ParamBool(L,7),ParamQuaternion(L,8),ParamInt(L,9),ParamInt(L,10),ParamInt(L,11),ParamString(L,12))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														_setSkyDome,											,(ParamBool(L,2),ParamString(L,3),ParamNumber(L,4),ParamNumber(L,5),ParamNumber(L,6),ParamInt(L,7),ParamQuaternion(L,8),ParamInt(L,9),ParamInt(L,10),ParamInt(L,11),ParamString(L,12))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									isSkyDomeEnabled,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSceneNode,								getSkyDomeNode,										,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSkyDomeGenParameters,						getSkyDomeGenParameters,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setFog,												,(ParamFogMode(L,2),ParamColourValue(L,3),ParamNumber(L,4),ParamNumber(L,5),ParamNumber(L,6))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,									getFogMode,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushColourValue,							getFogColour,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,									getFogStart,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,									getFogEnd,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,									getFogDensity,										,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBillboardSet*,								createBillboardSet,									,(ParamString(L,2),ParamInt(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBillboardSet*,								createBillboardSet,2								,(ParamInt(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBillboardSet*,								getBillboardSet,									,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasBillboardSet,									,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															destroyBillboardSet,								,(ParamBillboardSet*(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyBillboardSet,2								,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyAllBillboardSets,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setDisplaySceneNodes,								,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									getDisplaySceneNodes,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushAnimation,									createAnimation,									,(ParamString(L,2),ParamNumber(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushAnimation,									getAnimation,										,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasAnimation,										,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyAnimation,									,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyAllAnimations,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushAnimationState,								createAnimationState,								,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushAnimationState,								getAnimationState,									,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasAnimationState,									,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyAnimationState,								,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyAllAnimationStates,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																manualRender,										,(ParamRenderOperation(L,2),ParamPass(L,3),ParamViewport(L,4),ParamMatrix4(L,5),ParamMatrix4(L,6),ParamMatrix4(L,7),ParamBool(L,8))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															manualRender,2										,(ParamRenderable(L,2),ParamPass(L,3),ParamViewport(L,4),ParamMatrix4(L,5),ParamMatrix4(L,6),ParamBool(L,7),ParamBool(L,8),ParamBool(L,9),ParamLightList*(L,10))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushRenderQueue,								getRenderQueue,										,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															addRenderQueueListener,								,(ParamRenderQueueListener*(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															removeRenderQueueListener,							,(ParamRenderQueueListener*(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															addRenderObjectListener,							,(ParamRenderObjectListener*(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															removeRenderObjectListener,							,(ParamRenderObjectListener*(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														addSpecialCaseRenderQueue,							,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														removeSpecialCaseRenderQueue,						,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														clearSpecialCaseRenderQueues,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setSpecialCaseRenderQueueMode,						,(ParamSpecialCaseRenderQueueMode(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,									getSpecialCaseRenderQueueMode,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									isRenderQueueToBeProcessed,							,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setWorldGeometryRenderQueue,							,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,									getWorldGeometryRenderQueue,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														showBoundingBoxes,									,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									getShowBoundingBoxes,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														_notifyAutotrackingSceneNode,						,(ParamSceneNode(L,2),ParamBool(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushAxisAlignedBoxSceneQuery*,					createAABBQuery,									,(ParamAxisAlignedBox(L,2),ParamInt(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSphereSceneQuery*,							createSphereQuery,									,(ParamSphere(L,2),ParamInt(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushPlaneBoundedVolumeListSceneQuery*,			createPlaneBoundedVolumeQuery,						,(ParamPlaneBoundedVolumeList(L,2),ParamInt(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushRaySceneQuery*,								createRayQuery,										,(ParamRay(L,2),ParamInt(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushIntersectionSceneQuery*,					createIntersectionQuery,							,(ParamInt(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															destroyQuery,										,(ParamSceneQuery*(L,2))	);
		// unknown syntax:typedef MapIterator<CameraList> CameraIterator;
		// unknown syntax:typedef MapIterator<AnimationList> AnimationIterator;
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushCameraIterator,								getCameraIterator,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushCameraList,									getCameras,											,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushAnimationIterator,							getAnimationIterator,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushAnimationList,								getAnimations,										,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushAnimationStateIterator,						getAnimationStateIterator,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setShadowTechnique,									,(ParamShadowTechnique(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,									getShadowTechnique,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setShowDebugShadows,									,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									getShowDebugShadows,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setShadowColour,										,(ParamColourValue(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushColourValue,							getShadowColour,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setShadowDirectionalLightExtrusionDistance,			,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,									getShadowDirectionalLightExtrusionDistance,			,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setShadowFarDistance,								,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,									getShadowFarDistance,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,									getShadowFarDistanceSquared,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setShadowIndexBufferSize,							,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,									getShadowIndexBufferSize,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setShadowTextureSize,								,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setShadowTextureConfig,								,(ParamInt(L,2),ParamInt(L,3),ParamInt(L,4),ParamPixelFormat(L,5))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setShadowTextureConfig,2							,(ParamInt(L,2),ParamShadowTextureConfig(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushConstShadowTextureConfigIterator,			getShadowTextureConfigIterator,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setShadowTexturePixelFormat,							,(ParamPixelFormat(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setShadowTextureCount,								,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,									getShadowTextureCount,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setShadowTextureCountPerLightType,					,(ParamLightTypes(L,2),ParamInt(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,									getShadowTextureCountPerLightType,					,(ParamLightTypes(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setShadowTextureSettings,							,(ParamInt(L,2),ParamInt(L,3),ParamPixelFormat(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushTexturePtr,								getShadowTexture,									,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setShadowDirLightTextureOffset,						,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,									getShadowDirLightTextureOffset,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setShadowTextureFadeStart,							,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setShadowTextureFadeEnd,								,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setShadowTextureSelfShadow,							,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									getShadowTextureSelfShadow,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setShadowTextureCasterMaterial,						,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setShadowTextureReceiverMaterial,					,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setShadowCasterRenderBackFaces,						,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									getShadowCasterRenderBackFaces,						,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setShadowCameraSetup,								,(ParamShadowCameraSetupPtr(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushShadowCameraSetupPtr,						getShadowCameraSetup,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setShadowUseInfiniteFarPlane,						,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									isShadowTechniqueStencilBased,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									isShadowTechniqueTextureBased,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									isShadowTechniqueModulative,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									isShadowTechniqueAdditive,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									isShadowTechniqueIntegrated,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									isShadowTechniqueInUse,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setShadowUseLightClipPlanes,							,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									getShadowUseLightClipPlanes,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_setActiveCompositorChain,							,(ParamCompositorChain*(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setLateMaterialResolving,							,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isLateMaterialResolving,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushCompositorChain*,							_getActiveCompositorChain,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															addListener,										,(ParamListener*(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															removeListener,										,(ParamListener*(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushStaticGeometry*,							createStaticGeometry,								,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushStaticGeometry*,							getStaticGeometry,									,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasStaticGeometry,									,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															destroyStaticGeometry,								,(ParamStaticGeometry*(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyStaticGeometry,2								,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyAllStaticGeometry,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushInstancedGeometry*,							createInstancedGeometry,							,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushInstancedGeometry*,							getInstancedGeometry,								,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															destroyInstancedGeometry,							,(ParamInstancedGeometry*(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyInstancedGeometry,2							,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyAllInstancedGeometry,						,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushMovableObject,								createMovableObject,								,(ParamString(L,2),ParamString(L,3),ParamNameValuePairList*(L,4))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushMovableObject,								createMovableObject,2								,(ParamString(L,2),ParamNameValuePairList*(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														destroyMovableObject,								,(ParamString(L,2),ParamString(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyMovableObject,2								,(ParamMovableObject(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														destroyAllMovableObjectsByType,						,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														destroyAllMovableObjects,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushMovableObject,							getMovableObject,									,(ParamString(L,2),ParamString(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									hasMovableObject,									,(ParamString(L,2),ParamString(L,3))	);
		// unknown syntax:typedef MapIterator<MovableObjectMap> MovableObjectIterator;
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushMovableObjectIterator,						getMovableObjectIterator,							,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														injectMovableObject,									,(ParamMovableObject(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														extractMovableObject,								,(ParamString(L,2),ParamString(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																extractMovableObject,2								,(ParamMovableObject(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														extractAllMovableObjectsByType,						,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setVisibilityMask,									,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,									getVisibilityMask,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,									_getCombinedVisibilityMask,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setFindVisibleObjects,								,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									getFindVisibleObjects,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setNormaliseNormalsOnScale,							,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									getNormaliseNormalsOnScale,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setFlipCullingOnNegativeScale,						,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									getFlipCullingOnNegativeScale,						,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_injectRenderWithPass,								,(ParamPass(L,2),ParamRenderable(L,3),ParamBool(L,4),ParamBool(L,5),ParamLightList*(L,6))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														_suppressRenderStateChanges,							,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									_areRenderStateChangesSuppressed,					,()	);
		// CONST RETURN LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushPass,										_setPass,											,(ParamPass(L,2),ParamBool(L,3),ParamBool(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														_suppressShadows,									,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									_areShadowsSuppressed,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_renderQueueGroupObjects,							,(ParamRenderQueueGroup*(L,2),ParamQueuedRenderableCollection::OrganisationMode(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setQueuedRenderableVisitor,							,(ParamSceneMgrQueuedRenderableVisitor*(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSceneMgrQueuedRenderableVisitor*,			getQueuedRenderableVisitor,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushRenderSystem*,								getDestinationRenderSystem,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushViewport,									getCurrentViewport,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVisibleObjectsBoundsInfo,					getVisibleObjectsBoundsInfo,						,(ParamCamera(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVisibleObjectsBoundsInfo,					getShadowCasterBoundsInfo,							,(ParamLight(L,2),ParamInt(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(														setCameraRelativeRendering,							,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,									getCameraRelativeRendering,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															addLodListener,										,(ParamLodListener*(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															removeLodListener,									,(ParamLodListener*(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_notifyMovableObjectLodChanged,						,(ParamMovableObjectLodChangedEvent(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_notifyEntityMeshLodChanged,						,(ParamEntityMeshLodChangedEvent(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_notifyEntityMaterialLodChanged,					,(ParamEntityMaterialLodChangedEvent(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_handleLodEvents,									,()	);
		
		LUABIND_PrefixConstant(Ogre::SceneManager,SCRQM_INCLUDE)
		LUABIND_PrefixConstant(Ogre::SceneManager,SCRQM_EXCLUDE)
		LUABIND_PrefixConstant(Ogre::SceneManager,PT_PLANE)
		LUABIND_PrefixConstant(Ogre::SceneManager,PT_CUBE)
		LUABIND_PrefixConstant(Ogre::SceneManager,PT_SPHERE)
		LUABIND_PrefixConstant(Ogre::SceneManager,IRS_NONE)
		LUABIND_PrefixConstant(Ogre::SceneManager,IRS_RENDER_TO_TEXTURE)
		LUABIND_PrefixConstant(Ogre::SceneManager,IRS_RENDER_RECEIVER_PASS)
		
		// PROTECTED! LUABIND_PrefixConstant(Ogre::SceneManager,BP_FRONT)
		// PROTECTED! LUABIND_PrefixConstant(Ogre::SceneManager,BP_BACK)
		// PROTECTED! LUABIND_PrefixConstant(Ogre::SceneManager,BP_LEFT)
		// PROTECTED! LUABIND_PrefixConstant(Ogre::SceneManager,BP_RIGHT)
		// PROTECTED! LUABIND_PrefixConstant(Ogre::SceneManager,BP_UP)
		// PROTECTED! LUABIND_PrefixConstant(Ogre::SceneManager,BP_DOWN)
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.SceneManager"; }
};	
	
class cLugreLuaBind_Ogre_Frustum : public cLuaBindDirect<Ogre::Frustum>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE 
		LUABIND_QUICKWRAP(CastToMovable,		{ return PushMovableObject(L,&GetSelf(L)); });
		LUABIND_QUICKWRAP(CastToRenderable,		{ return PushRenderable(L,&GetSelf(L)); });
		
		// unknown syntax:Frustum();
		// unknown syntax:~Frustum();
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(										setFOVy,									,(ParamRadian(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushRadian,					getFOVy,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(										setNearClipDistance,						,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,					getNearClipDistance,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(										setFarClipDistance,						,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,					getFarClipDistance,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(										setAspectRatio,							,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,					getAspectRatio,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(										setFrustumOffset,						,(ParamVector2(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setFrustumOffset,2									,(ParamNumber(L,2),ParamNumber(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVector2,				getFrustumOffset,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(										setFocalLength,							,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,					getFocalLength,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(										setFrustumExtents,						,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4),ParamNumber(L,5))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(										resetFrustumExtents,						,()	);
		//~ BYREF! LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																getFrustumExtents,									,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4),ParamNumber(L,5))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushMatrix4,									getProjectionMatrixRS,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushMatrix4,									getProjectionMatrixWithRSDepth,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushMatrix4,									getProjectionMatrix,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushMatrix4,									getViewMatrix,										,()	);
		//~ BYREF! LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																calcViewMatrixRelative,								,(ParamVector3(L,2),ParamMatrix4(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setCustomViewMatrix,								,(ParamBool(L,2),ParamMatrix4(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,					isCustomViewMatrixEnabled,				,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setCustomProjectionMatrix,							,(ParamBool(L,2),ParamMatrix4(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,					isCustomProjectionMatrixEnabled,			,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushPlane*,										getFrustumPlanes,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushPlane,										getFrustumPlane,									,(ParamInt(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,										isVisible,											,(ParamAxisAlignedBox(L,2),ParamFrustumPlane*(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,										isVisible,2											,(ParamSphere(L,2),ParamFrustumPlane*(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,										isVisible,3											,(ParamVector3(L,2),ParamFrustumPlane*(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,					getTypeFlags,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushAxisAlignedBox,			getBoundingBox,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,					getBoundingRadius,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_updateRenderQueue,									,(ParamRenderQueue(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushString,					getMovableType,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(										_notifyCurrentCamera,					,(ParamCamera(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushMaterialPtr,								getMaterial,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																getRenderOperation,									,(ParamByRefRenderOperation(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															getWorldTransforms,									,(ParamMatrix4*(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,					getSquaredViewDepth,						,(ParamCamera(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushLightList,									getLights,											,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVector3*,									getWorldSpaceCorners,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(										setProjectionType,						,(ParamProjectionType(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,					getProjectionType,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(										setOrthoWindow,							,(ParamNumber(L,2),ParamNumber(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(										setOrthoWindowHeight,					,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(										setOrthoWindowWidth,						,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,					getOrthoWindowHeight,					,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,					getOrthoWindowWidth,						,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															enableReflection,									,(ParamPlane(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															enableReflection,2									,(ParamMovablePlane*(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(										disableReflection,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,					isReflected,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushMatrix4,									getReflectionMatrix,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushPlane,										getReflectionPlane,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,										projectSphere,										,(ParamSphere(L,2),ParamReal*(L,3),ParamReal*(L,4),ParamReal*(L,5),ParamReal*(L,6))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															enableCustomNearClipPlane,							,(ParamMovablePlane*(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															enableCustomNearClipPlane,2							,(ParamPlane(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(										disableCustomNearClipPlane,				,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,					isCustomNearClipPlaneEnabled,			,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															visitRenderables,									,(ParamRenderable::Visitor*(L,2),ParamBool(L,3))	);
		// unknown syntax:Real INFINITE_FAR_PLANE_ADJUST;
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVector3,				getPositionForViewUpdate,				,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushQuaternion,				getOrientationForViewUpdate,				,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushPlaneBoundedVolume,							getPlaneBoundedVolume,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setOrientationMode,									,(ParamOrientationMode(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushOrientationMode,							getOrientationMode,									,()	);
		
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.Frustum"; }
};

class cLugreLuaBind_Ogre_Camera : public cLuaBindDirect<Ogre::Camera>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE 
		LUABIND_DIRECTWRAP_BASECLASS(Ogre::Frustum);
		
		// unknown syntax:class _OgreExport Listener;
		// unknown syntax:Camera(String name,SceneManager* sm);
		// unknown syntax:~Camera();
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															addListener,										,(ParamListener*(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															removeListener,										,(ParamListener*(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSceneManager,						getSceneManager,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushString,								getName,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													setPolygonMode,						,(ParamPolygonMode(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,								getPolygonMode,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													setPosition,							,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setPosition,2										,(ParamVector3(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVector3,							getPosition,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													move,								,(ParamVector3(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													moveRelative,						,(ParamVector3(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													setDirection,						,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setDirection,2										,(ParamVector3(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVector3,							getDirection,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVector3,							getUp,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVector3,							getRight,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																lookAt,												,(ParamVector3(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																lookAt,2											,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													roll,								,(ParamRadian(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													yaw,									,(ParamRadian(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													pitch,								,(ParamRadian(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																rotate,												,(ParamVector3(L,2),ParamRadian(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																rotate,2											,(ParamQuaternion(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													setFixedYawAxis,						,(ParamBool(L,2),ParamVector3(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushQuaternion,							getOrientation,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													setOrientation,						,(ParamQuaternion(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													_renderScene,						,(ParamViewport(L,2),ParamBool(L,3))	);
		//~ OPERATOR! LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			_OgreExport friend std::ostream,		operator<<,							,(std::ostream,Camera)	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													_notifyRenderedFaces,				,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													_notifyRenderedBatches,				,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,								_getNumRenderedFaces,				,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,								_getNumRenderedBatches,				,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushQuaternion,							getDerivedOrientation,				,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVector3,							getDerivedPosition,					,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVector3,							getDerivedDirection,					,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVector3,							getDerivedUp,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVector3,							getDerivedRight,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushQuaternion,							getRealOrientation,					,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVector3,							getRealPosition,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVector3,							getRealDirection,					,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVector3,							getRealUp,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVector3,							getRealRight,						,()	);
		// in parent: String getMovableType(void);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													setAutoTracking,						,(ParamBool(L,2),ParamSceneNode(L,3),ParamVector3(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													setLodBias,							,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,								getLodBias,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													setLodCamera,						,(ParamCamera(L,2))	);
		//~ CONST RETURN! LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushCamera,								getLodCamera,						,()	); // const return...
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushRay,										getCameraToViewportRay,								,(ParamNumber(L,2),ParamNumber(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															getCameraToViewportRay,2							,(ParamNumber(L,2),ParamNumber(L,3),ParamRay*(L,4))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushPlaneBoundedVolume,							getCameraToViewportBoxVolume,						,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4),ParamNumber(L,5),ParamBool(L,6))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															getCameraToViewportBoxVolume,2						,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4),ParamNumber(L,5),ParamPlaneBoundedVolume*(L,6),ParamBool(L,7))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,								_getLodBiasInverse,					,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													_autoTrack,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													setWindow,							,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4),ParamNumber(L,5))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													resetWindow,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,								isWindowSet,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			Pushvector<Plane>::type,						getWindowPlanes,									,()	);
		// in parent: Real getBoundingRadius(void);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSceneNode,							getAutoTrackTarget,					,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVector3,							getAutoTrackOffset,					,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushViewport,							getViewport,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													_notifyViewport,						,(ParamViewport(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													setAutoAspectRatio,					,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,								getAutoAspectRatio,					,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setCullingFrustum,									,(ParamFrustum(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushFrustum,									getCullingFrustum,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															forwardIntersect,									,(ParamPlane(L,2),Paramvector<Vector4>::type*(L,3))	);
		// in parent: bool isVisible(AxisAlignedBox bound,FrustumPlane* culledBy);
		// in parent: bool isVisible(Sphere bound,FrustumPlane* culledBy);
		// in parent: bool isVisible(Vector3 vert,FrustumPlane* culledBy);
		// in parent: Vector3* getWorldSpaceCorners(void);
		// in parent: Plane getFrustumPlane(short plane);
		// in parent: bool projectSphere(Sphere sphere,Real* left,Real* top,Real* right,Real* bottom);
		// in parent: Real getNearClipDistance(void);
		// in parent: Real getFarClipDistance(void);
		// in parent: Matrix4 getViewMatrix(void);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushMatrix4,									getViewMatrix,										,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													setUseRenderingDistance,				,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,								getUseRenderingDistance,				,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(													synchroniseBaseSettingsWith,			,(ParamCamera(L,2))	);
		// in parent: Vector3 getPositionForViewUpdate(void);
		// in parent: Quaternion getOrientationForViewUpdate(void);
		
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.Camera"; }
};

class cLugreLuaBind_Ogre_SceneNode : public cLuaBindDirect<Ogre::SceneNode>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE 
		LUABIND_DIRECTWRAP_BASECLASS(Ogre::Node);
		
		LUABIND_DIRECTWRAP_BASECLASS(Ogre::Renderable);
		
		// unknown syntax:typedef HashMap<String,MovableObject* > ObjectMap;
		// unknown syntax:typedef MapIterator<ObjectMap> ObjectIterator;
		// unknown syntax:typedef ConstMapIterator<ObjectMap> ConstObjectIterator;
		// unknown syntax:SceneNode(SceneManager* creator);
		// unknown syntax:SceneNode(SceneManager* creator,String name);
		// unknown syntax:~SceneNode();
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(									attachObject,						,(ParamMovableObject(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,				numAttachedObjects,					,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushMovableObject,		getAttachedObject,					,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushMovableObject,		getAttachedObject,2					,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushMovableObject,		detachObject,						,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(									detachObject,2						,(ParamMovableObject(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushMovableObject,		detachObject,3						,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(									detachAllObjects,					,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,				isInSceneGraph,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(									_notifyRootNode,						,()	);
		// in parent: void _update(bool updateChildren,bool parentHasChanged);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(									_updateBounds,						,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_findVisibleObjects,								,(ParamCamera(L,2),ParamRenderQueue(L,3),ParamVisibleObjectsBoundsInfo*(L,4),ParamBool(L,5),ParamBool(L,6),ParamBool(L,7))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushAxisAlignedBox,		_getWorldAABB,						,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushObjectIterator,								getAttachedObjectIterator,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushConstObjectIterator,						getAttachedObjectIterator,2							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushSceneManager,								getCreator,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(									removeAndDestroyChild,				,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(									removeAndDestroyChild,2				,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(									removeAndDestroyAllChildren,			,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(									showBoundingBox,						,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																hideBoundingBox,									,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_addBoundingBoxToQueue,								,(ParamRenderQueue(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,				getShowBoundingBox,					,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSceneNode,			createChildSceneNode,				,(ParamVector3(L,2),ParamQuaternion(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSceneNode,			createChildSceneNode,2				,(ParamString(L,2),ParamVector3(L,3),ParamQuaternion(L,4))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															findLights,											,(ParamLightList(L,2),ParamNumber(L,3),ParamInt(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(									setFixedYawAxis,						,(ParamBool(L,2),ParamVector3(L,3))	);
		// in parent: void yaw(Radian angle,TransformSpace relativeTo);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(									setDirection,						,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4),ParamTransformSpace(L,5),ParamVector3(L,6))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setDirection,2										,(ParamVector3(L,2),ParamTransformSpace(L,3),ParamVector3(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(									lookAt,								,(ParamVector3(L,2),ParamTransformSpace(L,3),ParamVector3(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(									setAutoTracking,						,(ParamBool(L,2),ParamSceneNode(L,3),ParamVector3(L,4),ParamVector3(L,5))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSceneNode,			getAutoTrackTarget,					,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVector3,			getAutoTrackOffset,					,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVector3,			getAutoTrackLocalDirection,			,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(									_autoTrack,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSceneNode,			getParentSceneNode,					,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(									setVisible,							,(ParamBool(L,2),ParamBool(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(									flipVisibility,						,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(									setDebugDisplayEnabled,				,(ParamBool(L,2),ParamBool(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushDebugRenderable*,							getDebugRenderable,									,()	);
		
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.SceneNode"; }
};

class cLugreLuaBind_Ogre_VertexData : public cLuaBindDirect<Ogre::VertexData>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE

		LUABIND_QUICKWRAP_STATIC(	CreateVertexData,	{ return CreateUData(L,new Ogre::VertexData()); });
		LUABIND_QUICKWRAP(	Destroy,			{ delete checkudata_alive(L); });
		
		LUABIND_QUICKWRAP(	setVertexStart,		{ GetSelf(L).vertexStart = ParamInt(L,2); });
		LUABIND_QUICKWRAP(	setVertexCount,		{ GetSelf(L).vertexCount = ParamInt(L,2); });
		
		LUABIND_QUICKWRAP(	getVertexStart,		{ return PushNumber(L,GetSelf(L).vertexStart); });
		LUABIND_QUICKWRAP(	getVertexCount,		{ return PushNumber(L,GetSelf(L).vertexCount); });
		
		LUABIND_QUICKWRAP(	getVertexDecl,		{ return cLuaBindDirect<Ogre::VertexDeclaration>::CreateUData(L,GetSelf(L).vertexDeclaration); });
		LUABIND_QUICKWRAP(	setVertexDecl,		{ 
				Ogre::VertexData& vd = GetSelf(L);
				Ogre::VertexDeclaration* oldDcl = vd.vertexDeclaration;
				vd.vertexDeclaration = cLuaBindDirect<Ogre::VertexDeclaration>::checkudata_alive(L,2);
				if (oldDcl) Ogre::HardwareBufferManager::getSingleton().destroyVertexDeclaration(oldDcl); // free old
			});
		
		// void				createAndBindVertexBuffer	(iVertexSize,iNumVerts,iUsage,bUseShadowBuffer=false,iBindIndex=0)
		LUABIND_QUICKWRAP(	createAndBindVertexBuffer, {
			Ogre::HardwareVertexBufferSharedPtr vbuf = Ogre::HardwareBufferManager::getSingleton().createVertexBuffer(
					ParamInt(L,2),
					ParamInt(L,3),
					(Ogre::HardwareBuffer::Usage)ParamInt(L,4),
					ParamBoolDefault(L,5,false)
					);
			GetSelf(L).vertexBufferBinding->setBinding(ParamIntDefault(L,6,0),vbuf);
		});
		
		
		
		// void				writeToVertexBuffer	(fifo,iBindIndex=0)
		LUABIND_QUICKWRAP(	writeToVertexBuffer, {
			Ogre::VertexData& vd = GetSelf(L);
			HardwareVertexBufferSharedPtr vbuf = vd.vertexBufferBinding->getBuffer(ParamIntDefault(L,3,0));
			if (vbuf.isNull()) return 0;
			cFIFO& fifo = *cLuaBind<cFIFO>::checkudata_alive(L,2);
			if (1) { // size check
				int a = fifo.size();
				int b = vd.vertexCount * vbuf->getVertexSize();
				if (a != b) return luaL_error(L,"writeToVertexBuffer size mismatch fifo:%d <> calc:%d\n",a,b);
			}
			//~ writeData (size_t offset, size_t length, const void *pSource, bool discardWholeBuffer=false)=0
			vbuf->writeData(0,fifo.size(),fifo.HackGetRawReader(),true);
		});
		
		// void				writeToVertexBufferPart	(fifo,iVBufOffset,iWriteSize=full,iBindIndex=0)		updates only a part of a vertexbuffer
		LUABIND_QUICKWRAP(	writeToVertexBufferPart, {
			Ogre::VertexData& vd = GetSelf(L);
			HardwareVertexBufferSharedPtr vbuf = vd.vertexBufferBinding->getBuffer(ParamIntDefault(L,5,0));
			if (vbuf.isNull()) return 0;
			cFIFO& fifo = *cLuaBind<cFIFO>::checkudata_alive(L,2);
			int iVBufOffset = ParamInt(L,3);
			int iFifoSize = fifo.size();
			int iWriteSize = mymin(iFifoSize,mymax(0,ParamIntDefault(L,4,iFifoSize)));
			if (iVBufOffset + iWriteSize > vbuf->getSizeInBytes()) return luaL_error(L,"writeToVertexBufferPart overflow %d+%d > bufsize=%d\n",iVBufOffset,iWriteSize,(int)vbuf->getSizeInBytes()); // size check
			//~ writeData (size_t offset, size_t length, const void *pSource, bool discardWholeBuffer=false)=0
			vbuf->writeData(iVBufOffset,iWriteSize,fifo.HackGetRawReader(),false);
		});
		
			
		// unknown syntax:VertexData(HardwareBufferManagerBase* mgr);
		// unknown syntax:VertexData(VertexDeclaration* dcl,VertexBufferBinding* bind);
		// unknown syntax:~VertexData();
		// unknown syntax:VertexDeclaration* vertexDeclaration;
		// unknown syntax:VertexBufferBinding* vertexBufferBinding;
		// unknown syntax:bool mDeleteDclBinding;
		// unknown syntax:size_t vertexStart;
		// unknown syntax:size_t vertexCount;
		// unknown syntax:struct HardwareAnimationData;
		// unknown syntax:typedef vector<HardwareAnimationData>::type HardwareAnimationDataList;
		// unknown syntax:HardwareAnimationDataList hwAnimationDataList;
		// unknown syntax:size_t hwAnimDataItemsUsed;
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushVertexData,									clone,												,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																prepareForShadowVolume,								,()	);
		// unknown syntax:HardwareVertexBufferSharedPtr hardwareShadowVolWBuffer;
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															reorganiseBuffers,									,(ParamVertexDeclaration(L,2),ParamBufferUsageList(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																reorganiseBuffers,2									,(ParamVertexDeclaration(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																closeGapsInBindings,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																removeUnusedBuffers,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															convertPackedColour,								,(ParamVertexElementType(L,2),ParamVertexElementType(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																allocateHardwareAnimationElements,					,(ParamInt(L,2))	);
		
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.VertexData"; }
};

class cLugreLuaBind_Ogre_IndexData : public cLuaBindDirect<Ogre::IndexData>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE
		
		LUABIND_QUICKWRAP_STATIC(	CreateIndexData,	{ return CreateUData(L,new Ogre::IndexData()); });
		LUABIND_QUICKWRAP(	Destroy,			{ delete checkudata_alive(L); });
		
		LUABIND_QUICKWRAP(	setIndexStart,		{ GetSelf(L).indexStart = ParamInt(L,2); });
		LUABIND_QUICKWRAP(	setIndexCount,		{ GetSelf(L).indexCount = ParamInt(L,2); });
		
		LUABIND_QUICKWRAP(	getIndexStart,		{ return PushNumber(L,GetSelf(L).indexStart); });
		LUABIND_QUICKWRAP(	getIndexCount,		{ return PushNumber(L,GetSelf(L).indexCount); });
		
		// void				createAndBindIndexBuffer	(iIndexType,iNumIndexes,iUsage,bUseShadowBuffer=false)
		LUABIND_QUICKWRAP(	createAndBindIndexBuffer, {
			GetSelf(L).indexBuffer =
				Ogre::HardwareBufferManager::getSingleton().createIndexBuffer(
					(Ogre::HardwareIndexBuffer::IndexType)ParamInt(L,2),
					ParamInt(L,3),
					(Ogre::HardwareBuffer::Usage)ParamInt(L,4),
					ParamBoolDefault(L,5,false)
				);
		});
		
		// void				writeToIndexBuffer	(fifo)
		LUABIND_QUICKWRAP(	writeToIndexBuffer, {
			Ogre::IndexData& id = GetSelf(L);
			cFIFO& fifo = *cLuaBind<cFIFO>::checkudata_alive(L,2);
			if (1) { // size check
				int a = fifo.size();
				int b = id.indexCount * id.indexBuffer->getIndexSize();
				if (a != b) return luaL_error(L,"writeToIndexBuffer size mismatch fifo:%d <> calc:%d\n",a,b);
			}
			id.indexBuffer->writeData(0,fifo.size(),fifo.HackGetRawReader(),true);
		});
		
		
		// void				writeToIndexBufferPart	(fifo,iVBufOffset,iWriteSize=full)		updates only a part of a vertexbuffer
		LUABIND_QUICKWRAP(	writeToIndexBufferPart, {
			Ogre::IndexData& id = GetSelf(L);
			cFIFO& fifo = *cLuaBind<cFIFO>::checkudata_alive(L,2);
			int iVBufOffset = ParamInt(L,3);
			int iFifoSize = fifo.size();
			int iWriteSize = mymin(iFifoSize,mymax(0,ParamIntDefault(L,4,iFifoSize)));
			if (iVBufOffset + iWriteSize > id.indexBuffer->getSizeInBytes()) return luaL_error(L,"writeToIndexBufferPart overflow %d+%d > bufsize=%d\n",iVBufOffset,iWriteSize,(int)id.indexBuffer->getSizeInBytes()); // size check
			//~ writeData (size_t offset, size_t length, const void *pSource, bool discardWholeBuffer=false)=0
			id.indexBuffer->writeData(iVBufOffset,iWriteSize,fifo.HackGetRawReader(),false);
		});
		
		// unknown syntax:IndexData();
		// unknown syntax:~IndexData();
		// unknown syntax:HardwareIndexBufferSharedPtr indexBuffer;
		// unknown syntax:size_t indexStart;
		// unknown syntax:size_t indexCount;
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushIndexData,									clone,												,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																optimiseVertexCacheTriList,							,()	);
		
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.IndexData"; }
};

class cLugreLuaBind_Ogre_Skeleton : public cLuaBindDirect<Ogre::Skeleton>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE
		LUABIND_DIRECTWRAP_BASECLASS(Ogre::Resource);

		/// skeleton 	SkeletonManager_load	(sName)
		LUABIND_QUICKWRAP_STATIC(SkeletonManager_load, { 
				try {
					Ogre::SkeletonPtr pSkeleton = Ogre::SkeletonManager::getSingleton().load(ParamString(L,1),ParamStringDefault(L,2,Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME));
					return CreateUData(L,pSkeleton.getPointer()); 
				} catch (Ogre::Exception& e) { return 0; }
			});
			
		/// skeleton 	SkeletonManager_create	(sName)
		LUABIND_QUICKWRAP_STATIC(SkeletonManager_create, { 
				try {
					Ogre::SkeletonPtr pSkeleton = Ogre::SkeletonManager::getSingleton().create(ParamString(L,1),ParamStringDefault(L,2,Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME),true);
					return CreateUData(L,pSkeleton.getPointer()); 
				} catch (Ogre::Exception& e) { return 0; }
			});
			
		
		// returns 0 if not found. (getBone would throw an exception or so)
		LUABIND_QUICKWRAP(	SearchBoneByName,	{ 
			return PushBone(L,cOgreWrapper::SearchBoneByName(GetSelf(L),ParamString(L,2).c_str()));
		});
		
		// unknown syntax:Skeleton(ResourceManager* creator,String name,ResourceHandle handle,String group,bool isManual,ManualResourceLoader* loader);
		// unknown syntax:~Skeleton();
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBone,										createBone,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBone,										createBone,2										,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBone,										createBone,3										,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBone,										createBone,4										,(ParamString(L,2),ParamInt(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getNumBones,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBone,										getRootBone,										,()	);
		// unknown syntax:typedef vector<Bone* >::type BoneList;
		// unknown syntax:typedef VectorIterator<BoneList> BoneIterator;
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBoneIterator,								getRootBoneIterator,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBoneIterator,								getBoneIterator,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBone,										getBone,											,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBone,										getBone,2											,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasBone,											,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setBindingPose,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																reset,												,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushAnimation,									createAnimation,									,(ParamString(L,2),ParamNumber(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushAnimation,									getAnimation,										,(ParamString(L,2),ParamLinkedSkeletonAnimationSource**(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushAnimation,									_getAnimationImpl,									,(ParamString(L,2),ParamLinkedSkeletonAnimationSource**(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasAnimation,										,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																removeAnimation,									,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setAnimationState,									,(ParamAnimationStateSet(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_initAnimationState,								,(ParamAnimationStateSet*(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_refreshAnimationState,								,(ParamAnimationStateSet*(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_getBoneMatrices,									,(ParamMatrix4*(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getNumAnimations,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushAnimation,									getAnimation,2										,(ParamInt(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSkeletonAnimationBlendMode,					getBlendMode,										,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setBlendMode,										,(ParamSkeletonAnimationBlendMode(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_updateTransforms,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																optimiseAllAnimations,								,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																addLinkedSkeletonAnimationSource,					,(ParamString(L,2),ParamNumber(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																removeAllLinkedSkeletonAnimationSources,			,()	);
		// unknown syntax:typedef vector<LinkedSkeletonAnimationSource>::type LinkedSkeletonAnimSourceList;
		// unknown syntax:typedef ConstVectorIterator<LinkedSkeletonAnimSourceList> LinkedSkeletonAnimSourceIterator;
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushLinkedSkeletonAnimSourceIterator,			getLinkedSkeletonAnimationSourceIterator,			,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_notifyManualBonesDirty,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_notifyManualBoneStateChange,						,(ParamBone(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getManualBonesDirty,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasManualBones,										,()	);
		// unknown syntax:typedef std::vector<ushort> BoneHandleMap;
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_mergeSkeletonAnimations,							,(ParamSkeleton(L,2),ParamBoneHandleMap(L,3),ParamStringVector(L,4))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_buildMapBoneByHandle,								,(ParamSkeleton(L,2),ParamBoneHandleMap(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_buildMapBoneByName,								,(ParamSkeleton(L,2),ParamBoneHandleMap(L,3))	);
		
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.Skeleton"; }
};

class cLugreLuaBind_Ogre_Bone : public cLuaBindDirect<Ogre::Bone>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE
		LUABIND_DIRECTWRAP_BASECLASS(Ogre::Node);
		
		LUABIND_DIRECTWRAP_BASECLASS(Ogre::Renderable);
		
		// unknown syntax:Bone(short handle,Skeleton* creator);
		// unknown syntax:Bone(String name,short handle,Skeleton* creator);
		// unknown syntax:~Bone();
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBone,										createChild,										,(ParamInt(L,2),ParamVector3(L,3),ParamQuaternion(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getHandle,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setBindingPose,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																reset,												,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setManuallyControlled,								,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isManuallyControlled,								,()	);
		//~ BYREF! LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_getOffsetTransform,								,(ParamMatrix4(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushVector3,									_getBindingPoseInverseScale,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushVector3,									_getBindingPoseInversePosition,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushQuaternion,									_getBindingPoseInverseOrientation,					,()	);
		// in parent: void needUpdate(bool forceParentUpdate);
		
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.Bone"; }
};

class cLugreLuaBind_Ogre_Animation : public cLuaBindDirect<Ogre::Animation>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE
		// unknown syntax:enum InterpolationMode;
		// unknown syntax:enum RotationInterpolationMode;
		// unknown syntax:Animation(String name,Real length);
		// unknown syntax:~Animation();
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getName,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getLength,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setLength,											,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNodeAnimationTrack,							createNodeTrack,									,(ParamInt(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumericAnimationTrack*,						createNumericTrack,									,(ParamInt(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVertexAnimationTrack*,						createVertexTrack,									,(ParamInt(L,2),ParamVertexAnimationType(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNodeAnimationTrack,							createNodeTrack,2									,(ParamInt(L,2),ParamNode(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumericAnimationTrack*,						createNumericTrack,2								,(ParamInt(L,2),ParamAnimableValuePtr(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVertexAnimationTrack*,						createVertexTrack,2									,(ParamInt(L,2),ParamVertexData(L,3),ParamVertexAnimationType(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getNumNodeTracks,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNodeAnimationTrack,							getNodeTrack,										,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasNodeTrack,										,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getNumNumericTracks,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumericAnimationTrack*,						getNumericTrack,									,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasNumericTrack,									,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getNumVertexTracks,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVertexAnimationTrack*,						getVertexTrack,										,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasVertexTrack,										,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyNodeTrack,									,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyNumericTrack,								,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyVertexTrack,									,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyAllTracks,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyAllNodeTracks,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyAllNumericTracks,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyAllVertexTracks,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																apply,												,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																applyToNode,										,(ParamNode(L,2),ParamNumber(L,3),ParamNumber(L,4),ParamNumber(L,5))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																apply,2												,(ParamSkeleton(L,2),ParamNumber(L,3),ParamNumber(L,4),ParamNumber(L,5))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															apply,3												,(ParamSkeleton(L,2),ParamNumber(L,3),ParamNumber(L,4),ParamAnimationState::BoneBlendMask*(L,5),ParamNumber(L,6))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																apply,4												,(ParamEntity(L,2),ParamNumber(L,3),ParamNumber(L,4),ParamBool(L,5),ParamBool(L,6))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															applyToAnimable,									,(ParamAnimableValuePtr(L,2),ParamNumber(L,3),ParamNumber(L,4),ParamNumber(L,5))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																applyToVertexData,									,(ParamVertexData(L,2),ParamNumber(L,3),ParamNumber(L,4))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setInterpolationMode,								,(ParamInterpolationMode(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushInterpolationMode,							getInterpolationMode,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setRotationInterpolationMode,						,(ParamRotationInterpolationMode(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushRotationInterpolationMode,					getRotationInterpolationMode,						,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setDefaultInterpolationMode,						,(ParamInterpolationMode(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushInterpolationMode,							getDefaultInterpolationMode,						,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setDefaultRotationInterpolationMode,				,(ParamRotationInterpolationMode(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushRotationInterpolationMode,					getDefaultRotationInterpolationMode,				,()	);
		// unknown syntax:typedef map< short,NodeAnimationTrack* >::type NodeTrackList;
		// unknown syntax:typedef ConstMapIterator<NodeTrackList> NodeTrackIterator;
		// unknown syntax:typedef map< short,NumericAnimationTrack* >::type NumericTrackList;
		// unknown syntax:typedef ConstMapIterator<NumericTrackList> NumericTrackIterator;
		// unknown syntax:typedef map< short,VertexAnimationTrack* >::type VertexTrackList;
		// unknown syntax:typedef ConstMapIterator<VertexTrackList> VertexTrackIterator;
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNodeTrackList,								_getNodeTrackList,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNodeTrackIterator,							getNodeTrackIterator,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumericTrackList,							_getNumericTrackList,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumericTrackIterator,						getNumericTrackIterator,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVertexTrackList,							_getVertexTrackList,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVertexTrackIterator,						getVertexTrackIterator,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																optimise,											,(ParamBool(L,2))	);
		// unknown syntax:typedef set<ushort>::type TrackHandleList;
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_collectIdentityNodeTracks,							,(ParamTrackHandleList(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_destroyNodeTracks,									,(ParamTrackHandleList(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushAnimation,									clone,												,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_keyFrameListChanged,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushTimeIndex,									_getTimeIndex,										,(ParamNumber(L,2))	);
		
		LUABIND_PrefixConstant(Ogre::Animation,IM_LINEAR)
		LUABIND_PrefixConstant(Ogre::Animation,IM_SPLINE)
		LUABIND_PrefixConstant(Ogre::Animation,RIM_LINEAR)
		LUABIND_PrefixConstant(Ogre::Animation,RIM_SPHERICAL)
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.Animation"; }
};

class cLugreLuaBind_Ogre_Mesh : public cLuaBindDirect<Ogre::Mesh>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE
		LUABIND_DIRECTWRAP_BASECLASS(Ogre::Resource);

		/// mesh 		MeshManager_load		(sName)
		LUABIND_QUICKWRAP_STATIC(MeshManager_load,			{ return CreateUData(L,Ogre::MeshManager::getSingleton().load(ParamString(L,1),Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME).getPointer() ); });
		/// mesh 		MeshManager_createManual	(sName)
		LUABIND_QUICKWRAP_STATIC(MeshManager_createManual,	{ return CreateUData(L,Ogre::MeshManager::getSingleton().createManual(ParamString(L,1),ParamStringDefault(L,2,Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME)).getPointer() ); });
		
		// see Mesh::addBoneAssignment for shared, and SubMesh::addBoneAssignment() for specific
		LUABIND_QUICKWRAP(	addBoneAssignment,	{ 
				Ogre::VertexBoneAssignment o;
				o.vertexIndex	= ParamInt(L,2); // unsigned int 	
				o.boneIndex		= ParamInt(L,3); // unsigned short 	
				o.weight		= ParamNumber(L,4); // Real
				GetSelf(L).addBoneAssignment(o); 
				return 0;
		});
		
		// returns {{key,vertexIndex,boneIndex,weight},...}
		LUABIND_QUICKWRAP(	enumBoneAssignment,	{ 
			//~ const Ogre::Mesh::VertexBoneAssignmentList& list = GetSelf(L).getBoneAssignments(); // std::multimap<size_t, VertexBoneAssignment>
			int i=1;
			lua_newtable(L);
			//~ for (Ogre::Mesh::VertexBoneAssignmentList::const_iterator itor=list.begin();itor!=list.end();++itor) { size_t first = itor->first; Ogre::VertexBoneAssignment second = itor->second;
			Ogre::Mesh::BoneAssignmentIterator itor = GetSelf(L).getBoneAssignmentIterator(); while (itor.hasMoreElements()) { size_t first = itor.peekNextKey(); Ogre::VertexBoneAssignment second = itor.peekNextValue(); itor.moveNext(); 
				lua_newtable(L);
					//~ printf("luabind.ogre.mesh.enumBoneAssignment %d %d %d %f\n",(int)first,(int)second.vertexIndex,(int)second.boneIndex,(float)second.weight);
					PushNumber(L,first);				lua_rawseti( L, -2, 1 ); // ??? = vertexIndex ?
					PushNumber(L,second.vertexIndex);	lua_rawseti( L, -2, 2 );
					PushNumber(L,second.boneIndex);		lua_rawseti( L, -2, 3 );
					PushNumber(L,second.weight);		lua_rawseti( L, -2, 4 );
				lua_rawseti( L, -2, i ); ++i;
			}
			return 1;
		});
		
		// unknown syntax:typedef vector<Real>::type LodValueList;
		// unknown syntax:typedef vector<MeshLodUsage>::type MeshLodUsageList;
		// unknown syntax:typedef multimap<size_t,VertexBoneAssignment>::type VertexBoneAssignmentList;
		// unknown syntax:typedef MapIterator<VertexBoneAssignmentList> BoneAssignmentIterator;
		// unknown syntax:typedef vector<SubMesh* >::type SubMeshList;
		// unknown syntax:typedef vector< short>::type IndexMap;
		// unknown syntax:typedef HashMap<String,ushort> SubMeshNameMap;
		// unknown syntax:Mesh(ResourceManager* creator,String name,ResourceHandle handle,String group,bool isManual,ManualResourceLoader* loader);
		// unknown syntax:~Mesh();
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushSubMesh,									createSubMesh,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushSubMesh,									createSubMesh,2										,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																nameSubMesh,										,(ParamString(L,2),ParamInt(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																unnameSubMesh,										,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										_getSubMeshIndex,									,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getNumSubMeshes,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushSubMesh,									getSubMesh,											,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushSubMesh,									getSubMesh,2										,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroySubMesh,										,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroySubMesh,2									,(ParamString(L,2))	);
		// unknown syntax:typedef VectorIterator<SubMeshList> SubMeshIterator;
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSubMeshIterator,							getSubMeshIterator,									,()	);
		// unknown syntax:VertexData* sharedVertexData;
		// unknown syntax:IndexMap sharedBlendIndexToBoneIndexMap;
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushMeshPtr,									clone,												,(ParamString(L,2),ParamString(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushAxisAlignedBox,								getBounds,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getBoundingSphereRadius,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_setBounds,											,(ParamAxisAlignedBox(L,2),ParamBool(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_setBoundingSphereRadius,							,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setSkeletonName,									,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasSkeleton,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasVertexAnimation,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushSkeletonPtr,								getSkeleton,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getSkeletonName,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_initAnimationState,								,(ParamAnimationStateSet*(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_refreshAnimationState,								,(ParamAnimationStateSet*(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															addBoneAssignment,									,(ParamVertexBoneAssignment(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																clearBoneAssignments,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_notifySkeleton,									,(ParamSkeletonPtr(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBoneAssignmentIterator,						getBoneAssignmentIterator,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVertexBoneAssignmentList,					getBoneAssignments,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															generateLodLevels,									,(ParamLodValueList(L,2),ParamProgressiveMesh::VertexReductionQuota(L,3),ParamNumber(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getNumLodLevels,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushMeshLodUsage,								getLodLevel,										,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																createManualLodLevel,								,(ParamNumber(L,2),ParamString(L,3),ParamString(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																updateManualLodLevel,								,(ParamInt(L,2),ParamString(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getLodIndex,										,(ParamNumber(L,2))	);
#if OGRE_VERSION < 0x10700
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getLodIndexSquaredDepth,							,(ParamNumber(L,2))	);
#endif
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isLodManual,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_setLodInfo,										,(ParamInt(L,2),ParamBool(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_setLodUsage,										,(ParamInt(L,2),ParamMeshLodUsage(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_setSubMeshLodFaceList,								,(ParamInt(L,2),ParamInt(L,3),ParamIndexData(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																removeLodLevels,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setVertexBufferPolicy,								,(ParamHardwareBuffer::Usage(L,2),ParamBool(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setIndexBufferPolicy,								,(ParamHardwareBuffer::Usage(L,2),ParamBool(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushHardwareBuffer::Usage,						getVertexBufferUsage,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushHardwareBuffer::Usage,						getIndexBufferUsage,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isVertexBufferShadowed,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isIndexBufferShadowed,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,										_rationaliseBoneAssignments,						,(ParamInt(L,2),ParamVertexBoneAssignmentList(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_compileBoneAssignments,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_updateCompiledBoneAssignments,						,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															buildTangentVectors,								,(ParamVertexElementSemantic(L,2),ParamInt(L,3),ParamInt(L,4),ParamBool(L,5),ParamBool(L,6),ParamBool(L,7))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,										suggestTangentVectorBuildParams,					,(ParamVertexElementSemantic(L,2),ParamInt(L,3),ParamInt(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																buildEdgeList,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																freeEdgeList,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																prepareForShadowVolume,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushEdgeData*,									getEdgeList,										,(ParamInt(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushEdgeData*,									getEdgeList,2										,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isPreparedForShadowVolumes,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isEdgeListBuilt,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															prepareMatricesForVertexBlend,						,(ParamMatrix4**(L,2),ParamMatrix4*(L,3),ParamIndexMap(L,4))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															softwareVertexBlend,								,(ParamVertexData(L,2),ParamVertexData(L,3),ParamMatrix4**(L,4),ParamInt(L,5),ParamBool(L,6))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															softwareVertexMorph,								,(ParamNumber(L,2),ParamHardwareVertexBufferSharedPtr(L,3),ParamHardwareVertexBufferSharedPtr(L,4),ParamVertexData(L,5))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															softwareVertexPoseBlend,							,(ParamNumber(L,2),Parammap<size_t(L,3),ParamVector3>::type(L,4),ParamVertexData(L,5))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSubMeshNameMap,								getSubMeshNameMap,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setAutoBuildEdgeLists,								,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getAutoBuildEdgeLists,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVertexAnimationType,						getSharedVertexDataAnimationType,					,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushAnimation,									createAnimation,									,(ParamString(L,2),ParamNumber(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushAnimation,									getAnimation,										,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushAnimation,									_getAnimationImpl,									,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasAnimation,										,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																removeAnimation,									,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getNumAnimations,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushAnimation,									getAnimation,2										,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																removeAllAnimations,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushVertexData,									getVertexDataByTrackHandle,							,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																updateMaterialForAllSubMeshes,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_determineAnimationTypes,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										_getAnimationTypesDirty,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushPose*,										createPose,											,(ParamInt(L,2),ParamString(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getPoseCount,										,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushPose*,										getPose,											,(ParamInt(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushPose*,										getPose,2											,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																removePose,											,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																removePose,2										,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																removeAllPoses,										,()	);
		// unknown syntax:typedef VectorIterator<PoseList> PoseIterator;
		// unknown syntax:typedef ConstVectorIterator<PoseList> ConstPoseIterator;
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushPoseIterator,								getPoseIterator,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushConstPoseIterator,							getPoseIterator,2									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushPoseList,									getPoseList,										,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushLodStrategy*,								getLodStrategy,										,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setLodStrategy,										,(ParamLodStrategy*(L,2))	);
		
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.Mesh"; }
};

class cLugreLuaBind_Ogre_SubMesh : public cLuaBindDirect<Ogre::SubMesh>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE
		LUABIND_QUICKWRAP(	getVertexData,	{ return cLuaBindDirect<Ogre::VertexData>::CreateUData(L,GetSelf(L).vertexData); });
		LUABIND_QUICKWRAP(	getIndexData,	{ return cLuaBindDirect<Ogre::IndexData>::CreateUData(L,GetSelf(L).indexData); });
		LUABIND_QUICKWRAP(	setVertexData,	{ if (GetSelf(L).vertexData) delete GetSelf(L).vertexData; GetSelf(L).vertexData = ParamVertexData(L,2); });
		LUABIND_QUICKWRAP(	setIndexData,	{ if (GetSelf(L).indexData) delete GetSelf(L).indexData; GetSelf(L).indexData = ParamIndexData(L,2); });
		
		LUABIND_QUICKWRAP(setUseSharedVertices,		{ GetSelf(L).useSharedVertices = ParamBool(L,2); });
		LUABIND_QUICKWRAP(getUseSharedVertices,		{ return PushBool(L,GetSelf(L).useSharedVertices); });
		
		LUABIND_QUICKWRAP(	setOperationType,	{ GetSelf(L).operationType = (Ogre::RenderOperation::OperationType)ParamInt(L,2); });
		LUABIND_QUICKWRAP(	getOperationType,	{ return PushNumber(L,GetSelf(L).operationType); });
		
		// see Mesh::addBoneAssignment for shared, and SubMesh::addBoneAssignment() for specific
		LUABIND_QUICKWRAP(	addBoneAssignment,	{ 
				Ogre::VertexBoneAssignment o;
				o.vertexIndex	= ParamInt(L,2); // unsigned int 	
				o.boneIndex		= ParamInt(L,3); // unsigned short 	
				o.weight		= ParamNumber(L,4); // Real
				GetSelf(L).addBoneAssignment(o); 
				return 0;
		});
		
		// returns {{key,vertexIndex,boneIndex,weight},...}
		LUABIND_QUICKWRAP(	enumBoneAssignment,	{ 
			//~ const Ogre::SubMesh::VertexBoneAssignmentList& list = GetSelf(L).getBoneAssignments(); // std::multimap<size_t, VertexBoneAssignment>
			int i=1;
			lua_newtable(L);
			//~ for (Ogre::SubMesh::VertexBoneAssignmentList::const_iterator itor=list.begin();itor!=list.end();++itor) { size_t first = itor->first; Ogre::VertexBoneAssignment second = itor->second;
			Ogre::SubMesh::BoneAssignmentIterator itor = GetSelf(L).getBoneAssignmentIterator(); while (itor.hasMoreElements()) { size_t first = itor.peekNextKey(); Ogre::VertexBoneAssignment second = itor.peekNextValue(); itor.moveNext(); 
				lua_newtable(L);
					//~ printf("luabind.ogre.submesh.enumBoneAssignment %d %d %d %f\n",(int)first,(int)second.vertexIndex,(int)second.boneIndex,(float)second.weight);
					PushNumber(L,first);				lua_rawseti( L, -2, 1 ); // ??? = vertexIndex ?
					PushNumber(L,second.vertexIndex);	lua_rawseti( L, -2, 2 );
					PushNumber(L,second.boneIndex);		lua_rawseti( L, -2, 3 );
					PushNumber(L,second.weight);		lua_rawseti( L, -2, 4 );
				lua_rawseti( L, -2, i ); ++i;
			}
			return 1;
		});
		
		// unknown syntax:SubMesh();
		// unknown syntax:~SubMesh();
		// unknown syntax:bool useSharedVertices;
		// unknown syntax:RenderOperation::OperationType operationType;
		// unknown syntax:VertexData* vertexData;
		// unknown syntax:IndexData* indexData;
		// unknown syntax:typedef vector< short>::type IndexMap;
		// unknown syntax:IndexMap blendIndexToBoneIndexMap;
		// unknown syntax:ProgressiveMesh::LODFaceList mLodFaceList;
		// unknown syntax:vector<Vector3>::type extremityPoints;
		// unknown syntax:Mesh* parent;
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setMaterialName,									,(ParamString(L,2),ParamStringDefault(L,3,Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getMaterialName,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isMatInitialised,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_getRenderOperation,								,(ParamByRefRenderOperation(L,2),ParamInt(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															addBoneAssignment,									,(ParamVertexBoneAssignment(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																clearBoneAssignments,								,()	);
		// unknown syntax:typedef multimap<size_t,VertexBoneAssignment>::type VertexBoneAssignmentList;
		// unknown syntax:typedef MapIterator<VertexBoneAssignmentList> BoneAssignmentIterator;
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBoneAssignmentIterator,						getBoneAssignmentIterator,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVertexBoneAssignmentList,					getBoneAssignments,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_compileBoneAssignments,							,()	);
		// unknown syntax:typedef ConstMapIterator<AliasTextureNamePairList> AliasTextureIterator;
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushAliasTextureIterator,						getAliasTextureIterator,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																addTextureAlias,									,(ParamString(L,2),ParamString(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																removeTextureAlias,									,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																removeAllTextureAliases,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasTextureAliases,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getTextureAliasCount,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										updateMaterialUsingTextureAliases,					,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVertexAnimationType,						getVertexAnimationType,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																generateExtremes,									,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isBuildEdgesEnabled,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setBuildEdgesEnabled,								,(ParamBool(L,2))	);
		
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.SubMesh"; }
};

class cLugreLuaBind_Ogre_SubEntity : public cLuaBindDirect<Ogre::SubEntity>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE
		LUABIND_DIRECTWRAP_BASECLASS(Ogre::Renderable);
		
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getMaterialName,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setMaterialName,									,(ParamString(L,2),ParamStringDefault(L,3,Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setMaterial,										,(ParamMaterialPtr(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setVisible,											,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isVisible,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushSubMesh,									getSubMesh,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushEntity,										getParent,											,()	);
		// in parent: MaterialPtr getMaterial(void);
		// in parent: Technique* getTechnique(void);
		// in parent: void getRenderOperation(RenderOperation op);
		// in parent: void getWorldTransforms(Matrix4* xform);
		// in parent: short getNumWorldTransforms(void);
		// in parent: Real getSquaredViewDepth(Camera* cam);
		// in parent: LightList getLights(void);
		// in parent: bool getCastsShadows(void);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushVertexData,									_getSkelAnimVertexData,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushVertexData,									_getSoftwareVertexAnimVertexData,					,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushVertexData,									_getHardwareVertexAnimVertexData,					,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushTempBlendedBufferInfo*,						_getSkelAnimTempBufferInfo,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushTempBlendedBufferInfo*,						_getVertexAnimTempBufferInfo,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushVertexData,									getVertexDataForBinding,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_markBuffersUnusedForAnimation,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_markBuffersUsedForAnimation,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										_getBuffersMarkedForAnimation,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_restoreBuffersForUnusedAnimation,					,(ParamBool(L,2))	);
		// in parent: void _updateCustomGpuParameter(GpuProgramParameters::AutoConstantEntry antEntry,GpuProgramParameters* params);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_invalidateCameraCache,								,()	);
		
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.SubEntity"; }
};

class cLugreLuaBind_Ogre_Entity : public cLuaBindDirect<Ogre::Entity>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE
		LUABIND_DIRECTWRAP_BASECLASS(Ogre::MovableObject);
		
		// unknown syntax:typedef set<Entity* >::type EntitySet;
		// unknown syntax:typedef map<String,MovableObject* >::type ChildObjectList;
		// unknown syntax:~Entity();
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushMeshPtr,									getMesh,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushSubEntity,									getSubEntity,										,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushSubEntity,									getSubEntity,2										,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getNumSubEntities,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushEntity,										clone,												,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setMaterialName,									,(ParamString(L,2),ParamStringDefault(L,3,Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setMaterial,										,(ParamMaterialPtr(L,2))	);
		// in parent: void _notifyCurrentCamera(Camera* cam);
		// in parent: void setRenderQueueGroup(uint8 queueID);
		// in parent: void setRenderQueueGroupAndPriority(uint8 queueID,ushort priority);
		// in parent: AxisAlignedBox getBoundingBox(void);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushAxisAlignedBox,								getChildObjectsBoundingBox,							,()	);
		// in parent: void _updateRenderQueue(RenderQueue* queue);
		// in parent: String getMovableType(void);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushAnimationState,								getAnimationState,									,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushAnimationStateSet*,							getAllAnimationStates,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setDisplaySkeleton,									,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getDisplaySkeleton,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushEntity,										getManualLodLevel,									,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getNumManualLodLevels,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getCurrentLodIndex,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setMeshLodBias,										,(ParamNumber(L,2),ParamInt(L,3),ParamInt(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setMaterialLodBias,									,(ParamNumber(L,2),ParamInt(L,3),ParamInt(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setPolygonModeOverrideable,							,(ParamBool(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushTagPoint*,									attachObjectToBone,									,(ParamString(L,2),ParamMovableObject(L,3),ParamQuaternion(L,4),ParamVector3(L,5))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushMovableObject,								detachObjectFromBone,								,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																detachObjectFromBone,2								,(ParamMovableObject(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																detachAllObjectsFromBone,							,()	);
		// unknown syntax:typedef MapIterator<ChildObjectList> ChildObjectListIterator;
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushChildObjectListIterator,					getAttachedObjectIterator,							,()	);
		// in parent: Real getBoundingRadius(void);
		// in parent: AxisAlignedBox getWorldBoundingBox(bool derive);
		// in parent: Sphere getWorldBoundingSphere(bool derive);
		// in parent: EdgeData* getEdgeList(void);
		// in parent: bool hasEdgeList(void);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushShadowRenderableListIterator,				getShadowVolumeRenderableIterator,					,(ParamShadowTechnique(L,2),ParamLight(L,3),ParamHardwareIndexBufferSharedPtr*(L,4),ParamBool(L,5),ParamNumber(L,6),ParamInt(L,7))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushMatrix4*,									_getBoneMatrices,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										_getNumBoneMatrices,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasSkeleton,										,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSkeletonInstance*,							getSkeleton,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isHardwareAnimationEnabled,							,()	);
		// in parent: void _notifyAttached(Node* parent,bool isTagPoint);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getSoftwareAnimationRequests,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getSoftwareAnimationNormalsRequests,				,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																addSoftwareAnimationRequest,						,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																removeSoftwareAnimationRequest,						,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																shareSkeletonInstanceWith,							,(ParamEntity(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasVertexAnimation,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																stopSharingSkeletonInstance,						,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			Pushinline bool,								sharesSkeletonInstance,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			Pushinline EntitySet*,							getSkeletonInstanceSharingSet,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																refreshAvailableAnimationState,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_updateAnimation,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										_isAnimated,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										_isSkeletonAnimated,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushVertexData,									_getSkelAnimVertexData,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushVertexData,									_getSoftwareVertexAnimVertexData,					,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushVertexData,									_getHardwareVertexAnimVertexData,					,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushTempBlendedBufferInfo*,						_getSkelAnimTempBufferInfo,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushTempBlendedBufferInfo*,						_getVertexAnimTempBufferInfo,						,()	);
		// in parent: uint32 getTypeFlags(void);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushVertexData,									getVertexDataForBinding,							,()	);
		// unknown syntax:enum VertexDataBindChoice;
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushVertexDataBindChoice,						chooseVertexDataForBinding,							,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										_getBuffersMarkedForAnimation,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_markBuffersUsedForAnimation,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isInitialised,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_initialise,										,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_deinitialise,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																backgroundLoadingComplete,							,(ParamResource(L,2))	);
		// in parent: void visitRenderables(Renderable::Visitor* visitor,bool debugRenderables);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										_getMeshLodFactorTransformed,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setSkipAnimationStateUpdate,						,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getSkipAnimationStateUpdate,						,()	);
		
		LUABIND_PrefixConstant(Ogre::Entity,BIND_ORIGINAL)
		LUABIND_PrefixConstant(Ogre::Entity,BIND_SOFTWARE_SKELETAL)
		LUABIND_PrefixConstant(Ogre::Entity,BIND_SOFTWARE_MORPH)
		LUABIND_PrefixConstant(Ogre::Entity,BIND_HARDWARE_MORPH)
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.Entity"; }
};

class cLugreLuaBind_Ogre_AnimationTrack : public cLuaBindDirect<Ogre::AnimationTrack>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE
		// unknown syntax:class _OgreExport Listener;
		// unknown syntax:AnimationTrack(Animation* parent,short handle);
		// unknown syntax:~AnimationTrack();
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getHandle,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getNumKeyFrames,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushKeyFrame,									getKeyFrame,										,(ParamInt(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,										getKeyFramesAtTime,									,(ParamTimeIndex(L,2),ParamKeyFrame**(L,3),ParamKeyFrame**(L,4),Paramshort*(L,5))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushKeyFrame,									createKeyFrame,										,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																removeKeyFrame,										,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																removeAllKeyFrames,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															getInterpolatedKeyFrame,							,(ParamTimeIndex(L,2),ParamKeyFrame(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															apply,												,(ParamTimeIndex(L,2),ParamNumber(L,3),ParamNumber(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_keyFrameDataChanged,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasNonZeroKeyFrames,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																optimise,											,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_collectKeyFrameTimes,								,(Paramvector<Real>::type(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_buildKeyFrameIndexMap,								,(Paramvector<Real>::type(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setListener,										,(ParamListener*(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushAnimation,									getParent,											,()	);
		
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.AnimationTrack"; }
};

class cLugreLuaBind_Ogre_NodeAnimationTrack : public cLuaBindDirect<Ogre::NodeAnimationTrack>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE
		LUABIND_DIRECTWRAP_BASECLASS(Ogre::AnimationTrack);
		
		// unknown syntax:NodeAnimationTrack(Animation* parent,short handle);
		// unknown syntax:NodeAnimationTrack(Animation* parent,short handle,Node* targetNode);
		// unknown syntax:~NodeAnimationTrack();
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushTransformKeyFrame,							createNodeKeyFrame,									,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNode,										getAssociatedNode,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setAssociatedNode,									,(ParamNode(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															applyToNode,										,(ParamNode(L,2),ParamTimeIndex(L,3),ParamNumber(L,4),ParamNumber(L,5))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setUseShortestRotationPath,							,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getUseShortestRotationPath,							,()	);
		// in parent: void getInterpolatedKeyFrame(TimeIndex timeIndex,KeyFrame* kf);
		// in parent: void apply(TimeIndex timeIndex,Real weight,Real scale);
		// in parent: void _keyFrameDataChanged(void);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushTransformKeyFrame,							getNodeKeyFrame,									,(ParamInt(L,2))	);
		// in parent: bool hasNonZeroKeyFrames(void);
		// in parent: void optimise(void);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNodeAnimationTrack,							_clone,												,(ParamAnimation(L,2))	);
		
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.NodeAnimationTrack"; }
};

class cLugreLuaBind_Ogre_AnimationState : public cLuaBindDirect<Ogre::AnimationState>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE
		// unknown syntax:typedef vector<float>::type BoneBlendMask;
		// unknown syntax:AnimationState(String animName,AnimationStateSet* parent,Real timePos,Real length,Real weight,bool enabled);
		// unknown syntax:AnimationState(AnimationStateSet* parent,AnimationState rhs);
		// unknown syntax:~AnimationState();
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getAnimationName,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getTimePosition,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setTimePosition,									,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getLength,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setLength,											,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getWeight,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setWeight,											,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																addTime,											,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasEnded,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getEnabled,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setEnabled,											,(ParamBool(L,2))	);
		// unknown syntax:bool operator);
		// unknown syntax:bool operator!);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setLoop,											,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getLoop,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																copyStateFrom,										,(ParamByRefAnimationState(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushAnimationStateSet*,							getParent,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																createBlendMask,									,(ParamInt(L,2),ParamNumber(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																destroyBlendMask,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_setBlendMaskData,									,(Paramfloat*(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_setBlendMask,										,(ParamBoneBlendMask*(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBoneBlendMask*,								getBlendMask,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasBlendMask,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setBlendMaskEntry,									,(ParamInt(L,2),ParamNumber(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			Pushinline float,								getBlendMaskEntry,									,(ParamInt(L,2))	);
		
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.AnimationState"; }
};

class cLugreLuaBind_Ogre_KeyFrame : public cLuaBindDirect<Ogre::KeyFrame>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE
		// unknown syntax:KeyFrame(AnimationTrack* parent,Real time);
		// unknown syntax:~KeyFrame();
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getTime,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushKeyFrame,									_clone,												,(ParamAnimationTrack(L,2))	);
		
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.KeyFrame"; }
};

class cLugreLuaBind_Ogre_NumericKeyFrame : public cLuaBindDirect<Ogre::NumericKeyFrame>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE
		LUABIND_DIRECTWRAP_BASECLASS(Ogre::KeyFrame);
		
		// unknown syntax:NumericKeyFrame(AnimationTrack* parent,Real time);
		// unknown syntax:~NumericKeyFrame();
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushAnyNumeric,									getValue,											,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setValue,											,(ParamAnyNumeric(L,2))	);
		// in parent: KeyFrame* _clone(AnimationTrack* newParent);
		
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.NumericKeyFrame"; }
};

class cLugreLuaBind_Ogre_TransformKeyFrame : public cLuaBindDirect<Ogre::TransformKeyFrame>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE
		LUABIND_DIRECTWRAP_BASECLASS(Ogre::KeyFrame);
		
		// unknown syntax:TransformKeyFrame(AnimationTrack* parent,Real time);
		// unknown syntax:~TransformKeyFrame();
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setTranslate,										,(ParamVector3(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushVector3,									getTranslate,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setScale,											,(ParamVector3(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushVector3,									getScale,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setRotation,										,(ParamQuaternion(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushQuaternion,									getRotation,										,()	);
		// in parent: KeyFrame* _clone(AnimationTrack* newParent);
		
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.TransformKeyFrame"; }
};

class cLugreLuaBind_Ogre_VertexMorphKeyFrame : public cLuaBindDirect<Ogre::VertexMorphKeyFrame>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE
		LUABIND_DIRECTWRAP_BASECLASS(Ogre::KeyFrame);
		
		// unknown syntax:VertexMorphKeyFrame(AnimationTrack* parent,Real time);
		// unknown syntax:~VertexMorphKeyFrame();
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setVertexBuffer,									,(ParamHardwareVertexBufferSharedPtr(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushHardwareVertexBufferSharedPtr,				getVertexBuffer,									,()	);
		// in parent: KeyFrame* _clone(AnimationTrack* newParent);
		
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.VertexMorphKeyFrame"; }
};

class cLugreLuaBind_Ogre_VertexPoseKeyFrame : public cLuaBindDirect<Ogre::VertexPoseKeyFrame>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE
		LUABIND_DIRECTWRAP_BASECLASS(Ogre::KeyFrame);
		
		// unknown syntax:VertexPoseKeyFrame(AnimationTrack* parent,Real time);
		// unknown syntax:~VertexPoseKeyFrame();
		// unknown syntax:struct PoseRef;
		// unknown syntax:typedef vector<PoseRef>::type PoseRefList;
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																addPoseReference,									,(ParamInt(L,2),ParamNumber(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																updatePoseReference,								,(ParamInt(L,2),ParamNumber(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																removePoseReference,								,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																removeAllPoseReferences,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushPoseRefList,								getPoseReferences,									,()	);
		// unknown syntax:typedef VectorIterator<PoseRefList> PoseRefIterator;
		// unknown syntax:typedef ConstVectorIterator<PoseRefList> ConstPoseRefIterator;
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushPoseRefIterator,							getPoseReferenceIterator,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushConstPoseRefIterator,						getPoseReferenceIterator,2							,()	);
		// in parent: KeyFrame* _clone(AnimationTrack* newParent);
		
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.VertexPoseKeyFrame"; }
};

int				LugreImage_CreateFromOgreImage	(lua_State *L,Ogre::Image* pImg);
bool			MySubImage						(Ogre::Image& pImageSrc,Ogre::Image& pImageDst,int iOffsetX,int iOffsetY,int iNewWidth,int iNewHeight);

class cLugreLuaBind_Ogre_Image : public cLuaBindDirect<Ogre::Image>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE
		
		// adding try/catch to load to avoid segfault in case texture not found etc (.dds error)
		LUABIND_QUICKWRAP(load,	{ 
				try {
					Ogre::Image* o = checkudata_alive(L);
					Ogre::Image& res = o->load(ParamString(L,2),ParamStringDefault(L,3,Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME));
					PushCopyImage(L,res);
					return 1;
				}
				catch (std::exception& e) { PushBool(L,false); PushString(L,e.what()); return 2; }
				catch (...) { PushBool(L,false); PushString(L,"Ogre_Image:Load: unknown error"); return 2; }
			});
		
		LUABIND_QUICKWRAP_STATIC(	CreateOgreImage,	{ return CreateUData(L,new Ogre::Image()); });
		LUABIND_QUICKWRAP(			Destroy,			{ delete checkudata_alive(L); });
		LUABIND_QUICKWRAP(			ColorReplace,		{ cOgreWrapper::ImageColorReplace(*checkudata_alive(L),ParamColourValue(L,2),ParamColourValue(L,3)); });
		LUABIND_QUICKWRAP(			ColorKeyToAlpha,	{ cOgreWrapper::ImageColorKeyToAlpha(*checkudata_alive(L),ParamColourValue(L,2)); });
		
		LUABIND_QUICKWRAP(	ToOldLugreImage,	{ return LugreImage_CreateFromOgreImage(L,checkudata_alive(L)); });
		LUABIND_QUICKWRAP(	SubImage,			{ 
				Ogre::Image* pNew = new Ogre::Image();
				MySubImage(*checkudata_alive(L),*pNew,ParamInt(L,2),ParamInt(L,3),ParamInt(L,4),ParamInt(L,5));
				return CreateUData(L,pNew); 
			});
		
		/// void					MakeEmptyArea		(w,h,pixelformat)
		LUABIND_QUICKWRAP(			MakeEmptyArea,		{
			int 				w = ParamInt(L,2);
			int 				h = ParamInt(L,3);
			Ogre::PixelFormat	fmt = ParamPixelFormat(L,4);
			int					iSize = Ogre::Image::calculateSize(1,1,w,h,1,fmt);
			
			Ogre::uchar* b = (Ogre::uchar*)OGRE_MALLOC(iSize,Ogre::MEMCATEGORY_GENERAL);
			checkudata_alive(L)->loadDynamicImage(b,w,h,1,fmt,true); // autoDelete pBuf32
		});
			
		/// string					MakeTexture			(sNewTexName=nil,bIsAlpha=false)
		LUABIND_QUICKWRAP(			MakeTexture,		{
			std::string	sTexName	= ParamIsSet(L,2) ? ParamString(L,2) : cOgreWrapper::GetSingleton().GetUniqueName();
			bool		bIsAlpha 	= ParamBoolDefault(L,3,false);
			
			const Ogre::String&	group 			= Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME;
			Ogre::TextureType	texType			= TEX_TYPE_2D;
			int					iNumMipmaps		= MIP_DEFAULT;
			Ogre::Real 			gamma			= 1.0f;
			Ogre::PixelFormat	desiredFormat	= PF_UNKNOWN;
			
			Ogre::TextureManager::getSingleton().loadImage(sTexName,group,*checkudata_alive(L),texType,iNumMipmaps,gamma,bIsAlpha,desiredFormat);
			return PushString(L,sTexName.c_str()); 
		});
		
		
		/// void			BlitPart	(image_dest,dst_x,dst_y,src_x,src_y,w,h)
		LUABIND_QUICKWRAP(	BlitPart,	{ cOgreWrapper::ImageBlitPart(*checkudata_alive(L,1),*checkudata_alive(L,2),
											ParamInt(L,3),ParamInt(L,4),ParamInt(L,5),ParamInt(L,6),ParamInt(L,7),ParamInt(L,8)); });
													
													
		// unknown syntax:typedef Box Box;
		// unknown syntax:typedef Rect Rect;
		// unknown syntax:Image();
		// unknown syntax:Image(Image img);
		// unknown syntax:~Image();
		// unknown syntax:Image operator);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushCopyImage,									flipAroundY,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushCopyImage,									flipAroundX,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushCopyImage,									loadDynamicImage,									,((uchar*)ParamFIFOData(L,2),ParamInt(L,3),ParamInt(L,4),ParamInt(L,5),ParamPixelFormat(L,6),ParamBool(L,7),ParamInt(L,8),ParamInt(L,9))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushCopyImage,									loadDynamicImage,2									,((uchar*)ParamFIFOData(L,2),ParamInt(L,3),ParamInt(L,4),ParamPixelFormat(L,5))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushCopyImage,									loadRawData,										,(ParamDataStreamPtr(L,2),ParamInt(L,3),ParamInt(L,4),ParamInt(L,5),ParamPixelFormat(L,6),ParamInt(L,7),ParamInt(L,8))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushCopyImage,									loadRawData,2										,(ParamDataStreamPtr(L,2),ParamInt(L,3),ParamInt(L,4),ParamPixelFormat(L,5))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushCopyImage,									load,												,(ParamString(L,2),ParamStringDefault(L,3,Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushCopyImage,									load,2												,(ParamDataStreamPtr(L,2),ParamString(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushCopyImage,									loadTwoImagesAsRGBA,								,(ParamString(L,2),ParamString(L,3),ParamString(L,4),ParamPixelFormat(L,5))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushCopyImage,									loadTwoImagesAsRGBA,2								,(ParamDataStreamPtr(L,2),ParamDataStreamPtr(L,3),ParamPixelFormat(L,4),ParamString(L,5),ParamString(L,6))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushCopyImage,									combineTwoImagesAsRGBA,								,(ParamByRefImage(L,2),ParamByRefImage(L,3),ParamPixelFormat(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																save,												,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushDataStreamPtr,								encode,												,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			Pushuchar*,										getData,											,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			Pushuchar*,										getData,2											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getSize,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getNumMipmaps,										,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,										hasFlag,											,(ParamImageFlags(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getWidth,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getHeight,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getDepth,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getNumFaces,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getRowSpan,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getFormat,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getBPP,												,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getHasAlpha,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																applyGamma,											,((uchar*)ParamFIFOData(L,2),ParamNumber(L,3),ParamInt(L,4),ParamInt(L,5))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushColourValue,								getColourAt,										,(ParamInt(L,2),ParamInt(L,3),ParamInt(L,4))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushPixelBox,									getPixelBox,										,(ParamInt(L,2),ParamInt(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																freeMemory,											,()	);
		// unknown syntax:enum Filter;
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															scale,												,(ParamPixelBox(L,2),ParamPixelBox(L,3),ParamFilter(L,4))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															resize,												,(ParamInt(L,2),ParamInt(L,3),ParamFilter(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										calculateSize,										,(ParamInt(L,2),ParamInt(L,3),ParamInt(L,4),ParamInt(L,5),ParamInt(L,6),ParamPixelFormat(L,7))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushString,										getFileExtFromMagic,								,(ParamDataStreamPtr(L,2))	);
		
		LUABIND_PrefixConstant(Ogre::Image,FILTER_NEAREST)
		LUABIND_PrefixConstant(Ogre::Image,FILTER_LINEAR)
		LUABIND_PrefixConstant(Ogre::Image,FILTER_BILINEAR)
		LUABIND_PrefixConstant(Ogre::Image,FILTER_BOX)
		LUABIND_PrefixConstant(Ogre::Image,FILTER_TRIANGLE)
		LUABIND_PrefixConstant(Ogre::Image,FILTER_BICUBIC)
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.Image"; }
};

class cLugreLuaBind_Ogre_Texture : public cLuaBindDirect<Ogre::Texture>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE
		LUABIND_DIRECTWRAP_BASECLASS(Ogre::Resource);
		
		LUABIND_QUICKWRAP_STATIC(	GetOgreTexture,	{ 
				return CreateUData(L,Ogre::TextureManager::getSingleton().load(ParamString(L,1),ParamStringDefault(L,2,Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME)).get());
			});
		
		
		// unknown syntax:Texture(ResourceManager* creator,String name,ResourceHandle handle,String group,bool isManual,ManualResourceLoader* loader);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setTextureType,										,(ParamTextureType(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getTextureType,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getNumMipmaps,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setNumMipmaps,										,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getMipmapsHardwareGenerated,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getGamma,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setGamma,											,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setHardwareGammaEnabled,							,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isHardwareGammaEnabled,								,()	);
#if OGRE_VERSION < 0x10700
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setFSAA,											,(ParamInt(L,2))	);
#else
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setFSAA,											,(ParamInt(L,2),ParamString(L,3))	);
#endif
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getFSAA,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getFSAAHint,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getHeight,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getWidth,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getDepth,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getSrcHeight,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getSrcWidth,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getSrcDepth,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setHeight,											,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setWidth,											,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setDepth,											,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getUsage,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setUsage,											,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																createInternalResources,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																freeInternalResources,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															copyToTexture,										,(ParamTexturePtr(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																loadImage,											,(ParamByRefImage(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															loadRawData,										,(ParamDataStreamPtr(L,2),ParamInt(L,3),ParamInt(L,4),ParamPixelFormat(L,5))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_loadImages,										,(ParamConstImagePtrList(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getFormat,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getDesiredFormat,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getSrcFormat,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setFormat,											,(ParamPixelFormat(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasAlpha,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setDesiredIntegerBitDepth,							,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getDesiredIntegerBitDepth,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setDesiredFloatBitDepth,							,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getDesiredFloatBitDepth,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setDesiredBitDepths,								,(ParamInt(L,2),ParamInt(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setTreatLuminanceAsAlpha,							,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getTreatLuminanceAsAlpha,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getNumFaces,										,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushHardwarePixelBufferSharedPtr,				getBuffer,											,(ParamInt(L,2),ParamInt(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																convertToImage,										,(ParamByRefImage(L,2),ParamBool(L,3))	);
		
		
		LUABIND_PrefixConstant(Ogre,TEX_TYPE_1D)
		LUABIND_PrefixConstant(Ogre,TEX_TYPE_2D)
		LUABIND_PrefixConstant(Ogre,TEX_TYPE_3D)
		LUABIND_PrefixConstant(Ogre,TEX_TYPE_CUBE_MAP)
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.Texture"; }
};

class cLugreLuaBind_Ogre_Material : public cLuaBindDirect<Ogre::Material>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE
		LUABIND_DIRECTWRAP_BASECLASS(Ogre::Resource);
		
		// note : before generalizing this further here, make a binding for "resource-manager" with getSingleton bindings for mat,tex,mesh,skeleton,gpuprogram,font,compositor
		LUABIND_QUICKWRAP_STATIC_TRYCATCH(MaterialManager_load,		{ return CreateUData(L,((Ogre::MaterialPtr)Ogre::MaterialManager::getSingleton().load(ParamString(L,1),ParamStringDefault(L,2,Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME))).getPointer() ); });
		LUABIND_QUICKWRAP_STATIC_TRYCATCH(MaterialManager_create,	{ return CreateUData(L,((Ogre::MaterialPtr)Ogre::MaterialManager::getSingleton().create(ParamString(L,1),ParamStringDefault(L,2,Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME))).getPointer() ); });
		LUABIND_QUICKWRAP_STATIC_TRYCATCH(MaterialManager_unload,	{ Ogre::MaterialManager::getSingleton().unload(ParamString(L,1)); });
		LUABIND_QUICKWRAP_STATIC_TRYCATCH(MaterialManager_remove,	{ Ogre::MaterialManager::getSingleton().remove(ParamString(L,1)); });

		LUABIND_QUICKWRAP(Destroy,						{ delete checkudata_alive(L); }); // probably should use resource manager unload instead
		
		// void mat:MaterialSerializer_Export (filepath,bExportDefaults=false,bIncludeProgDef=false,sProgramFilename="",sMaterialName="");
		LUABIND_QUICKWRAP(MaterialSerializer_Export,	{ 
				try {
					Ogre::MaterialSerializer myExporter;
					myExporter.exportMaterial(
						 Ogre::MaterialPtr(checkudata_alive(L))
						,ParamString(L,2)
						,ParamBoolDefault(L,3,false)
						,ParamBoolDefault(L,4,false)
						,ParamStringDefault(L,5,"")
						,ParamStringDefault(L,6,"")
					); 
					PushBool(L,true);
					return 1;
				}
				catch (std::exception& e) { PushBool(L,false); PushString(L,e.what()); return 2; }
				catch (...) { PushBool(L,false); PushString(L,"MaterialSerializer_Export: unknown error"); return 2; }
			});
		
		// unknown syntax:typedef vector<Real>::type LodValueList;
		// unknown syntax:typedef ConstVectorIterator<LodValueList> LodValueIterator;
		// unknown syntax:Material(ResourceManager* creator,String name,ResourceHandle handle,String group,bool isManual,ManualResourceLoader* loader);
		// unknown syntax:~Material();
		// unknown syntax:Material operator);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isTransparent,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setReceiveShadows,									,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getReceiveShadows,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setTransparencyCastsShadows,						,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getTransparencyCastsShadows,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushTechnique,									createTechnique,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushTechnique,									getTechnique,										,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushTechnique,									getTechnique,2										,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getNumTechniques,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																removeTechnique,									,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																removeAllTechniques,								,()	);
		// unknown syntax:typedef VectorIterator<Techniques> TechniqueIterator;
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushTechniqueIterator,							getTechniqueIterator,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushTechniqueIterator,							getSupportedTechniqueIterator,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushTechnique,									getSupportedTechnique,								,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getNumSupportedTechniques,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getUnsupportedTechniquesExplanation,				,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getNumLodLevels,									,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getNumLodLevels,2									,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushTechnique,									getBestTechnique,									,(ParamInt(L,2),ParamRenderable(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushMaterialPtr,								clone,												,(ParamString(L,2),ParamBool(L,3),ParamString(L,4))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															copyDetailsTo,										,(ParamMaterialPtr(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																compile,											,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setPointSize,										,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setAmbient,											,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setAmbient,2										,(ParamColourValue(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setDiffuse,											,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4),ParamNumber(L,5))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setDiffuse,2										,(ParamColourValue(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setSpecular,										,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4),ParamNumber(L,5))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setSpecular,2										,(ParamColourValue(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setShininess,										,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setSelfIllumination,								,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setSelfIllumination,2								,(ParamColourValue(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setDepthCheckEnabled,								,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setDepthWriteEnabled,								,(ParamBool(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setDepthFunction,									,(ParamCompareFunction(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setColourWriteEnabled,								,(ParamBool(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setCullingMode,										,(ParamCullingMode(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setManualCullingMode,								,(ParamManualCullingMode(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setLightingEnabled,									,(ParamBool(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setShadingMode,										,(ParamShadeOptions(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setFog,												,(ParamBool(L,2),ParamFogMode(L,3),ParamColourValue(L,4),ParamNumber(L,5),ParamNumber(L,6),ParamNumber(L,7))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setDepthBias,										,(ParamNumber(L,2),ParamNumber(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setTextureFiltering,								,(ParamTextureFilterOptions(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setTextureAnisotropy,								,(ParamInt(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setSceneBlending,									,(ParamSceneBlendType(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setSeparateSceneBlending,							,(ParamSceneBlendType(L,2),ParamSceneBlendType(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setSceneBlending,2									,(ParamSceneBlendFactor(L,2),ParamSceneBlendFactor(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setSeparateSceneBlending,2							,(ParamSceneBlendFactor(L,2),ParamSceneBlendFactor(L,3),ParamSceneBlendFactor(L,4),ParamSceneBlendFactor(L,5))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_notifyNeedsRecompile,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setLodLevels,										,(ParamLodValueList(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushLodValueIterator,							getLodValueIterator,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getLodIndex,										,(ParamNumber(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushLodStrategy*,								getLodStrategy,										,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setLodStrategy,										,(ParamLodStrategy*(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																touch,												,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,										applyTextureAliases,								,(ParamAliasTextureNamePairList(L,2),ParamBool(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getCompilationRequired,								,()	);
		
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.Material"; }
};

class cLugreLuaBind_Ogre_Technique : public cLuaBindDirect<Ogre::Technique>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE
		// unknown syntax:enum IncludeOrExclude;
		// unknown syntax:struct GPUVendorRule;
		// unknown syntax:struct GPUDeviceNameRule;
		// unknown syntax:typedef vector<GPUVendorRule>::type GPUVendorRuleList;
		// unknown syntax:typedef vector<GPUDeviceNameRule>::type GPUDeviceNameRuleList;
		// unknown syntax:Technique(Material* parent);
		// unknown syntax:Technique(Material* parent,Technique oth);
		// unknown syntax:~Technique();
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isSupported,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										_compile,											,(ParamBool(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,										checkGPURules,										,(ParamStringUtil::StrStreamType(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,										checkHardwareSupport,								,(ParamBool(L,2),ParamStringUtil::StrStreamType(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_compileIlluminationPasses,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushPass,										createPass,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushPass,										getPass,											,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushPass,										getPass,2											,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getNumPasses,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																removePass,											,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																removeAllPasses,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										movePass,											,(ParamInt(L,2),ParamInt(L,3))	);
		// unknown syntax:typedef VectorIterator<Passes> PassIterator;
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushPassIterator,								getPassIterator,									,()	);
		// unknown syntax:typedef VectorIterator<IlluminationPassList> IlluminationPassIterator;
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushIlluminationPassIterator,					getIlluminationPassIterator,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushMaterial,									getParent,											,()	);
		// unknown syntax:Technique operator);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getResourceGroup,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isTransparent,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isTransparentSortingEnabled,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isTransparentSortingForced,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_prepare,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_unprepare,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_load,												,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_unload,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isLoaded,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_notifyNeedsRecompile,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushMaterialPtr,								getShadowCasterMaterial,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setShadowCasterMaterial,							,(ParamMaterialPtr(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setShadowCasterMaterial,2							,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushMaterialPtr,								getShadowReceiverMaterial,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setShadowReceiverMaterial,							,(ParamMaterialPtr(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setShadowReceiverMaterial,2							,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setPointSize,										,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setAmbient,											,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setAmbient,2										,(ParamColourValue(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setDiffuse,											,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4),ParamNumber(L,5))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setDiffuse,2										,(ParamColourValue(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setSpecular,										,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4),ParamNumber(L,5))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setSpecular,2										,(ParamColourValue(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setShininess,										,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setSelfIllumination,								,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setSelfIllumination,2								,(ParamColourValue(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setDepthCheckEnabled,								,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setDepthWriteEnabled,								,(ParamBool(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setDepthFunction,									,(ParamCompareFunction(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setColourWriteEnabled,								,(ParamBool(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setCullingMode,										,(ParamCullingMode(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setManualCullingMode,								,(ParamManualCullingMode(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setLightingEnabled,									,(ParamBool(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setShadingMode,										,(ParamShadeOptions(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setFog,												,(ParamBool(L,2),ParamFogMode(L,3),ParamColourValue(L,4),ParamNumber(L,5),ParamNumber(L,6),ParamNumber(L,7))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setDepthBias,										,(ParamNumber(L,2),ParamNumber(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setTextureFiltering,								,(ParamTextureFilterOptions(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setTextureAnisotropy,								,(ParamInt(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setSceneBlending,									,(ParamSceneBlendType(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setSeparateSceneBlending,							,(ParamSceneBlendType(L,2),ParamSceneBlendType(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setSceneBlending,2									,(ParamSceneBlendFactor(L,2),ParamSceneBlendFactor(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setSeparateSceneBlending,2							,(ParamSceneBlendFactor(L,2),ParamSceneBlendFactor(L,3),ParamSceneBlendFactor(L,4),ParamSceneBlendFactor(L,5))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setLodIndex,										,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getLodIndex,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setSchemeName,										,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getSchemeName,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										_getSchemeIndex,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isDepthWriteEnabled,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isDepthCheckEnabled,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasColourWriteDisabled,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setName,											,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getName,											,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,										applyTextureAliases,								,(ParamAliasTextureNamePairList(L,2),ParamBool(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															addGPUVendorRule,									,(ParamGPUVendor(L,2),ParamIncludeOrExclude(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															addGPUVendorRule,2									,(ParamGPUVendorRule(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															removeGPUVendorRule,								,(ParamGPUVendor(L,2))	);
		// unknown syntax:typedef ConstVectorIterator<GPUVendorRuleList> GPUVendorRuleIterator;
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushGPUVendorRuleIterator,						getGPUVendorRuleIterator,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															addGPUDeviceNameRule,								,(ParamString(L,2),ParamIncludeOrExclude(L,3),ParamBool(L,4))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															addGPUDeviceNameRule,2								,(ParamGPUDeviceNameRule(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																removeGPUDeviceNameRule,							,(ParamString(L,2))	);
		// unknown syntax:typedef ConstVectorIterator<GPUDeviceNameRuleList> GPUDeviceNameRuleIterator;
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushGPUDeviceNameRuleIterator,					getGPUDeviceNameRuleIterator,						,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushUserObjectBindings,							getUserObjectBindings,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushUserObjectBindings,							getUserObjectBindings,2								,()	);
		
		// PROTECTED! LUABIND_PrefixConstant(Ogre::Technique,INCLUDE)
		// PROTECTED! LUABIND_PrefixConstant(Ogre::Technique,EXCLUDE)
		// PROTECTED! LUABIND_PrefixConstant(Ogre::Technique,IPS_COMPILE_DISABLED)
		// PROTECTED! LUABIND_PrefixConstant(Ogre::Technique,IPS_NOT_COMPILED)
		// PROTECTED! LUABIND_PrefixConstant(Ogre::Technique,IPS_COMPILED)
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.Technique"; }
};

class cLugreLuaBind_Ogre_Pass : public cLuaBindDirect<Ogre::Pass>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE
		// unknown syntax:struct HashFunc;
		// unknown syntax:typedef set<Pass* >::type PassSet;
		// unknown syntax:OGRE_STATIC_MUTEX(msDirtyHashListMutex)OGRE_STATIC_MUTEX(msPassGraveyardMutex)Pass(Technique* parent,short index);
		// unknown syntax:Pass(Technique* parent,short index,Pass oth);
		// unknown syntax:Pass operator);
		// unknown syntax:~Pass();
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isProgrammable,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasVertexProgram,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasFragmentProgram,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasGeometryProgram,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasShadowCasterVertexProgram,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasShadowReceiverVertexProgram,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasShadowReceiverFragmentProgram,					,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getIndex,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setName,											,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getName,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setAmbient,											,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setAmbient,2										,(ParamColourValue(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setDiffuse,											,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4),ParamNumber(L,5))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setDiffuse,2										,(ParamColourValue(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setSpecular,										,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4),ParamNumber(L,5))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setSpecular,2										,(ParamColourValue(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setShininess,										,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setSelfIllumination,								,(ParamNumber(L,2),ParamNumber(L,3),ParamNumber(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setSelfIllumination,2								,(ParamColourValue(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setVertexColourTracking,							,(ParamTrackVertexColourType(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getPointSize,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setPointSize,										,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setPointSpritesEnabled,								,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getPointSpritesEnabled,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setPointAttenuation,								,(ParamBool(L,2),ParamNumber(L,3),ParamNumber(L,4),ParamNumber(L,5))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isPointAttenuationEnabled,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getPointAttenuationConstant,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getPointAttenuationLinear,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getPointAttenuationQuadratic,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setPointMinSize,									,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getPointMinSize,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setPointMaxSize,									,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getPointMaxSize,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushColourValue,								getAmbient,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushColourValue,								getDiffuse,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushColourValue,								getSpecular,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushColourValue,								getSelfIllumination,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getShininess,										,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushTrackVertexColourType,						getVertexColourTracking,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushTextureUnitState,							createTextureUnitState,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushTextureUnitState,							createTextureUnitState,2							,(ParamString(L,2),ParamInt(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																addTextureUnitState,								,(ParamTextureUnitState(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushTextureUnitState,							getTextureUnitState,								,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushTextureUnitState,							getTextureUnitState,2								,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushTextureUnitState,							getTextureUnitState,3								,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushTextureUnitState,							getTextureUnitState,4								,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getTextureUnitStateIndex,							,(ParamTextureUnitState(L,2))	);
		// unknown syntax:typedef VectorIterator<TextureUnitStates> TextureUnitStateIterator;
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushTextureUnitStateIterator,					getTextureUnitStateIterator,						,()	);
		// unknown syntax:typedef ConstVectorIterator<TextureUnitStates> ConstTextureUnitStateIterator;
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushConstTextureUnitStateIterator,				getTextureUnitStateIterator,2						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																removeTextureUnitState,								,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																removeAllTextureUnitStates,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getNumTextureUnitStates,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setSceneBlending,									,(ParamSceneBlendType(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setSeparateSceneBlending,							,(ParamSceneBlendType(L,2),ParamSceneBlendType(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setSceneBlending,2									,(ParamSceneBlendFactor(L,2),ParamSceneBlendFactor(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setSeparateSceneBlending,2							,(ParamSceneBlendFactor(L,2),ParamSceneBlendFactor(L,3),ParamSceneBlendFactor(L,4),ParamSceneBlendFactor(L,5))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasSeparateSceneBlending,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSceneBlendFactor,							getSourceBlendFactor,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSceneBlendFactor,							getDestBlendFactor,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSceneBlendFactor,							getSourceBlendFactorAlpha,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSceneBlendFactor,							getDestBlendFactorAlpha,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setSceneBlendingOperation,							,(ParamSceneBlendOperation(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setSeparateSceneBlendingOperation,					,(ParamSceneBlendOperation(L,2),ParamSceneBlendOperation(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasSeparateSceneBlendingOperations,					,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSceneBlendOperation,						getSceneBlendingOperation,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSceneBlendOperation,						getSceneBlendingOperationAlpha,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isTransparent,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setDepthCheckEnabled,								,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getDepthCheckEnabled,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setDepthWriteEnabled,								,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getDepthWriteEnabled,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setDepthFunction,									,(ParamCompareFunction(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushCompareFunction,							getDepthFunction,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setColourWriteEnabled,								,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getColourWriteEnabled,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setCullingMode,										,(ParamCullingMode(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushCullingMode,								getCullingMode,										,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setManualCullingMode,								,(ParamManualCullingMode(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushManualCullingMode,							getManualCullingMode,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setLightingEnabled,									,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getLightingEnabled,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setMaxSimultaneousLights,							,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getMaxSimultaneousLights,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setStartLight,										,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getStartLight,										,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setShadingMode,										,(ParamShadeOptions(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushShadeOptions,								getShadingMode,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setPolygonMode,										,(ParamPolygonMode(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getPolygonMode,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setPolygonModeOverrideable,							,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getPolygonModeOverrideable,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setFog,												,(ParamBool(L,2),ParamFogMode(L,3),ParamColourValue(L,4),ParamNumber(L,5),ParamNumber(L,6),ParamNumber(L,7))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getFogOverride,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getFogMode,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushColourValue,								getFogColour,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getFogStart,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getFogEnd,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getFogDensity,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setDepthBias,										,(ParamNumber(L,2),ParamNumber(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getDepthBiasConstant,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getDepthBiasSlopeScale,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setIterationDepthBias,								,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getIterationDepthBias,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setAlphaRejectSettings,								,(ParamCompareFunction(L,2),Paramchar(L,3),ParamBool(L,4))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setAlphaRejectFunction,								,(ParamCompareFunction(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setAlphaRejectValue,								,(Paramchar(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushCompareFunction,							getAlphaRejectFunction,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			Pushchar,										getAlphaRejectValue,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setAlphaToCoverageEnabled,							,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isAlphaToCoverageEnabled,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setTransparentSortingEnabled,						,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getTransparentSortingEnabled,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setTransparentSortingForced,						,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getTransparentSortingForced,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setIteratePerLight,									,(ParamBool(L,2),ParamBool(L,3),ParamLightTypes(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getIteratePerLight,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getRunOnlyForOneLightType,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushLight::LightTypes,							getOnlyLightType,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setLightCountPerIteration,							,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getLightCountPerIteration,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushTechnique,									getParent,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getResourceGroup,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setVertexProgram,									,(ParamString(L,2),ParamBool(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setVertexProgramParameters,							,(ParamGpuProgramParametersSharedPtr(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getVertexProgramName,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushGpuProgramParametersSharedPtr,				getVertexProgramParameters,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushGpuProgramPtr,								getVertexProgram,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setShadowCasterVertexProgram,						,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setShadowCasterVertexProgramParameters,				,(ParamGpuProgramParametersSharedPtr(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getShadowCasterVertexProgramName,					,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushGpuProgramParametersSharedPtr,				getShadowCasterVertexProgramParameters,				,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushGpuProgramPtr,								getShadowCasterVertexProgram,						,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setShadowReceiverVertexProgram,						,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setShadowReceiverVertexProgramParameters,			,(ParamGpuProgramParametersSharedPtr(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setShadowReceiverFragmentProgram,					,(ParamString(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setShadowReceiverFragmentProgramParameters,			,(ParamGpuProgramParametersSharedPtr(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getShadowReceiverVertexProgramName,					,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushGpuProgramParametersSharedPtr,				getShadowReceiverVertexProgramParameters,			,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushGpuProgramPtr,								getShadowReceiverVertexProgram,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getShadowReceiverFragmentProgramName,				,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushGpuProgramParametersSharedPtr,				getShadowReceiverFragmentProgramParameters,			,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushGpuProgramPtr,								getShadowReceiverFragmentProgram,					,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setFragmentProgram,									,(ParamString(L,2),ParamBool(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setFragmentProgramParameters,						,(ParamGpuProgramParametersSharedPtr(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getFragmentProgramName,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushGpuProgramParametersSharedPtr,				getFragmentProgramParameters,						,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushGpuProgramPtr,								getFragmentProgram,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setGeometryProgram,									,(ParamString(L,2),ParamBool(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setGeometryProgramParameters,						,(ParamGpuProgramParametersSharedPtr(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getGeometryProgramName,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushGpuProgramParametersSharedPtr,				getGeometryProgramParameters,						,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushGpuProgramPtr,								getGeometryProgram,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushPass,										_split,												,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_notifyIndex,										,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_prepare,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_unprepare,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_load,												,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_unload,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isLoaded,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getHash,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_dirtyHash,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_recalculateHash,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_notifyNeedsRecompile,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_updateAutoParams,									,(ParamAutoParamDataSource*(L,2),Paramuint16(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushNumber,										_getTextureUnitWithContentTypeIndex,				,(ParamTextureUnitState::ContentType(L,2),ParamInt(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setTextureFiltering,								,(ParamTextureFilterOptions(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setTextureAnisotropy,								,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setNormaliseNormals,								,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getNormaliseNormals,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushPassSet,									getDirtyHashList,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushPassSet,									getPassGraveyard,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																clearDirtyHashList,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																processPendingPassUpdates,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																queueForDeletion,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isAmbientOnly,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setPassIterationCount,								,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getPassIterationCount,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,										applyTextureAliases,								,(ParamAliasTextureNamePairList(L,2),ParamBool(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setLightScissoringEnabled,							,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getLightScissoringEnabled,							,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setLightClipPlanesEnabled,							,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getLightClipPlanesEnabled,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setIlluminationStage,								,(ParamIlluminationStage(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushIlluminationStage,							getIlluminationStage,								,()	);
		// unknown syntax:enum BuiltinHashFunction;
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setHashFunction,									,(ParamBuiltinHashFunction(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setHashFunction,2									,(ParamHashFunc*(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushHashFunc*,									getHashFunction,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushHashFunc*,									getBuiltinHashFunction,								,(ParamBuiltinHashFunction(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushUserObjectBindings,							getUserObjectBindings,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushUserObjectBindings,							getUserObjectBindings,2								,()	);
		
		LUABIND_PrefixConstant(Ogre::Pass,MIN_TEXTURE_CHANGE)
		LUABIND_PrefixConstant(Ogre::Pass,MIN_GPU_PROGRAM_CHANGE)
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.Pass"; }
};

class cLugreLuaBind_Ogre_TextureUnitState : public cLuaBindDirect<Ogre::TextureUnitState>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE
		// unknown syntax:enum TextureEffectType;
		// unknown syntax:enum EnvMapType;
		// unknown syntax:enum TextureTransformType;
		// unknown syntax:enum TextureAddressingMode;
		// unknown syntax:struct UVWAddressingMode;
		// unknown syntax:enum TextureCubeFace;
		// unknown syntax:struct TextureEffect;
		// unknown syntax:typedef multimap<TextureEffectType,TextureEffect>::type EffectMap;
		// unknown syntax:TextureUnitState(Pass* parent);
		// unknown syntax:TextureUnitState(Pass* parent,TextureUnitState oth);
		// unknown syntax:TextureUnitState operator);
		// unknown syntax:~TextureUnitState();
		// unknown syntax:TextureUnitState(Pass* parent,String texName,int texCoordSet);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getTextureName,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setTextureName,										,(ParamString(L,2),ParamTextureType(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setCubicTextureName,								,(ParamString(L,2),ParamBool(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setCubicTextureName,2								,(ParamString*(L,2),ParamBool(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setAnimatedTextureName,								,(ParamString(L,2),ParamInt(L,3),ParamNumber(L,4))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setAnimatedTextureName,2							,(ParamString*(L,2),ParamInt(L,3),ParamNumber(L,4))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			Pushstd::pair< size_t,size_t >,					getTextureDimensions,								,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setCurrentFrame,									,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getCurrentFrame,									,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getFrameTextureName,								,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setFrameTextureName,								,(ParamString(L,2),ParamInt(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																addFrameTextureName,								,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																deleteFrameTextureName,								,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getNumFrames,										,()	);
		// unknown syntax:enum BindingType;
		// unknown syntax:enum ContentType;
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setBindingType,										,(ParamBindingType(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBindingType,								getBindingType,										,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setContentType,										,(ParamContentType(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushContentType,								getContentType,										,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isCubic,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										is3D,												,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getTextureType,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setDesiredFormat,									,(ParamPixelFormat(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getDesiredFormat,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setNumMipmaps,										,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getNumMipmaps,										,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setIsAlpha,											,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										getIsAlpha,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setHardwareGammaEnabled,							,(ParamBool(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isHardwareGammaEnabled,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getTextureCoordSet,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setTextureCoordSet,									,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setTextureTransform,								,(ParamMatrix4(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushMatrix4,									getTextureTransform,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setTextureScroll,									,(ParamNumber(L,2),ParamNumber(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setTextureUScroll,									,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getTextureUScroll,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setTextureVScroll,									,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getTextureVScroll,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setTextureUScale,									,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getTextureUScale,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setTextureVScale,									,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getTextureVScale,									,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setTextureScale,									,(ParamNumber(L,2),ParamNumber(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setTextureRotate,									,(ParamRadian(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushRadian,										getTextureRotate,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushUVWAddressingMode,							getTextureAddressingMode,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setTextureAddressingMode,							,(ParamTextureAddressingMode(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setTextureAddressingMode,2							,(ParamTextureAddressingMode(L,2),ParamTextureAddressingMode(L,3),ParamTextureAddressingMode(L,4))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setTextureAddressingMode,3							,(ParamUVWAddressingMode(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setTextureBorderColour,								,(ParamColourValue(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushColourValue,								getTextureBorderColour,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setColourOperationEx,								,(ParamLayerBlendOperationEx(L,2),ParamLayerBlendSource(L,3),ParamLayerBlendSource(L,4),ParamColourValue(L,5),ParamColourValue(L,6),ParamNumber(L,7))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setColourOperation,									,(ParamLayerBlendOperation(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setColourOpMultipassFallback,						,(ParamSceneBlendFactor(L,2),ParamSceneBlendFactor(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushLayerBlendModeEx,							getColourBlendMode,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushLayerBlendModeEx,							getAlphaBlendMode,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSceneBlendFactor,							getColourBlendFallbackSrc,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushSceneBlendFactor,							getColourBlendFallbackDest,							,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setAlphaOperation,									,(ParamLayerBlendOperationEx(L,2),ParamLayerBlendSource(L,3),ParamLayerBlendSource(L,4),ParamNumber(L,5),ParamNumber(L,6),ParamNumber(L,7))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															addEffect,											,(ParamTextureEffect(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setEnvironmentMap,									,(ParamBool(L,2),ParamEnvMapType(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setScrollAnimation,									,(ParamNumber(L,2),ParamNumber(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setRotateAnimation,									,(ParamNumber(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setTransformAnimation,								,(ParamTextureTransformType(L,2),ParamWaveformType(L,3),ParamNumber(L,4),ParamNumber(L,5),ParamNumber(L,6),ParamNumber(L,7))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setProjectiveTexturing,								,(ParamBool(L,2),ParamFrustum(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																removeAllEffects,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															removeEffect,										,(ParamTextureEffectType(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isBlank,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setBlank,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isTextureLoadFailing,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																retryTextureLoad,									,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushEffectMap,									getEffects,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getAnimationDuration,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setTextureFiltering,								,(ParamTextureFilterOptions(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setTextureFiltering,2								,(ParamFilterType(L,2),ParamFilterOptions(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															setTextureFiltering,3								,(ParamFilterOptions(L,2),ParamFilterOptions(L,3),ParamFilterOptions(L,4))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushFilterOptions,								getTextureFiltering,								,(ParamFilterType(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setTextureAnisotropy,								,(ParamInt(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getTextureAnisotropy,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setTextureMipmapBias,								,(ParamNumber(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getTextureMipmapBias,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setCompositorReference,								,(ParamString(L,2),ParamString(L,3),ParamInt(L,4))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getReferencedCompositorName,						,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getReferencedTextureName,							,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushNumber,										getReferencedMRTIndex,								,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushPass,										getParent,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_prepare,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_unprepare,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_load,												,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_unload,											,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										hasViewRelativeTextureCoordinateGeneration,			,()	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushBool,										isLoaded,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_notifyNeedsRecompile,								,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setName,											,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getName,											,()	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																setTextureNameAlias,								,(ParamString(L,2))	);
		LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(				PushString,										getTextureNameAlias,								,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,										applyTextureAliases,								,(ParamAliasTextureNamePairList(L,2),ParamBool(L,3))	);
		LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(																_notifyParent,										,(ParamPass(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushTexturePtr,									_getTexturePtr,										,()	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushTexturePtr,									_getTexturePtr,2									,(ParamInt(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_setTexturePtr,										,(ParamTexturePtr(L,2))	);
		//~ LUABIND_DIRECTWRAP_RETURN_VOID_NAMEADD(															_setTexturePtr,2									,(ParamTexturePtr(L,2),ParamInt(L,3))	);
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushController<Real>*,							_getAnimController,									,()	);
		
		LUABIND_PrefixConstant(Ogre::TextureUnitState,CONTENT_NAMED)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,CONTENT_SHADOW)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,CONTENT_COMPOSITOR)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,CUBE_FRONT)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,CUBE_BACK)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,CUBE_LEFT)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,CUBE_RIGHT)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,CUBE_UP)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,CUBE_DOWN)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,ENV_PLANAR)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,ENV_CURVED)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,ENV_REFLECTION)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,ENV_NORMAL)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,BT_FRAGMENT)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,BT_VERTEX)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,TAM_WRAP)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,TAM_MIRROR)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,TAM_CLAMP)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,TAM_BORDER)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,TT_TRANSLATE_U)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,TT_TRANSLATE_V)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,TT_SCALE_U)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,TT_SCALE_V)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,TT_ROTATE)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,ET_ENVIRONMENT_MAP)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,ET_PROJECTIVE_TEXTURE)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,ET_UVSCROLL)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,ET_USCROLL)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,ET_VSCROLL)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,ET_ROTATE)
		LUABIND_PrefixConstant(Ogre::TextureUnitState,ET_TRANSFORM)
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.TextureUnitState"; }
};

class cLugreLuaBind_Ogre_RenderOperation : public cLuaBindDirect<Ogre::RenderOperation>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE
		LUABIND_QUICKWRAP(	getVertexData,	{ return cLuaBindDirect<Ogre::VertexData>::CreateUData(L,GetSelf(L).vertexData); });
		LUABIND_QUICKWRAP(	getIndexData,	{ return cLuaBindDirect<Ogre::IndexData>::CreateUData(L,GetSelf(L).indexData); });
		LUABIND_QUICKWRAP(	setVertexData,	{ if (GetSelf(L).vertexData) delete GetSelf(L).vertexData; GetSelf(L).vertexData = ParamVertexData(L,2); });
		LUABIND_QUICKWRAP(	setIndexData,	{ if (GetSelf(L).indexData) delete GetSelf(L).indexData; GetSelf(L).indexData = ParamIndexData(L,2); });
		
		LUABIND_QUICKWRAP(	setOperationType,	{ GetSelf(L).operationType = (Ogre::RenderOperation::OperationType)ParamInt(L,2); });
		LUABIND_QUICKWRAP(	getOperationType,	{ return PushNumber(L,GetSelf(L).operationType); });
		
		LUABIND_QUICKWRAP(setUseIndexes,		{ GetSelf(L).useIndexes = ParamBool(L,2); });
		LUABIND_QUICKWRAP(getUseIndexes,		{ return PushBool(L,GetSelf(L).useIndexes); });
		
		//~ Ogre::RenderOperation
		LUABIND_PrefixConstant(Ogre::RenderOperation,OT_POINT_LIST)			// 	A list of points, 1 vertex per point.
		LUABIND_PrefixConstant(Ogre::RenderOperation,OT_LINE_LIST)			// 	A list of lines, 2 vertices per line.
		LUABIND_PrefixConstant(Ogre::RenderOperation,OT_LINE_STRIP)			// 	A strip of connected lines, 1 vertex per line plus 1 start vertex.
		LUABIND_PrefixConstant(Ogre::RenderOperation,OT_TRIANGLE_LIST)		// 	A list of triangles, 3 vertices per triangle.
		LUABIND_PrefixConstant(Ogre::RenderOperation,OT_TRIANGLE_STRIP)		// 	A strip of triangles, 3 vertices for the first triangle, and 1 per triangle after that.
		LUABIND_PrefixConstant(Ogre::RenderOperation,OT_TRIANGLE_FAN)		// 	A fan of triangles, 3 vertices for the first triangle, and 1 per triangle after that. 
		
		//~ Ogre::HardwareIndexBuffer
		LUABIND_PrefixConstant(Ogre::HardwareIndexBuffer,IT_16BIT)		
		LUABIND_PrefixConstant(Ogre::HardwareIndexBuffer,IT_32BIT)
		
		//~ Ogre::HardwareBuffer
		// Enums describing buffer usage; not mutually exclusive.   -> COMBO POSSIBLE !!!! (add)
		LUABIND_PrefixConstant(Ogre::HardwareBuffer,HBU_STATIC)
		LUABIND_PrefixConstant(Ogre::HardwareBuffer,HBU_DYNAMIC)
		LUABIND_PrefixConstant(Ogre::HardwareBuffer,HBU_WRITE_ONLY)
		LUABIND_PrefixConstant(Ogre::HardwareBuffer,HBU_DISCARDABLE)
		LUABIND_PrefixConstant(Ogre::HardwareBuffer,HBU_STATIC_WRITE_ONLY)
		LUABIND_PrefixConstant(Ogre::HardwareBuffer,HBU_DYNAMIC_WRITE_ONLY)
		LUABIND_PrefixConstant(Ogre::HardwareBuffer,HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE)
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.RenderOperation"; }
};

class cLugreLuaBind_Ogre_VertexDeclaration : public cLuaBindDirect<Ogre::VertexDeclaration>, public cLuaBindDirectOgreHelper { public:
	virtual void RegisterMethods	(lua_State *L) { PROFILE
		LUABIND_QUICKWRAP_STATIC(CreateVertexDeclaration, { return CreateUData(L,Ogre::HardwareBufferManager::getSingleton().createVertexDeclaration()); });
		LUABIND_QUICKWRAP(Destroy,				{ delete checkudata_alive(L); });
		
		// unknown syntax:typedef list<VertexElement>::type VertexElementList;
		//~ LUABIND_DIRECTWRAP_RETURN_ONE_NAMEADD(			PushBool,										vertexElementLess,									,(ParamVertexElement(L,2),ParamVertexElement(L,3))	);
		// unknown syntax:VertexDeclaration();
		// unknown syntax:~VertexDeclaration();
		LUABIND_QUICKWRAP(removeAllElements,	{ GetSelf(L).removeAllElements(); });
		LUABIND_QUICKWRAP(getElementCount,		{ return PushNumber(L,GetSelf(L).getElementCount()); });
		LUABIND_QUICKWRAP(sort,					{ GetSelf(L).sort(); });
		LUABIND_QUICKWRAP(clone,				{ return CreateUData(L,GetSelf(L).clone()); });
		LUABIND_QUICKWRAP(getVertexSize,		{ return PushNumber(L,GetSelf(L).getVertexSize(ParamInt(L,2))); });
		LUABIND_QUICKWRAP(getMaxSource,			{ return PushNumber(L,GetSelf(L).getMaxSource()); });
		LUABIND_QUICKWRAP(closeGapsInSource,	{ GetSelf(L).closeGapsInSource(); });
		
		/// resorts and recalculates "source" part of the elements
		LUABIND_QUICKWRAP(getAutoOrganisedDeclaration,	{ return CreateUData(L,GetSelf(L).getAutoOrganisedDeclaration(ParamBool(L,2),ParamBool(L,3))); });
		
		/// src,offset,type,semantic,index	getElement		(i)
		LUABIND_QUICKWRAP(getElement,		{
			const Ogre::VertexElement* p = GetSelf(L).getElement(ParamInt(L,2)); 
			if (!p) return 0;
			PushNumber(L,p->getSource());
			PushNumber(L,p->getOffset());
			PushNumber(L,(int)p->getType());
			PushNumber(L,(int)p->getSemantic());
			PushNumber(L,(int)p->getIndex());
			return 5; 
		});
		
		/// iElementSize	addElement		(src,offset,type,semantic,index=0)
		LUABIND_QUICKWRAP(addElement,	{
			return PushNumber(L,GetSelf(L).addElement(	(unsigned short)				ParamInt(L,2), 
									(size_t)						ParamInt(L,3),
									(Ogre::VertexElementType)		ParamInt(L,4),
									(Ogre::VertexElementSemantic)	ParamInt(L,5),
									(unsigned short)				ParamIntDefault(L,6,0)
								).getSize());
		});
		
		LUABIND_PrefixConstant(Ogre,VET_FLOAT1) 	
		LUABIND_PrefixConstant(Ogre,VET_FLOAT2) 	
		LUABIND_PrefixConstant(Ogre,VET_FLOAT3) 	
		LUABIND_PrefixConstant(Ogre,VET_FLOAT4) 	
		LUABIND_PrefixConstant(Ogre,VET_COLOUR) 				// alias to more specific colour type - use the current rendersystem's colour packing
		LUABIND_PrefixConstant(Ogre,VET_SHORT1) 	
		LUABIND_PrefixConstant(Ogre,VET_SHORT2) 	
		LUABIND_PrefixConstant(Ogre,VET_SHORT3) 	
		LUABIND_PrefixConstant(Ogre,VET_SHORT4) 	
		LUABIND_PrefixConstant(Ogre,VET_UBYTE4) 	
		LUABIND_PrefixConstant(Ogre,VET_COLOUR_ARGB) 			// 	D3D style compact colour.
		LUABIND_PrefixConstant(Ogre,VET_COLOUR_ABGR) 			//	GL style compact colour. 

		LUABIND_PrefixConstant(Ogre,VES_POSITION)				// 	Position, 3 reals per vertex.
		LUABIND_PrefixConstant(Ogre,VES_BLEND_WEIGHTS)			// 	Blending weights.
		LUABIND_PrefixConstant(Ogre,VES_BLEND_INDICES)			// 	Blending indices.
		LUABIND_PrefixConstant(Ogre,VES_NORMAL)					// 	Normal, 3 reals per vertex.
		LUABIND_PrefixConstant(Ogre,VES_DIFFUSE)				// 	Diffuse colours.
		LUABIND_PrefixConstant(Ogre,VES_SPECULAR)				// 	Specular colours.
		LUABIND_PrefixConstant(Ogre,VES_TEXTURE_COORDINATES)	// 	Texture coordinates.
		LUABIND_PrefixConstant(Ogre,VES_BINORMAL)				// 	Binormal (Y axis if normal is Z).
		LUABIND_PrefixConstant(Ogre,VES_TANGENT)				// 	Tangent (X axis if normal is Z). 
	}
	virtual const char* GetLuaTypeName () { return "lugre.ogre.VertexDeclaration"; }
};

/// lua binding
void	LuaRegister_LuaBinds_Ogre 	(lua_State *L) { PROFILE
	// needed first as baseclasses
	cLuaBindDirect<Ogre::MovableObject		>::GetSingletonPtr(new cLugreLuaBind_Ogre_MovableObject(		))->LuaRegister(L);
	cLuaBindDirect<Ogre::Renderable			>::GetSingletonPtr(new cLugreLuaBind_Ogre_Renderable(			))->LuaRegister(L);
	cLuaBindDirect<Ogre::Resource			>::GetSingletonPtr(new cLugreLuaBind_Ogre_Resource(				))->LuaRegister(L);
	cLuaBindDirect<Ogre::Node				>::GetSingletonPtr(new cLugreLuaBind_Ogre_Node(					))->LuaRegister(L);
	cLuaBindDirect<Ogre::Light				>::GetSingletonPtr(new cLugreLuaBind_Ogre_Light(				))->LuaRegister(L);
	cLuaBindDirect<Ogre::SceneManager		>::GetSingletonPtr(new cLugreLuaBind_Ogre_SceneManager(			))->LuaRegister(L);
	cLuaBindDirect<Ogre::Frustum			>::GetSingletonPtr(new cLugreLuaBind_Ogre_Frustum(				))->LuaRegister(L);
	cLuaBindDirect<Ogre::Camera				>::GetSingletonPtr(new cLugreLuaBind_Ogre_Camera(				))->LuaRegister(L);
	cLuaBindDirect<Ogre::SceneNode			>::GetSingletonPtr(new cLugreLuaBind_Ogre_SceneNode(			))->LuaRegister(L);
	cLuaBindDirect<Ogre::VertexData			>::GetSingletonPtr(new cLugreLuaBind_Ogre_VertexData(			))->LuaRegister(L);
	cLuaBindDirect<Ogre::IndexData			>::GetSingletonPtr(new cLugreLuaBind_Ogre_IndexData(			))->LuaRegister(L);
	cLuaBindDirect<Ogre::Skeleton			>::GetSingletonPtr(new cLugreLuaBind_Ogre_Skeleton(				))->LuaRegister(L);
	cLuaBindDirect<Ogre::Bone				>::GetSingletonPtr(new cLugreLuaBind_Ogre_Bone(					))->LuaRegister(L);
	cLuaBindDirect<Ogre::Animation			>::GetSingletonPtr(new cLugreLuaBind_Ogre_Animation(			))->LuaRegister(L);
	cLuaBindDirect<Ogre::Mesh				>::GetSingletonPtr(new cLugreLuaBind_Ogre_Mesh(					))->LuaRegister(L);
	cLuaBindDirect<Ogre::SubMesh			>::GetSingletonPtr(new cLugreLuaBind_Ogre_SubMesh(				))->LuaRegister(L);
	cLuaBindDirect<Ogre::SubEntity		>::GetSingletonPtr(new cLugreLuaBind_Ogre_SubEntity(		))->LuaRegister(L);
	cLuaBindDirect<Ogre::Entity		>::GetSingletonPtr(new cLugreLuaBind_Ogre_Entity(		))->LuaRegister(L);
	cLuaBindDirect<Ogre::AnimationTrack		>::GetSingletonPtr(new cLugreLuaBind_Ogre_AnimationTrack(		))->LuaRegister(L);
	cLuaBindDirect<Ogre::NodeAnimationTrack		>::GetSingletonPtr(new cLugreLuaBind_Ogre_NodeAnimationTrack(		))->LuaRegister(L);
	cLuaBindDirect<Ogre::AnimationState		>::GetSingletonPtr(new cLugreLuaBind_Ogre_AnimationState(		))->LuaRegister(L);
	cLuaBindDirect<Ogre::KeyFrame		>::GetSingletonPtr(new cLugreLuaBind_Ogre_KeyFrame(		))->LuaRegister(L);
	cLuaBindDirect<Ogre::NumericKeyFrame		>::GetSingletonPtr(new cLugreLuaBind_Ogre_NumericKeyFrame(		))->LuaRegister(L);
	cLuaBindDirect<Ogre::TransformKeyFrame		>::GetSingletonPtr(new cLugreLuaBind_Ogre_TransformKeyFrame(		))->LuaRegister(L);
	cLuaBindDirect<Ogre::VertexMorphKeyFrame		>::GetSingletonPtr(new cLugreLuaBind_Ogre_VertexMorphKeyFrame(		))->LuaRegister(L);
	cLuaBindDirect<Ogre::VertexPoseKeyFrame		>::GetSingletonPtr(new cLugreLuaBind_Ogre_VertexPoseKeyFrame(		))->LuaRegister(L);
	cLuaBindDirect<Ogre::Image		>::GetSingletonPtr(new cLugreLuaBind_Ogre_Image(		))->LuaRegister(L);
	cLuaBindDirect<Ogre::Texture		>::GetSingletonPtr(new cLugreLuaBind_Ogre_Texture(		))->LuaRegister(L);
	cLuaBindDirect<Ogre::Material		>::GetSingletonPtr(new cLugreLuaBind_Ogre_Material(		))->LuaRegister(L);
	cLuaBindDirect<Ogre::Technique		>::GetSingletonPtr(new cLugreLuaBind_Ogre_Technique(		))->LuaRegister(L);
	cLuaBindDirect<Ogre::Pass		>::GetSingletonPtr(new cLugreLuaBind_Ogre_Pass(		))->LuaRegister(L);
	cLuaBindDirect<Ogre::TextureUnitState		>::GetSingletonPtr(new cLugreLuaBind_Ogre_TextureUnitState(		))->LuaRegister(L);
	cLuaBindDirect<Ogre::RenderOperation	>::GetSingletonPtr(new cLugreLuaBind_Ogre_RenderOperation(		))->LuaRegister(L);
	cLuaBindDirect<Ogre::VertexDeclaration	>::GetSingletonPtr(new cLugreLuaBind_Ogre_VertexDeclaration(	))->LuaRegister(L);
	LUABIND_QUICKWRAP_STATIC(getMaximumDepthInputValue, { return PushNumber(L,Ogre::Root::getSingleton().getRenderSystem()->getMaximumDepthInputValue()); });
}

};
