LineSegment.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. /** @addtogroup Math
  7. * @{
  8. */
  9. /// <summary>
  10. /// Represents a line segment in three dimensional space defined by a start and an end point.
  11. /// </summary>
  12. [StructLayout(LayoutKind.Sequential), SerializeObject]
  13. public struct LineSegment
  14. {
  15. [SerializeField]
  16. private Vector3 start;
  17. [SerializeField]
  18. private Vector3 end;
  19. /// <summary>
  20. /// Start position of the line segment.
  21. /// </summary>
  22. public Vector3 Start
  23. {
  24. get { return start; }
  25. set { start = value; }
  26. }
  27. /// <summary>
  28. /// End position of the line segment.
  29. /// </summary>
  30. public Vector3 End
  31. {
  32. get { return end; }
  33. set { end = value; }
  34. }
  35. /// <summary>
  36. /// Creates a new line segment.
  37. /// </summary>
  38. /// <param name="start">Line segment start position.</param>
  39. /// <param name="end">Line segment end position.</param>
  40. public LineSegment(Vector3 start, Vector3 end)
  41. {
  42. this.start = start;
  43. this.end = end;
  44. }
  45. }
  46. /** @} */
  47. }