//------------------------------------------------------------------------------------
// BMXISceneNode wrappers
//------------------------------------------------------------------------------------


class BMXISceneNode : public ISceneNode
{
public:

	BMXBinder binder;

	BMXBinder* getBinder()
	{
		return &binder;
	}

	//-------------
	// bound method pointers
	//-------------
	void (*BMXISceneNode_addAnimator)(s32 binding,ISceneNodeAnimator* animator);
	void (*BMXISceneNode_addChild)(s32 binding,ISceneNode* child);
	vector3df* (*BMXISceneNode_getAbsolutePosition)(s32 binding);
	matrix4* (*BMXISceneNode_getAbsoluteTransformation)(s32 binding);
	E_CULLING_TYPE (*BMXISceneNode_getAutomaticCulling)(s32 binding);
	aabbox3df* (*BMXISceneNode_getBoundingBox)(s32 binding);
	s32 (*BMXISceneNode_getID)(s32 binding);
	SMaterial* (*BMXISceneNode_getMaterial)(s32 binding,u32 i);
	u32 (*BMXISceneNode_getMaterialCount)(s32 binding);
	const char* (*BMXISceneNode_getName)(s32 binding);
	ISceneNode* (*BMXISceneNode_getParent)(s32 binding);
	vector3df* (*BMXISceneNode_getPosition)(s32 binding);
	matrix4* (*BMXISceneNode_getRelativeTransformation)(s32 binding);
	vector3df* (*BMXISceneNode_getRotation)(s32 binding);
	vector3df* (*BMXISceneNode_getScale)(s32 binding);
	aabbox3d<f32>* (*BMXISceneNode_getTransformedBoundingBox)(s32 binding);
	ITriangleSelector* (*BMXISceneNode_getTriangleSelector)(s32 binding);
	s32 (*BMXISceneNode_isDebugDataVisible)(s32 binding);
	bool (*BMXISceneNode_isVisible)(s32 binding);
	void (*BMXISceneNode_remove)(s32 binding);
	void (*BMXISceneNode_removeAll)(s32 binding);
	void (*BMXISceneNode_removeAnimator)(s32 binding,ISceneNodeAnimator* animator);
	void (*BMXISceneNode_removeAnimators)(s32 binding);
	bool (*BMXISceneNode_removeChild)(s32 binding,ISceneNode* child);
	void (*BMXISceneNode_render)(s32 binding);
	void (*BMXISceneNode_OnRegisterSceneNode)(s32 binding);
	void (*BMXISceneNode_OnAnimate)(s32 binding,u32 timeMs);
	void (*BMXISceneNode_setAutomaticCulling)(s32 binding,E_CULLING_TYPE state);
	void (*BMXISceneNode_setDebugDataVisible)(s32 binding,E_DEBUG_SCENE_TYPE visible);
	void (*BMXISceneNode_setID)(s32 binding,s32 id);
	void (*BMXISceneNode_setMaterialFlag)(s32 binding,E_MATERIAL_FLAG flag,bool newvalue);
	void (*BMXISceneNode_setMaterialTexture)(s32 binding,u32 textureLayer,ITexture* texture);
	void (*BMXISceneNode_setMaterialType)(s32 binding,E_MATERIAL_TYPE newType);
	void (*BMXISceneNode_setMaterial)(s32 binding,s32 i,SMaterial* newmat);
	void (*BMXISceneNode_setName)(s32 binding,const char* name);
	void (*BMXISceneNode_setParent)(s32 binding,ISceneNode* newParent);
	void (*BMXISceneNode_setPosition)(s32 binding,vector3df* newpos);
	void (*BMXISceneNode_setRotation)(s32 binding,vector3df* rotation);
	void (*BMXISceneNode_setScale)(s32 binding,vector3df* scale);
	void (*BMXISceneNode_setTriangleSelector)(s32 binding,ITriangleSelector* selector);
	void (*BMXISceneNode_setVisible)(s32 binding,bool isVisible);
	void (*BMXISceneNode_updateAbsolutePosition)(s32 binding);
	bool (*BMXISceneNode_isDebugObject)(s32 binding);
	void (*BMXISceneNode_setIsDebugObject)(s32 binding,bool debugObject);
	void (*BMXISceneNode_serializeAttributes)(s32 binding,IAttributes* out,SAttributeReadWriteOptions* options);
	void (*BMXISceneNode_deserializeAttributes)(s32 binding,IAttributes* in,SAttributeReadWriteOptions* options);
	ESCENE_NODE_TYPE (*BMXISceneNode_getType)(s32 binding);
	ISceneNode* (*BMXISceneNode_clone)(s32 binding,ISceneNode* newParent, ISceneManager* newManager);
	bool (*BMXISceneNode_isTrulyVisible)(s32 binding);

	//-------------

