package avatar
{
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.events.EventDispatcher;
	
	import org.papervision3d.materials.BitmapMaterial;

	public class CMaterial extends EventDispatcher
	{
		private var m_id:String;
		private var m_simpleBitmaps:Array;		
		private var m_bitmapData:BitmapData;
		private var m_bitmapMaterial:BitmapMaterial;
		
		public function get bitmapMaterial():BitmapMaterial	{	return m_bitmapMaterial;	}
		public function get id():String						{	return m_id;				}
		
		public function CMaterial( _id:String, _bitmapData:BitmapData )
		{			
			m_id 				= _id;
			m_simpleBitmaps		= new Array();			
			m_bitmapData 		= _bitmapData.clone();
			m_bitmapMaterial	= new BitmapMaterial( m_bitmapData );
			m_bitmapMaterial.interactive = true;
		}
		
		public function addBitmap( _bitmap:Bitmap ):void
		{
			m_bitmapData.draw( _bitmap );
		}		
	}
}