PageRenderTime 19ms CodeModel.GetById 10ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/src/away3d/debug/data/TridentLines.as

http://github.com/away3d/away3d-core-fp11
ActionScript | 38 lines | 31 code | 7 blank | 0 comment | 2 complexity | f3eae24658e22358030954a6a0f9f3da MD5 | raw file
 1package away3d.debug.data
 2{
 3	import away3d.entities.SegmentSet;
 4	import away3d.primitives.LineSegment;
 5	
 6	import flash.geom.Vector3D;
 7	
 8	public class TridentLines extends SegmentSet
 9	{
10		public function TridentLines(vectors:Vector.<Vector.<Vector3D>>, colors:Vector.<uint>):void
11		{
12			super();
13			build(vectors, colors);
14		}
15		
16		private function build(vectors:Vector.<Vector.<Vector3D>>, colors:Vector.<uint>):void
17		{
18			var letter:Vector.<Vector3D>;
19			var v0:Vector3D;
20			var v1:Vector3D;
21			var color:uint;
22			var j:uint;
23			
24			for (var i:uint = 0; i < vectors.length; ++i) {
25				color = colors[i];
26				letter = vectors[i];
27				
28				for (j = 0; j < letter.length; j += 2) {
29					v0 = letter[j];
30					v1 = letter[j + 1];
31					addSegment(new LineSegment(v0, v1, color, color, 1));
32				}
33			}
34		}
35	
36	}
37}
38