	BMXISceneNode(
		ISceneNode* parent,
		ISceneManager* mgr, 
		s32 id=-1, 
		const core::vector3df &position=core::vector3df(0, 0, 0), 
		const core::vector3df &rotation=core::vector3df(0, 0, 0), 
		const core::vector3df &scale=core::vector3df(1.0f, 1.0f, 1.0f)) : ISceneNode(parent,mgr,id,position,rotation,scale)
	{
		// initialize the method pointers
		BMXISceneNode_addAnimator=0;
		BMXISceneNode_addChild=0;
		BMXISceneNode_getAbsolutePosition=0;
		BMXISceneNode_getAbsoluteTransformation=0;
		BMXISceneNode_getAutomaticCulling=0;
		BMXISceneNode_getBoundingBox=0;
		BMXISceneNode_getID=0;
		BMXISceneNode_getMaterial=0;
		BMXISceneNode_getMaterialCount=0;
		BMXISceneNode_getName=0;
		BMXISceneNode_getParent=0;
		BMXISceneNode_getPosition=0;
		BMXISceneNode_getRelativeTransformation=0;
		BMXISceneNode_getRotation=0;
		BMXISceneNode_getScale=0;
		BMXISceneNode_getTransformedBoundingBox=0;
		BMXISceneNode_getTriangleSelector=0;
		BMXISceneNode_isDebugDataVisible=0;
		BMXISceneNode_isVisible=0;
		BMXISceneNode_remove=0;
		BMXISceneNode_removeAll=0;
		BMXISceneNode_removeAnimator=0;
		BMXISceneNode_removeAnimators=0;
		BMXISceneNode_removeChild=0;
		BMXISceneNode_render=0;
		BMXISceneNode_OnRegisterSceneNode=0;
		BMXISceneNode_OnAnimate=0;
		BMXISceneNode_setAutomaticCulling=0;
		BMXISceneNode_setDebugDataVisible=0;
		BMXISceneNode_setID=0;
		BMXISceneNode_setMaterialFlag=0;
		BMXISceneNode_setMaterialTexture=0;
		BMXISceneNode_setMaterialType=0;
		BMXISceneNode_setMaterial=0;
		BMXISceneNode_setName=0;
		BMXISceneNode_setParent=0;
		BMXISceneNode_setPosition=0;
		BMXISceneNode_setRotation=0;
		BMXISceneNode_setScale=0;
		BMXISceneNode_setTriangleSelector=0;
		BMXISceneNode_setVisible=0;
		BMXISceneNode_updateAbsolutePosition=0;
		BMXISceneNode_isDebugObject=0;
		BMXISceneNode_setIsDebugObject=0;
		BMXISceneNode_serializeAttributes=0;
		BMXISceneNode_deserializeAttributes=0;
		BMXISceneNode_getType=0;
		BMXISceneNode_clone=0;
		BMXISceneNode_isTrulyVisible=0;
	}

	void render()
	{
		if (BMXISceneNode_render)
			BMXISceneNode_render(binder.binding);
	};

	void addAnimator(ISceneNodeAnimator *animator)
	{
		if (BMXISceneNode_addAnimator)
			BMXISceneNode_addAnimator(binder.binding,animator);
		else ISceneNode::addAnimator(animator);
	}

	void addChild(ISceneNode *child)
	{
		if (BMXISceneNode_addChild)
			BMXISceneNode_addChild(binder.binding,child);
		else ISceneNode::addChild(child);
	}
	
	vector3df getAbsolutePosition() const
	{
		if (BMXISceneNode_getAbsolutePosition) {
			vector3df retval=*BMXISceneNode_getAbsolutePosition(binder.binding);
			return retval;
		} else return ISceneNode::getAbsolutePosition();
	}

	const matrix4& getAbsoluteTransformation()
	{
		if (BMXISceneNode_getAbsoluteTransformation)
			return *BMXISceneNode_getAbsoluteTransformation(binder.binding);
		else return ISceneNode::getAbsoluteTransformation();
	}

	const aabbox3df& getBoundingBox() const
	{
		if (BMXISceneNode_getBoundingBox)
			return *BMXISceneNode_getBoundingBox(binder.binding);
	}

	E_CULLING_TYPE getAutomaticCulling() const
	{
		if (BMXISceneNode_getAutomaticCulling)
			return BMXISceneNode_getAutomaticCulling(binder.binding);
		else return ISceneNode::getAutomaticCulling();
	}

	s32 getID()
	{
		if (BMXISceneNode_getID)
			return BMXISceneNode_getID(binder.binding);
		else return ISceneNode::getID();
	}

	SMaterial& getMaterial(u32 i)
	{
		if (BMXISceneNode_getMaterial)
			return *BMXISceneNode_getMaterial(binder.binding,i);
		else return ISceneNode::getMaterial(i);
	}

	u32 getMaterialCount()
	{
		if (BMXISceneNode_getMaterialCount)
			return BMXISceneNode_getMaterialCount(binder.binding);
		else return ISceneNode::getMaterialCount();
	}

	const char* getName() const
	{
		if (BMXISceneNode_getName)
			return BMXISceneNode_getName(binder.binding);
		else return ISceneNode::getName();
	}

	ESCENE_NODE_TYPE getType()
	{
		if (BMXISceneNode_getType)
			return BMXISceneNode_getType(binder.binding);
		else return ISceneNode::getType();
	}

	ISceneNode* getParent()
	{
		if (BMXISceneNode_getParent)
			return BMXISceneNode_getParent(binder.binding);
		else return ISceneNode::getParent();
	}

	const vector3df& getPosition() const
	{
		if (BMXISceneNode_getPosition) {
			vector3df retval=*BMXISceneNode_getPosition(binder.binding);
			return retval;
		} else return ISceneNode::getPosition();
	}

	matrix4 getRelativeTransformation() const
	{
		if (BMXISceneNode_getRelativeTransformation) {
			matrix4 retval=*BMXISceneNode_getRelativeTransformation(binder.binding);
			return retval;
		} else return ISceneNode::getRelativeTransformation();
	}

