/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

  1. package away3d.debug.data
  2. {
  3. import away3d.entities.SegmentSet;
  4. import away3d.primitives.LineSegment;
  5. import flash.geom.Vector3D;
  6. public class TridentLines extends SegmentSet
  7. {
  8. public function TridentLines(vectors:Vector.<Vector.<Vector3D>>, colors:Vector.<uint>):void
  9. {
  10. super();
  11. build(vectors, colors);
  12. }
  13. private function build(vectors:Vector.<Vector.<Vector3D>>, colors:Vector.<uint>):void
  14. {
  15. var letter:Vector.<Vector3D>;
  16. var v0:Vector3D;
  17. var v1:Vector3D;
  18. var color:uint;
  19. var j:uint;
  20. for (var i:uint = 0; i < vectors.length; ++i) {
  21. color = colors[i];
  22. letter = vectors[i];
  23. for (j = 0; j < letter.length; j += 2) {
  24. v0 = letter[j];
  25. v1 = letter[j + 1];
  26. addSegment(new LineSegment(v0, v1, color, color, 1));
  27. }
  28. }
  29. }
  30. }
  31. }