Quad2D.cs 741 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Drawing;
  7. namespace bbiwarg.Utility
  8. {
  9. class Quad2D
  10. {
  11. public Vector2D Origin {private set; get;}
  12. public Vector2D DirLength {private set; get;}
  13. public Vector2D DirWidth {private set; get;}
  14. public Quad2D(Vector2D origin, Vector2D dirLength, Vector2D dirWidth)
  15. {
  16. Origin = origin;
  17. DirLength = dirLength;
  18. DirWidth = dirWidth;
  19. }
  20. public PointF[] getVertices()
  21. {
  22. return new PointF[] {Origin, Origin + DirLength, Origin + 0.8f * DirLength + 0.8f * DirWidth, Origin + DirWidth};
  23. }
  24. }
  25. }