	const vector3df& getRotation() const
	{
		if (BMXISceneNode_getRotation) {
			vector3df retval=*BMXISceneNode_getRotation(binder.binding);
			return retval;
		} else return ISceneNode::getRotation();
	}

	const vector3df& getScale() const
	{
		if (BMXISceneNode_getScale) {
			vector3df retval=*BMXISceneNode_getScale(binder.binding);
			return retval;
		} else return ISceneNode::getScale();
	}

	aabbox3df getTransformedBoundingBox()
	{
		if (BMXISceneNode_getTransformedBoundingBox) {
			aabbox3df retval=*BMXISceneNode_getTransformedBoundingBox(binder.binding);
			return retval;
		} else return ISceneNode::getTransformedBoundingBox();
	}

	ITriangleSelector* getTriangleSelector() const
	{
		if (BMXISceneNode_getTriangleSelector)
			return BMXISceneNode_getTriangleSelector(binder.binding);
		else return ISceneNode::getTriangleSelector();
	}

	s32 isDebugDataVisible()
	{
		if (BMXISceneNode_isDebugDataVisible)
			return BMXISceneNode_isDebugDataVisible(binder.binding);
		else return ISceneNode::isDebugDataVisible();
	}

	bool isVisible()
	{
		if (BMXISceneNode_isVisible)
			return BMXISceneNode_isVisible(binder.binding);
		else return ISceneNode::isVisible();
	}

	void OnRegisterSceneNode()
	{
		if (BMXISceneNode_OnRegisterSceneNode)
			BMXISceneNode_OnRegisterSceneNode(binder.binding);
		else ISceneNode::OnRegisterSceneNode();
	}

	void OnAnimate(u32 timeMs)
	{
		if (BMXISceneNode_OnAnimate)
			BMXISceneNode_OnAnimate(binder.binding,timeMs);
		else ISceneNode::OnAnimate(timeMs);
	}

	void remove()
	{
		if (BMXISceneNode_remove)
			BMXISceneNode_remove(binder.binding);
		else ISceneNode::remove();
	}

	void removeAll()
	{
		if (BMXISceneNode_removeAll)
			BMXISceneNode_removeAll(binder.binding);
		else ISceneNode::removeAll();
	}

	void removeAnimator(ISceneNodeAnimator *animator)
	{
		if (BMXISceneNode_removeAnimator)
			BMXISceneNode_removeAnimator(binder.binding,animator);
		else ISceneNode::removeAnimator(animator);
	}
	
	void removeAnimators()
	{
		if (BMXISceneNode_removeAnimators)
			BMXISceneNode_removeAnimators(binder.binding);
		else ISceneNode::removeAnimators();
	}

	bool removeChild(ISceneNode *child) 
	{
		if (BMXISceneNode_removeChild)
			return BMXISceneNode_removeChild(binder.binding,child);
		else return ISceneNode::removeChild(child);
	}

	void setAutomaticCulling(E_CULLING_TYPE state)
	{
		if (BMXISceneNode_setAutomaticCulling)
			BMXISceneNode_setAutomaticCulling(binder.binding,state);
		else ISceneNode::setAutomaticCulling(state);
	}

	void setDebugDataVisible(E_DEBUG_SCENE_TYPE visible)
	{
		if (BMXISceneNode_setDebugDataVisible)
			BMXISceneNode_setDebugDataVisible(binder.binding,visible);
		else ISceneNode::setDebugDataVisible(visible);
	}

	void setID(s32 id)
	{
		if (BMXISceneNode_setID)
			BMXISceneNode_setID(binder.binding,id);
		else ISceneNode::setID(id);
	}

