//------------------------------------------------------------------------------------
// irr::scene::SAnimatedMesh wrappers (parent is IAnimatedMesh)
//------------------------------------------------------------------------------------

extern "C" 
{

	SAnimatedMesh* IrrScene_SAnimatedMesh_new()
	{
		return new SAnimatedMesh();
	}

	SAnimatedMesh* IrrScene_SAnimatedMesh_newFromMesh(IMesh* mesh = 0, E_ANIMATED_MESH_TYPE type = EAMT_UNKNOWN)
	{
		return new SAnimatedMesh(mesh, type);
	}
	
	SAnimatedMesh* IrrScene_SAnimatedMesh_del(SAnimatedMesh* am)
	{
		if (am)
			am->drop();
	}
	
	aabbox3d<f32>* IrrScene_SAnimatedMesh_getBoundingBox(SAnimatedMesh* am)
	{
		if (am)
			return new aabbox3d<f32>(am->getBoundingBox());
		else return 0;
	}
	
	void IrrScene_SAnimatedMesh_addMesh(SAnimatedMesh* am,IMesh *mesh)
	{
		if (am)
			am->addMesh(mesh);
	}
	
	u32 IrrScene_SAnimatedMesh_getFrameCount(SAnimatedMesh* am)
	{
		if (am)
			return am->getFrameCount();
		else return 0;
	}
	
	// do not delete this pointer
	IMesh* IrrScene_SAnimatedMesh_getMesh(SAnimatedMesh* am,s32 frame,s32 detailLevel,s32 startFrameLoop=-1,s32 endFrameLoop=-1)
	{
		if (am)
			return am->getMesh(frame,detailLevel,startFrameLoop,endFrameLoop);
		else return 0;
	}
	
	s32 IrrScene_SAnimatedMesh_getMeshType(SAnimatedMesh* am)
	{
		if (am)
			return am->getMeshType();
		else return -1;
	}
	
	void IrrScene_SAnimatedMesh_recalculateBoundingBox(SAnimatedMesh* am)
	{
		if (am)
			am->recalculateBoundingBox();
	}

	void IrrScene_SAnimatedMesh_setBoundingBox(SAnimatedMesh* am,const core::aabbox3df& box)
	{
		if (am)
			am->setBoundingBox(box);
	}
}