Parcourir la source

This never got included due to a bug in VS's git manager

BearishSun il y a 9 ans
Parent
commit
fef018381b
1 fichiers modifiés avec 49 ajouts et 0 suppressions
  1. 49 0
      MBansheeEngine/Math/LineSegment.cs

+ 49 - 0
MBansheeEngine/Math/LineSegment.cs

@@ -0,0 +1,49 @@
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+
+using System.Runtime.InteropServices;
+
+namespace BansheeEngine
+{
+    /// <summary>
+    /// Represents a line segment in three dimensional space defined by a start and an end point.
+    /// </summary>
+    [StructLayout(LayoutKind.Sequential), SerializeObject]
+    public struct LineSegment
+    {
+        [SerializeField]
+        private Vector3 start;
+
+        [SerializeField]
+        private Vector3 end;
+
+        /// <summary>
+        /// Start position of the line segment.
+        /// </summary>
+        public Vector3 Start
+        {
+            get { return start; }
+            set { start = value; }
+        }
+
+        /// <summary>
+        /// End position of the line segment.
+        /// </summary>
+        public Vector3 End
+        {
+            get { return end; }
+            set { end = value; }
+        }
+
+        /// <summary>
+        /// Creates a new line segment.
+        /// </summary>
+        /// <param name="start">Line segment start position.</param>
+        /// <param name="end">Line segment end position.</param>
+        public LineSegment(Vector3 start, Vector3 end)
+        {
+            this.start = start;
+            this.end = end;
+        }
+    }
+}