	void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue)
	{
		if (BMXISceneNode_setMaterialFlag)
			BMXISceneNode_setMaterialFlag(binder.binding,flag,newvalue);
		else ISceneNode::setMaterialFlag(flag,newvalue);
	}

	void setMaterialTexture(u32 textureLayer, video::ITexture *texture) 
	{
		if (BMXISceneNode_setMaterialTexture)
			BMXISceneNode_setMaterialTexture(binder.binding,textureLayer,texture);
		else ISceneNode::setMaterialTexture(textureLayer,texture);
	}

	void setMaterialType(video::E_MATERIAL_TYPE newType)
	{
		if (BMXISceneNode_setMaterialType)
			BMXISceneNode_setMaterialType(binder.binding,newType);
		else ISceneNode::setMaterialType(newType);
	}

	void setName(const char* name)
	{
		if (BMXISceneNode_setName)
			BMXISceneNode_setName(binder.binding,name);
		else ISceneNode::setName(name);
	}

	void setParent(ISceneNode *newParent=0)
	{
		if (BMXISceneNode_setParent)
			BMXISceneNode_setParent(binder.binding,newParent);
		else ISceneNode::setParent(newParent);
	}

	void setPosition(const core::vector3df &newpos)
	{
		if (BMXISceneNode_setPosition)
			BMXISceneNode_setPosition(binder.binding,(vector3df*)&newpos);
		else ISceneNode::setPosition(newpos);

	}

	void setRotation(const core::vector3df &rotation)
	{
		if (BMXISceneNode_setRotation)
			BMXISceneNode_setRotation(binder.binding,(vector3df*)&rotation);
		else ISceneNode::setRotation(rotation);
	}

	void setScale(const core::vector3df &scale)
	{
		if (BMXISceneNode_setScale)
			BMXISceneNode_setScale(binder.binding,(vector3df*)&scale);
		else ISceneNode::setScale(scale);
	}

	void setTriangleSelector(ITriangleSelector *selector)
	{
		if (BMXISceneNode_setTriangleSelector)
			BMXISceneNode_setTriangleSelector(binder.binding,selector);
		else ISceneNode::setTriangleSelector(selector);
	}

	void setVisible(bool isVisible)
	{
		if (BMXISceneNode_setVisible)
			BMXISceneNode_setVisible(binder.binding,isVisible);
		else ISceneNode::setVisible(isVisible);
	}

	void updateAbsolutePosition()
	{
		if (BMXISceneNode_updateAbsolutePosition)
			BMXISceneNode_updateAbsolutePosition(binder.binding);
		else ISceneNode::updateAbsolutePosition();
	}
	
	ISceneManager* getSceneManager()
	{
		return SceneManager;
	}

	bool isDebugObject()
	{
		if (BMXISceneNode_isDebugObject)
			return BMXISceneNode_isDebugObject(binder.binding);
		else return ISceneNode::isDebugObject();
	}
	
	void setIsDebugObject(bool debugObject)
	{
		if (BMXISceneNode_setIsDebugObject)
			BMXISceneNode_setIsDebugObject(binder.binding,debugObject);
		else ISceneNode::setIsDebugObject(debugObject);
	}

	void serializeAttributes(IAttributes* out,SAttributeReadWriteOptions* options=0)
	{
		if (BMXISceneNode_serializeAttributes)
			BMXISceneNode_serializeAttributes(binder.binding,out,options);
		else ISceneNode::serializeAttributes(out,options);
	}		
	
	void deserializeAttributes(IAttributes* in,SAttributeReadWriteOptions* options=0)
	{
		if (BMXISceneNode_deserializeAttributes)
			BMXISceneNode_deserializeAttributes(binder.binding,in,options);
		else ISceneNode::deserializeAttributes(in,options);
	}
	
	ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0)
	{
		if (BMXISceneNode_clone)
			return BMXISceneNode_clone(binder.binding,newParent,newManager);
		else return ISceneNode::clone(newParent,newManager);
	}

	bool isTrulyVisible()
	{
		if (BMXISceneNode_isTrulyVisible)
			return BMXISceneNode_isTrulyVisible(binder.binding);
		else return ISceneNode::isTrulyVisible();
	}

};

