package classes.matuto.mt3d
{
	import classes.away3d.containers.Scene3D;
	import classes.away3d.lights.DirectionalLight3D;
	import classes.away3d.lights.PointLight3D;
	
	import flash.display.Sprite;
	import flash.geom.Vector3D;

	public class MtLuz extends Sprite
	{
		
		private var luz			:PointLight3D;
		private var direcao		:DirectionalLight3D;
		private var cena		:Scene3D
		
		public function MtLuz(_cena			:Scene3D,
							  _x			:Number,
							  _y			:Number,
							  _radius		:Number,
							  _x2			:Number,
							  _y2			:Number,
							  _direction	:Vector3D
							)
			
		{
			
			cena = _cena;
			
			luz         = new PointLight3D();
			luz.x       = _x; 
			luz.y 		= _y;
			luz.radius  = _radius;
			
			direcao     = new DirectionalLight3D(
				{
					x:_x2,
					y:_y2,
					direction:_direction
				});
			
			cena.addLight(direcao);
			cena.addLight(luz);

		}
		
		public function update(_x			:Number,
							  _y			:Number,
							  _radius		:Number,
							  _x2			:Number,
							  _y2			:Number,
							  _direction	:Vector3D
		):void
			
		{
			
			cena.removeLight(luz);
			cena.removeLight(direcao);
			
			luz         = new PointLight3D();
			luz.x       = _x; 
			luz.y 		= _y;
			luz.radius  = _radius;
			
			direcao     = new DirectionalLight3D(
				{
					x:_x2,
					y:_y2,
					direction:_direction
				});
			
			cena.addLight(direcao);
			cena.addLight(luz);
			
			
		}
		
		public function get getLuz():PointLight3D
		{
		  return luz;
		}
		
		public function get getDirecao():DirectionalLight3D
		{
			return direcao;
		}
		
		//var luz:MtLuz = new MtLuz(scene,300,300,1000,-300,-300,new Vector3D(-1,-1,0));

		
		
	
		
	}//end class
}