LineSegment.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. using System.Runtime.InteropServices;
  4. namespace BansheeEngine
  5. {
  6. /// <summary>
  7. /// Represents a line segment in three dimensional space defined by a start and an end point.
  8. /// </summary>
  9. [StructLayout(LayoutKind.Sequential), SerializeObject]
  10. public struct LineSegment
  11. {
  12. [SerializeField]
  13. private Vector3 start;
  14. [SerializeField]
  15. private Vector3 end;
  16. /// <summary>
  17. /// Start position of the line segment.
  18. /// </summary>
  19. public Vector3 Start
  20. {
  21. get { return start; }
  22. set { start = value; }
  23. }
  24. /// <summary>
  25. /// End position of the line segment.
  26. /// </summary>
  27. public Vector3 End
  28. {
  29. get { return end; }
  30. set { end = value; }
  31. }
  32. /// <summary>
  33. /// Creates a new line segment.
  34. /// </summary>
  35. /// <param name="start">Line segment start position.</param>
  36. /// <param name="end">Line segment end position.</param>
  37. public LineSegment(Vector3 start, Vector3 end)
  38. {
  39. this.start = start;
  40. this.end = end;
  41. }
  42. }
  43. }