From b9fd3bc140a0af92f9176f2a725a62710b547b7e Mon Sep 17 00:00:00 2001 From: Will Fowler Date: Tue, 10 Nov 2015 14:07:30 -0700 Subject: [PATCH] Normalizing Vector3d.zero returns Vector3d.zero. --- LibBSP/Source/Structs/Common/Vector3d.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/LibBSP/Source/Structs/Common/Vector3d.cs b/LibBSP/Source/Structs/Common/Vector3d.cs index cb128a8..5cf48f4 100644 --- a/LibBSP/Source/Structs/Common/Vector3d.cs +++ b/LibBSP/Source/Structs/Common/Vector3d.cs @@ -94,6 +94,7 @@ namespace LibBSP { /// public Vector3d normalized { get { + if (this == Vector3d.zero) { return Vector3d.zero; } double magnitude = this.magnitude; return new Vector3d(x / magnitude, y / magnitude, z / magnitude); } @@ -406,6 +407,7 @@ namespace LibBSP { /// Changes this vector to its normalized version (it will have a magnitude of 1). /// public void Normalize() { + if (this == Vector3d.zero) { return; } double magnitude = this.magnitude; x /= magnitude; y /= magnitude;