//------------------------------------------------------------------------------------
// irr::scene::IAnimatedMeshSceneNode wrappers
//------------------------------------------------------------------------------------

extern "C" 
{

	// do not delete
	IShadowVolumeSceneNode* IrrScene_IAnimatedMeshSceneNode_addShadowVolumeSceneNode(IAnimatedMeshSceneNode* am,const IMesh* shadowMesh = 0, s32 id = -1, bool zfailmethod = true, f32 infinity = 10000.0f)
	{
		if (am)
			return am->addShadowVolumeSceneNode(shadowMesh, id, zfailmethod, infinity);
		else return 0;
	}

	s32 IrrScene_IAnimatedMeshSceneNode_getFrameNr(IAnimatedMeshSceneNode* am)
	{
		if (am)
			return am->getFrameNr();
		else return -1;
	}
	
	// do not delete
	ISceneNode* IrrScene_IAnimatedMeshSceneNode_getMS3DJointNode(IAnimatedMeshSceneNode* am,const c8* jointName)
	{
		if (am)
			return am->getMS3DJointNode(jointName);
		else return 0;
	}
	
	ISceneNode* IrrScene_IAnimatedMeshSceneNode_getXJointNode(IAnimatedMeshSceneNode* am,const c8* jointName)
	{
		if (am)
			return am->getXJointNode(jointName);
		else return 0;
	}
	
	void IrrScene_IAnimatedMeshSceneNode_setAnimationEndCallback(IAnimatedMeshSceneNode* am,IAnimationEndCallBack *callback=0)
	{
		if (am)
			am->setAnimationEndCallback(callback);
	}
	
	void IrrScene_IAnimatedMeshSceneNode_setAnimationSpeed (IAnimatedMeshSceneNode* am,f32 framesPerSecond)
	{
		if (am)
			am->setAnimationSpeed(framesPerSecond);
	}
	
	void IrrScene_IAnimatedMeshSceneNode_setCurrentFrame(IAnimatedMeshSceneNode* am,u32 frame)
	{
		if (am)
			am->setCurrentFrame(frame);
	}
	
	bool IrrScene_IAnimatedMeshSceneNode_setFrameLoop(IAnimatedMeshSceneNode* am,s32 begin, s32 end)
	{
		if (am)
			return am->setFrameLoop(begin,end);
		else return false;
	}
	
	void IrrScene_IAnimatedMeshSceneNode_setLoopMode(IAnimatedMeshSceneNode* am,bool playAnimationLooped)
	{
		if (am)
			am->setLoopMode(playAnimationLooped);
	}
	
	bool IrrScene_IAnimatedMeshSceneNode_setMD2Animation(IAnimatedMeshSceneNode* am,const c8* animationName)
	{
		if (am)
			return am->setMD2Animation(animationName);
		else return false;
	}
	
	bool IrrScene_IAnimatedMeshSceneNode_setMD2AnimationFromType(IAnimatedMeshSceneNode* am,EMD2_ANIMATION_TYPE anim)
	{
		if (am)
			return am->setMD2Animation(anim);
		else return false;
	}
	
	void IrrScene_IAnimatedMeshSceneNode_setReadOnlyMaterials(IAnimatedMeshSceneNode* am,bool readonly)
	{
		if (am)
			am->setReadOnlyMaterials(readonly);
	}

	bool IrrScene_IAnimatedMeshSceneNode_isReadOnlyMaterials(IAnimatedMeshSceneNode* am)
	{
		if (am)
			return am->isReadOnlyMaterials();
		else return false;
	}

	void IrrScene_IAnimatedMeshSceneNode_setMesh(IAnimatedMeshSceneNode* am,IAnimatedMesh* mesh)
	{
		if (am)
			am->setMesh(mesh);
	}
	
	IAnimatedMesh* IrrScene_IAnimatedMeshSceneNode_getMesh(IAnimatedMeshSceneNode* am)
	{
		if (am)
			return am->getMesh();
		else return 0;
	}
	
	s32 IrrScene_IAnimatedMeshSceneNode_getStartFrame(IAnimatedMeshSceneNode* am)
	{
		if (am)
			return am->getStartFrame();
		else return -1;
	}

	s32 IrrScene_IAnimatedMeshSceneNode_getEndFrame(IAnimatedMeshSceneNode* am)
	{
		if (am)
			return am->getEndFrame();
		else return -1;
	}	
	
	const SMD3QuaternionTag* IrrScene_IAnimatedMeshSceneNode_getMD3TagTransformation(IAnimatedMeshSceneNode* am, const c8* tagname)
	{
		if (am)
			return am->getMD3TagTransformation(stringc(tagname));
		else return 0;
	}

	void IrrScene_IAnimatedMeshSceneNode_setJointMode(IAnimatedMeshSceneNode* am, E_JOINT_UPDATE_ON_RENDER mode)
	{
		if (am)
			am->setJointMode(mode);
	}

	void IrrScene_IAnimatedMeshSceneNode_setTransitionTime(IAnimatedMeshSceneNode* am, f32 Time)
	{
		if (am)
			am->setTransitionTime(Time);
	}

	void IrrScene_IAnimatedMeshSceneNode_animateJoints(IAnimatedMeshSceneNode* am, bool CalculateAbsolutePositions=true)
	{
		if (am)
			am->animateJoints(CalculateAbsolutePositions);
	}

	void IrrScene_IAnimatedMeshSceneNode_setRenderFromIdentity(IAnimatedMeshSceneNode* am, bool On ) 
	{
		if (am)
			am->setRenderFromIdentity(On);
	}

	IBoneSceneNode* IrrScene_IAnimatedMeshSceneNode_getJointNodeByName(IAnimatedMeshSceneNode* am,const c8* jointName)
	{
		if (am)
			return am->getJointNode(jointName);
		else return 0;
	}

	IBoneSceneNode* IrrScene_IAnimatedMeshSceneNode_getJointNodeById(IAnimatedMeshSceneNode* am,u32 jointID)
	{
		if (am)
			return am->getJointNode(jointID);
		else return 0;
	}	

	u32 IrrScene_IAnimatedMeshSceneNode_getJointCount(IAnimatedMeshSceneNode* am)
	{
		if (am)
			return am->getJointCount();
		else return 0;
	}
	
	// must delete
	ISceneNode* IrrScene_IAnimatedMeshSceneNode_clone(IAnimatedMeshSceneNode* am, ISceneNode* newParent=0, ISceneManager* newManager=0)
	{
		if (am)
			return am->clone(newParent, newManager);
		else return 0;
	}	

	f32 IrrScene_IAnimatedMeshSceneNode_getAnimationSpeed(IAnimatedMeshSceneNode* am) 
	{
		if (am)
			return am->getAnimationSpeed();
		else return -1;
	}
	
}