extern "C" 
{

	BMXBinder* BMXISceneNode_getBinder(BMXISceneNode* sn)
	{
		if (sn)
			return sn->getBinder();
		else return 0;
	}
	
	//-------------
	// binding functions
	//-------------
	void BMXISceneNode_bindAddAnimator(BMXISceneNode* sn,void (*bind_addAnimator)(s32 binding,ISceneNodeAnimator* animator))
	{
		if (sn)
			sn->BMXISceneNode_addAnimator=bind_addAnimator;
	};
	void BMXISceneNode_bindAddChild(BMXISceneNode* sn,void (*bind_addChild)(s32 binding,ISceneNode* child))
	{
		if (sn)
			sn->BMXISceneNode_addChild=bind_addChild;	
	};
	void BMXISceneNode_bindGetAbsolutePosition(BMXISceneNode* sn,vector3df* (*bind_getAbsolutePosition)(s32 binding))
	{
		if (sn)
			sn->BMXISceneNode_getAbsolutePosition=bind_getAbsolutePosition;
	};
	void BMXISceneNode_bindGetAbsoluteTransformation(BMXISceneNode* sn,matrix4* (*bind_getAbsoluteTransformation)(s32 binding))
	{
		if (sn)
			sn->BMXISceneNode_getAbsoluteTransformation=bind_getAbsoluteTransformation;	
	};
	void BMXISceneNode_bindGetAutomaticCulling(BMXISceneNode* sn,E_CULLING_TYPE (*bind_getAutomaticCulling)(s32 binding))
	{
		if (sn)
			sn->BMXISceneNode_getAutomaticCulling=bind_getAutomaticCulling;
	};
	void BMXISceneNode_bindGetBoundingBox(BMXISceneNode* sn,aabbox3df* (*bind_getBoundingBox)(s32 binding))
	{
		if (sn)
			sn->BMXISceneNode_getBoundingBox=bind_getBoundingBox;	
	};
	void BMXISceneNode_bindGetID(BMXISceneNode* sn,s32 (*bind_getID)(s32 binding))
	{
		if (sn)
			sn->BMXISceneNode_getID=bind_getID;	
	};
	void BMXISceneNode_bindGetMaterial(BMXISceneNode* sn,SMaterial* (*bind_getMaterial)(s32 binding,u32 i))
	{
		if (sn)
			sn->BMXISceneNode_getMaterial=bind_getMaterial;	
	};
	void BMXISceneNode_bindGetMaterialCount(BMXISceneNode* sn,u32 (*bind_getMaterialCount)(s32 binding))
	{
		if (sn)
			sn->BMXISceneNode_getMaterialCount=bind_getMaterialCount;	
	};
	void BMXISceneNode_bindGetName(BMXISceneNode* sn,const char* (*bind_getName)(s32 binding))
	{
		if (sn)
			sn->BMXISceneNode_getName=bind_getName;	
	};
	ESCENE_NODE_TYPE BMXISceneNode_bindGetType(BMXISceneNode* sn,ESCENE_NODE_TYPE (*bind_getType)(s32 binding))
	{
		if (sn)
			sn->BMXISceneNode_getType=bind_getType;	
	};
	void BMXISceneNode_bindGetParent(BMXISceneNode* sn,ISceneNode* (*bind_getParent)(s32 binding))
	{
		if (sn)
			sn->BMXISceneNode_getParent=bind_getParent;
	};
	void BMXISceneNode_bindGetPosition(BMXISceneNode* sn,vector3df* (*bind_getPosition)(s32 binding))
	{
		if (sn)
			sn->BMXISceneNode_getPosition=bind_getPosition;	
	};
	void BMXISceneNode_bindGetRelativeTransformation(BMXISceneNode* sn,matrix4* (*bind_getRelativeTransformation)(s32 binding))
	{
		if (sn)
			sn->BMXISceneNode_getRelativeTransformation=bind_getRelativeTransformation;	
	};
	void BMXISceneNode_bindGetRotation(BMXISceneNode* sn,vector3df* (*bind_getRotation)(s32 binding))
	{
		if (sn)
			sn->BMXISceneNode_getRotation=bind_getRotation;	
	};
	void BMXISceneNode_bindGetScale(BMXISceneNode* sn,vector3df* (*bind_getScale)(s32 binding))
	{
		if (sn)
			sn->BMXISceneNode_getScale=bind_getScale;
	};
	void BMXISceneNode_bindGetTransformedBoundingBox(BMXISceneNode* sn,aabbox3d<f32>* (*bind_getTransformedBoundingBox)(s32 binding))
	{
		if (sn)
			sn->BMXISceneNode_getTransformedBoundingBox=bind_getTransformedBoundingBox;	
	};
	void BMXISceneNode_bindGetTriangleSelector(BMXISceneNode* sn,ITriangleSelector* (*bind_getTriangleSelector)(s32 binding))
	{
		if (sn)
			sn->BMXISceneNode_getTriangleSelector=bind_getTriangleSelector;
	};
	void BMXISceneNode_bindIsDebugDataVisible(BMXISceneNode* sn,s32 (*bind_isDebugDataVisible)(s32 binding))
	{
		if (sn)
			sn->BMXISceneNode_isDebugDataVisible=bind_isDebugDataVisible;
	};
	void BMXISceneNode_bindIsVisible(BMXISceneNode* sn,bool (*bind_isVisible)(s32 binding))
	{
		if (sn)
			sn->BMXISceneNode_isVisible=bind_isVisible;	
	};
	void BMXISceneNode_bindRemove(BMXISceneNode* sn,void (*bind_remove)(s32 binding))
	{
		if (sn)
			sn->BMXISceneNode_remove=bind_remove;
	};
	void BMXISceneNode_bindRemoveAll(BMXISceneNode* sn,void (*bind_removeAll)(s32 binding))
	{
		if (sn)
			sn->BMXISceneNode_removeAll=bind_removeAll;
	};
	void BMXISceneNode_bindRemoveAnimator(BMXISceneNode* sn,void (*bind_removeAnimator)(s32 binding,ISceneNodeAnimator* animator))
	{
		if (sn)
			sn->BMXISceneNode_removeAnimator=bind_removeAnimator;
	};
	void BMXISceneNode_bindRemoveAnimators(BMXISceneNode* sn,void (*bind_removeAnimators)(s32 binding))
	{
		if (sn)
			sn->BMXISceneNode_removeAnimators=bind_removeAnimators;
	};
	void BMXISceneNode_bindRemoveChild(BMXISceneNode* sn,bool (*bind_removeChild)(s32 binding,ISceneNode* child))
	{
		if (sn)
			sn->BMXISceneNode_removeChild=bind_removeChild;
	};
	void BMXISceneNode_bindOnRegisterSceneNode(BMXISceneNode* sn,void (*bind_OnRegisterSceneNode)(s32 binding))
	{
		if (sn)
			sn->BMXISceneNode_OnRegisterSceneNode=bind_OnRegisterSceneNode;
	};
	void BMXISceneNode_bindOnAnimate(BMXISceneNode* sn,void (*bind_OnAnimate)(s32 binding,u32 timeMs))
	{
		if (sn)
			sn->BMXISceneNode_OnAnimate=bind_OnAnimate;
	};
	void BMXISceneNode_bindRender(BMXISceneNode* sn,void (*bind_render)(s32 binding))
	{
		if (sn)
			sn->BMXISceneNode_render=bind_render;
	};
	void BMXISceneNode_bindSetAutomaticCulling(BMXISceneNode* sn,void (*bind_setAutomaticCulling)(s32 binding,E_CULLING_TYPE state))
	{
		if (sn)
			sn->BMXISceneNode_setAutomaticCulling=bind_setAutomaticCulling;
	};
	void BMXISceneNode_bindSetDebugDataVisible(BMXISceneNode* sn,void (*bind_setDebugDataVisible)(s32 binding,E_DEBUG_SCENE_TYPE visible))
	{
		if (sn)
			sn->BMXISceneNode_setDebugDataVisible=bind_setDebugDataVisible;
	};
	void BMXISceneNode_bindSetID(BMXISceneNode* sn,void (*bind_setID)(s32 binding,s32 id))
	{
		if (sn)
			sn->BMXISceneNode_setID=bind_setID;
	};
	void BMXISceneNode_bindSetMaterialFlag(BMXISceneNode* sn,void (*bind_setMaterialFlag)(s32 binding,E_MATERIAL_FLAG flag,bool newvalue))
	{
		if (sn)
			sn->BMXISceneNode_setMaterialFlag=bind_setMaterialFlag;
	};
	void BMXISceneNode_bindSetMaterialTexture(BMXISceneNode* sn,void (*bind_setMaterialTexture)(s32 binding,u32 textureLayer,ITexture* texture))
	{
		if (sn)
			sn->BMXISceneNode_setMaterialTexture=bind_setMaterialTexture;
	};
	void BMXISceneNode_bindSetMaterialType(BMXISceneNode* sn,void (*bind_setMaterialType)(s32 binding,E_MATERIAL_TYPE newType))
	{
		if (sn)
			sn->BMXISceneNode_setMaterialType=bind_setMaterialType;
	};
	void BMXISceneNode_bindSetMaterial(BMXISceneNode* sn,void (*bind_setMaterial)(s32 binding,s32 i,SMaterial* newmat))
	{
		if (sn)
			sn->BMXISceneNode_setMaterial=bind_setMaterial;
	};
	void BMXISceneNode_bindSetName(BMXISceneNode* sn,void (*bind_setName)(s32 binding,const char* name))
	{
		if (sn)
			sn->BMXISceneNode_setName=bind_setName;
	};
	void BMXISceneNode_bindSetParent(BMXISceneNode* sn,void (*bind_setParent)(s32 binding,ISceneNode* newParent))
	{
		if (sn)
			sn->BMXISceneNode_setParent=bind_setParent;
	};
	void BMXISceneNode_bindSetPosition(BMXISceneNode* sn,void (*bind_setPosition)(s32 binding,vector3df* newpos))
	{
		if (sn)
			sn->BMXISceneNode_setPosition=bind_setPosition;
	};
	void BMXISceneNode_bindSetRotation(BMXISceneNode* sn,void (*bind_setRotation)(s32 binding,vector3df* rotation))
	{
		if (sn)
			sn->BMXISceneNode_setRotation=bind_setRotation;
	};
	void BMXISceneNode_bindSetScale(BMXISceneNode* sn,void (*bind_setScale)(s32 binding,vector3df* scale))
	{
		if (sn)
			sn->BMXISceneNode_setScale=bind_setScale;
	};
	void BMXISceneNode_bindSetTriangleSelector(BMXISceneNode* sn,void (*bind_setTriangleSelector)(s32 binding,ITriangleSelector* selector))
	{
		if (sn)
			sn->BMXISceneNode_setTriangleSelector=bind_setTriangleSelector;
	};
	void BMXISceneNode_bindSetVisible(BMXISceneNode* sn,void (*bind_setVisible)(s32 binding,bool isVisible))
	{
		if (sn)
			sn->BMXISceneNode_setVisible=bind_setVisible;
	};
	void BMXISceneNode_bindUpdateAbsolutePosition(BMXISceneNode* sn,void (*bind_updateAbsolutePosition)(s32 binding))
	{
		if (sn)
			sn->BMXISceneNode_updateAbsolutePosition=bind_updateAbsolutePosition;
	};
	void BMXISceneNode_bindIsDebugObject(BMXISceneNode* sn,bool (*bind_isDebugObject)(s32 binding))
	{
		if (sn)
			sn->BMXISceneNode_isDebugObject=bind_isDebugObject;
	}
	
	void BMXISceneNode_bindSetIsDebugObject(BMXISceneNode* sn,void (*bind_setIsDebugObject)(s32 binding,bool debugObject))
	{
		if (sn)
			sn->BMXISceneNode_setIsDebugObject=bind_setIsDebugObject;
	}
	void BMXISceneNode_bindSerializeAttributes(BMXISceneNode* sn,void (*bind_serializeAttributes)(s32 binding,IAttributes* out,SAttributeReadWriteOptions* options))
	{
		if (sn)
			sn->BMXISceneNode_serializeAttributes=bind_serializeAttributes;
	}
	void BMXISceneNode_bindDeserializeAttributes(BMXISceneNode* sn,void (*bind_deserializeAttributes)(s32 binding,IAttributes* in,SAttributeReadWriteOptions* options))
	{
		if (sn)
			sn->BMXISceneNode_deserializeAttributes=bind_deserializeAttributes;
	}

	void BMXISceneNode_bindClone(BMXISceneNode* sn,ISceneNode* (*bind_clone)(s32 binding,ISceneNode* newParent, ISceneManager* newManager))
	{
		if (sn)
			sn->BMXISceneNode_clone=bind_clone;
	}

	void BMXISceneNode_bindIsTrulyVisible(BMXISceneNode* sn,bool (*bind_isTrulyVisible)(s32 binding))
	{
		if (sn)
			sn->BMXISceneNode_isTrulyVisible=bind_isTrulyVisible;	
	};
	
	//-------------
	
	BMXISceneNode* BMXISceneNode_new(ISceneNode *parent,ISceneManager *mgr,s32 id=-1,vector3df* pos=0,vector3df* rot=0,vector3df* scale=0)
	{
		BMXISceneNode* pRetVal=0;
	
		bool delR=false;
		if (!rot) {
			rot=new vector3df(0,0,0);
			delR=true;
		}
		bool delP=false;
		if (!pos) {
			pos=new vector3df(0,0,0);
			delP=true;
		}
		bool delS=false;
		if (!scale) {
			scale=new vector3df(1.0f,1.0f,1.0f);
			delS=true;
		}
	
		pRetVal=new BMXISceneNode(parent,mgr,id,*pos,*rot,*scale);
	
		if (delR) delete rot;
		if (delP) delete pos;
		if (delS) delete scale;
		
		return pRetVal;
	}
	
	//-------------
	// functions to call the base ISceneNode version of the methods
	//-------------
	void BMXISceneNode_addAnimator(BMXISceneNode* sn,ISceneNodeAnimator* animator)
	{
		if (sn)
			sn->ISceneNode::addAnimator(animator);
	}
	
	void BMXISceneNode_addChild(BMXISceneNode* sn,ISceneNode* child)
	{
		if (sn)
			sn->ISceneNode::addChild(child);
	}
	
	vector3df* BMXISceneNode_getAbsolutePosition(BMXISceneNode* sn)
	{
		if (sn)
			return new vector3df(sn->ISceneNode::getAbsolutePosition());
		else return 0;
	}
	
	// do not delete this pointer
	matrix4* BMXISceneNode_getAbsoluteTransformation(BMXISceneNode* sn)
	{
		if (sn)
			return new matrix4(sn->ISceneNode::getAbsoluteTransformation());
		else return 0;
	}
	
	// do not delete this pointer
	ISceneManager* BMXISceneNode_getSceneManager(BMXISceneNode* sn)
	{
		if (sn)
			return sn->getSceneManager();
		else return 0;
	}
	
	s32 BMXISceneNode_getAutomaticCulling(BMXISceneNode* sn)
	{
		if (sn)
			return sn->ISceneNode::getAutomaticCulling();
		else return -1;
	}
	
	// getBoundingBox is implemented in BMAX
	/*
	aabbox3df* BMXISceneNode_getBoundingBox(BMXISceneNode* sn)
	{
		if (sn)
			return new aabbox3df(sn->ISceneNode::getBoundingBox());
		else return 0;
	}
	*/
	
	s32 BMXISceneNode_getID(BMXISceneNode* sn)
	{
		if (sn)
			return sn->ISceneNode::getID();
		else return -1;
	}
	
	// do not delete this pointer
	SMaterial* BMXISceneNode_getMaterial(BMXISceneNode* sn,u32 i)
	{
		if (sn)
			return &sn->ISceneNode::getMaterial(i);
		else return 0;
	}
	
	u32 BMXISceneNode_getMaterialCount(BMXISceneNode* sn)
	{
		if (sn)
			return sn->ISceneNode::getMaterialCount();
		else return 0;
	}
	
	const char* BMXISceneNode_getName(BMXISceneNode* sn)
	{
		if (sn)
			return sn->ISceneNode::getName();
		else return "";
	}
	
	ESCENE_NODE_TYPE BMXISceneNode_getType(BMXISceneNode* sn)
	{
		if (sn)
			return sn->ISceneNode::getType();
		else return ESNT_UNKNOWN;
	}
	
	// do not delete this pointer
	ISceneNode* BMXISceneNode_getParent(BMXISceneNode* sn)
	{
		if (sn)
			return sn->ISceneNode::getParent();
		else return 0;
	}
	
	vector3df* BMXISceneNode_getPosition(BMXISceneNode* sn)
	{
		if (sn)
			return new vector3df(sn->ISceneNode::getPosition());
		else return 0;
	}
	
	matrix4* BMXISceneNode_getRelativeTransformation(BMXISceneNode* sn)
	{
		if (sn)
			return new matrix4(sn->ISceneNode::getRelativeTransformation());
		else return 0;
	}
	
	vector3df* BMXISceneNode_getRotation(BMXISceneNode* sn)
	{
		if (sn)
			return new vector3df(sn->ISceneNode::getRotation());
		else return 0;
	}
	
	vector3df* BMXISceneNode_getScale(BMXISceneNode* sn)
	{
		if (sn)
			return new vector3df(sn->ISceneNode::getScale());
		else return 0;
	}
	
	aabbox3d<f32>* BMXISceneNode_getTransformedBoundingBox(BMXISceneNode* sn)
	{
		if (sn)
			return new aabbox3d<f32>(sn->ISceneNode::getTransformedBoundingBox());
		else return 0;
	}
	
	ITriangleSelector* BMXISceneNode_getTriangleSelector(BMXISceneNode* sn)
	{
		if (sn)
			return sn->ISceneNode::getTriangleSelector();
		else return 0;
	}
	
	s32 BMXISceneNode_isDebugDataVisible(BMXISceneNode* sn)
	{
		if (sn)
			return sn->ISceneNode::isDebugDataVisible();
		else return -1;
	}
	
	bool BMXISceneNode_isVisible(BMXISceneNode* sn)
	{
		if (sn)
			return sn->ISceneNode::isVisible();
		else return false;
	}
	
	void BMXISceneNode_remove(BMXISceneNode* sn)
	{
		if (sn)
			sn->ISceneNode::remove();
	}
	
	void BMXISceneNode_removeAll(BMXISceneNode* sn)
	{
		if (sn)
			sn->ISceneNode::removeAll();
	}
	
	void BMXISceneNode_removeAnimator(BMXISceneNode* sn,ISceneNodeAnimator* animator)
	{
		if (sn)
			sn->ISceneNode::removeAnimator(animator);
	}
	
	void BMXISceneNode_removeAnimators(BMXISceneNode* sn)
	{
		if (sn)
			sn->ISceneNode::removeAnimators();
	}
	
	bool BMXISceneNode_removeChild(BMXISceneNode* sn,ISceneNode* child)
	{
		if (sn)
			return sn->ISceneNode::removeChild(child);
		else return false;
	}
	
	void BMXISceneNode_OnRegisterSceneNode(BMXISceneNode* sn)
	{
		if (sn)
			sn->ISceneNode::OnRegisterSceneNode();
	}
	
	void BMXISceneNode_OnAnimate(BMXISceneNode* sn,u32 timeMs)
	{
		if (sn)
			sn->ISceneNode::OnAnimate(timeMs);
	}
	
	// render is implemented in BMAX
	/*
	void BMXISceneNode_render(BMXISceneNode* sn)
	{
		if (sn)
			sn->ISceneNode::render();
	}
	*/
	
	void BMXISceneNode_setAutomaticCulling(BMXISceneNode* sn,E_CULLING_TYPE state)
	{
		if (sn)
			sn->ISceneNode::setAutomaticCulling(state);
	}
	
	void BMXISceneNode_setDebugDataVisible(BMXISceneNode* sn,E_DEBUG_SCENE_TYPE visible)
	{
		if (sn)
			sn->ISceneNode::setDebugDataVisible(visible);
	}
	
	void BMXISceneNode_setID(BMXISceneNode* sn,s32 id)
	{
		if (sn)
			sn->ISceneNode::setID(id);
	}
	
	void BMXISceneNode_setMaterialFlag(BMXISceneNode* sn,E_MATERIAL_FLAG flag,bool newvalue)
	{
		if (sn)
			sn->ISceneNode::setMaterialFlag(flag,newvalue);
	}
	
	void BMXISceneNode_setMaterialTexture(BMXISceneNode* sn,u32 textureLayer,ITexture* texture)
	{
		if (sn)
			sn->ISceneNode::setMaterialTexture(textureLayer,texture);
	}
	
	void BMXISceneNode_setMaterialType(BMXISceneNode* sn,E_MATERIAL_TYPE newType)
	{
		if (sn)
			sn->ISceneNode::setMaterialType(newType);
	}
	
	void BMXISceneNode_setMaterial(BMXISceneNode* sn,s32 i,SMaterial* newmat)
	{
		if (sn)
			sn->ISceneNode::getMaterial(i)=*newmat;
	}
	
	void BMXISceneNode_setName(BMXISceneNode* sn,const char* name)
	{
		if (sn)
			sn->ISceneNode::setName(name);
	}
	
	void BMXISceneNode_setParent(BMXISceneNode* sn,ISceneNode* newParent=0)
	{
		if (sn)
			sn->ISceneNode::setParent(newParent);
	}
	
	void BMXISceneNode_setPosition(BMXISceneNode* sn,vector3df* newpos)
	{
		if (sn)
			sn->ISceneNode::setPosition(*newpos);
	}
	
	void BMXISceneNode_setRotation(BMXISceneNode* sn,vector3df* rotation)
	{
		if (sn)
			sn->ISceneNode::setRotation(*rotation);
	}
	
	void BMXISceneNode_setScale(BMXISceneNode* sn,vector3df* scale)
	{
		if (sn)
			sn->ISceneNode::setScale(*scale);
	}
	
	void BMXISceneNode_setTriangleSelector(BMXISceneNode* sn,ITriangleSelector* selector)
	{
		if (sn)
			sn->ISceneNode::setTriangleSelector(selector);
	}
	
	void BMXISceneNode_setVisible(BMXISceneNode* sn,bool isVisible)
	{
		if (sn)
			sn->ISceneNode::setVisible(isVisible);
	}
	
	void BMXISceneNode_updateAbsolutePosition(BMXISceneNode* sn)
	{
		if (sn)
			sn->ISceneNode::updateAbsolutePosition();
	}
	
	bool BMXISceneNode_isDebugObject(BMXISceneNode* sn)
	{
		if (sn)
			return sn->ISceneNode::isDebugObject();
	}
	
	void BMXISceneNode_setIsDebugObject(BMXISceneNode* sn,bool debugObject)
	{
		if (sn)
			sn->ISceneNode::setIsDebugObject(debugObject);
	}
	
	void BMXISceneNode_serializeAttributes(BMXISceneNode* sn,IAttributes* out,SAttributeReadWriteOptions* options=0)
	{
		if (sn)
			sn->ISceneNode::serializeAttributes(out,options);
	}
	
	void BMXISceneNode_deserializeAttributes(BMXISceneNode* sn,IAttributes* in,SAttributeReadWriteOptions* options=0)
	{
		if (sn)
			sn->ISceneNode::serializeAttributes(in,options);
	}
	
	
	ISceneNode* BMXISceneNode_clone(BMXISceneNode* sn,ISceneNode* newParent=0, ISceneManager* newManager=0)
	{
		if (sn)
			return sn->ISceneNode::clone(newParent,newManager);
		else return 0;
	}	

	bool BMXISceneNode_isTrulyVisible(BMXISceneNode* sn)
	{
		if (sn)
			return sn->ISceneNode::isTrulyVisible();
		else return false;
	}
}