PageRenderTime 625ms CodeModel.GetById 121ms app.highlight 2ms RepoModel.GetById 451ms app.codeStats 0ms

/src/away3d/core/partition/LightNode.as

http://github.com/away3d/away3d-core-fp11
ActionScript | 42 lines | 25 code | 4 blank | 13 comment | 1 complexity | fcf4246a46352581cd6f3b44655de859 MD5 | raw file
 1package away3d.core.partition
 2{
 3	import away3d.core.traverse.PartitionTraverser;
 4	import away3d.lights.LightBase;
 5	
 6	/**
 7	 * LightNode is a space partitioning leaf node that contains a LightBase object. Used for lights that are not of default supported type.
 8	 */
 9	public class LightNode extends EntityNode
10	{
11		private var _light:LightBase;
12		
13		/**
14		 * Creates a new LightNode object.
15		 * @param light The light to be contained in the node.
16		 */
17		public function LightNode(light:LightBase)
18		{
19			super(light);
20			_light = light;
21		}
22		
23		/**
24		 * The light object contained in this node.
25		 */
26		public function get light():LightBase
27		{
28			return _light;
29		}
30		
31		/**
32		 * @inheritDoc
33		 */
34		override public function acceptTraverser(traverser:PartitionTraverser):void
35		{
36			if (traverser.enterNode(this)) {
37				super.acceptTraverser(traverser);
38				traverser.applyUnknownLight(_light);
39			}
40		}
41	}
42}