From 3a2a493154bca7a0c412e13372aafe9cbc48e091 Mon Sep 17 00:00:00 2001 From: Will Date: Sun, 1 Nov 2015 13:58:38 -0700 Subject: [PATCH] More small cleanups. --- LibBSP/src/Structs/Common/Plane.cs | 9 ++++++--- LibBSP/src/Structs/Common/Vector2d.cs | 2 +- LibBSP/src/Structs/Common/Vector3d.cs | 2 +- LibBSP/src/Structs/Common/Vector4d.cs | 2 +- LibBSP/src/Structs/MAP/MAPBrushSide.cs | 1 - 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/LibBSP/src/Structs/Common/Plane.cs b/LibBSP/src/Structs/Common/Plane.cs index efade17..f276f30 100644 --- a/LibBSP/src/Structs/Common/Plane.cs +++ b/LibBSP/src/Structs/Common/Plane.cs @@ -134,10 +134,13 @@ namespace LibBSP { /// A point on the Plane /// A point on the Plane /// A point on the Plane - public Plane(Vector3d point0, Vector3d point1, Vector3d point2) { - _normal = ((point0 - point2) ^ (point0 - point1)); + public Plane(params Vector3d[] points) { + if (points.Length < 3) { + throw new ArgumentException("Plane constructor was not given enough points to define a plane"); + } + _normal = ((points[0] - points[2]) ^ (points[0] - points[1])); _normal.Normalize(); - distance = point0 * _normal; + distance = points[0] * _normal; } /// diff --git a/LibBSP/src/Structs/Common/Vector2d.cs b/LibBSP/src/Structs/Common/Vector2d.cs index 2e13fd2..ebcc7c0 100644 --- a/LibBSP/src/Structs/Common/Vector2d.cs +++ b/LibBSP/src/Structs/Common/Vector2d.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; namespace LibBSP { /// - /// Holds an array of two doubles representing a 2-dimensional vector. + /// Holds two doubles representing a 2-dimensional vector. /// [Serializable] public struct Vector2d : IEquatable, IEnumerable, IEnumerable { diff --git a/LibBSP/src/Structs/Common/Vector3d.cs b/LibBSP/src/Structs/Common/Vector3d.cs index 4adac93..cb128a8 100644 --- a/LibBSP/src/Structs/Common/Vector3d.cs +++ b/LibBSP/src/Structs/Common/Vector3d.cs @@ -7,7 +7,7 @@ using System.Drawing; namespace LibBSP { using Color32 = Color; /// - /// Holds an array of three doubles representing a 3-dimensional vector. + /// Holds three doubles representing a 3-dimensional vector. /// [Serializable] public struct Vector3d : IEquatable, IEnumerable, IEnumerable { diff --git a/LibBSP/src/Structs/Common/Vector4d.cs b/LibBSP/src/Structs/Common/Vector4d.cs index 7aac101..4bcc2b1 100644 --- a/LibBSP/src/Structs/Common/Vector4d.cs +++ b/LibBSP/src/Structs/Common/Vector4d.cs @@ -7,7 +7,7 @@ using System.Drawing; namespace LibBSP { using Color32 = Color; /// - /// Holds an array of four doubles representing a 4-dimensional vector. + /// Holds four doubles representing a 4-dimensional vector. /// [Serializable] public struct Vector4d : IEquatable, IEnumerable, IEnumerable { diff --git a/LibBSP/src/Structs/MAP/MAPBrushSide.cs b/LibBSP/src/Structs/MAP/MAPBrushSide.cs index 51f0388..fe5d82f 100644 --- a/LibBSP/src/Structs/MAP/MAPBrushSide.cs +++ b/LibBSP/src/Structs/MAP/MAPBrushSide.cs @@ -31,7 +31,6 @@ namespace LibBSP { public string material; public double lgtScale; public double lgtRot; - public int id; public MAPDisplacement displacement; ///