PageRenderTime 192ms CodeModel.GetById 111ms app.highlight 2ms RepoModel.GetById 78ms app.codeStats 0ms

/src/away3d/core/partition/RenderableNode.as

http://github.com/away3d/away3d-core-fp11
ActionScript | 37 lines | 22 code | 4 blank | 11 comment | 1 complexity | 121348a37dc460ac327bcf1a51a6c14d MD5 | raw file
 1package away3d.core.partition
 2{
 3	import away3d.core.base.IRenderable;
 4	import away3d.core.traverse.PartitionTraverser;
 5	import away3d.entities.Entity;
 6	
 7	/**
 8	 * RenderableNode is a space partitioning leaf node that contains any Entity that is itself a IRenderable
 9	 * object. This excludes Mesh (since the renderable objects are its SubMesh children).
10	 */
11	public class RenderableNode extends EntityNode
12	{
13		private var _renderable:IRenderable;
14		
15		/**
16		 * Creates a new RenderableNode object.
17		 * @param mesh The mesh to be contained in the node.
18		 */
19		public function RenderableNode(renderable:IRenderable)
20		{
21			super(Entity(renderable));
22			_renderable = renderable; // also keep a stronger typed reference
23		}
24		
25		/**
26		 * @inheritDoc
27		 */
28		override public function acceptTraverser(traverser:PartitionTraverser):void
29		{
30			if (traverser.enterNode(this)) {
31				super.acceptTraverser(traverser);
32				traverser.applyRenderable(_renderable);
33			}
34		}
35	
36	}
37}