mirror of
https://github.com/celisej567/LibBSP.git
synced 2026-09-11 20:09:36 +03:00
Normalizing Vector3d.zero returns Vector3d.zero.
This commit is contained in:
@@ -94,6 +94,7 @@ namespace LibBSP {
|
||||
/// </summary>
|
||||
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).
|
||||
/// </summary>
|
||||
public void Normalize() {
|
||||
if (this == Vector3d.zero) { return; }
|
||||
double magnitude = this.magnitude;
|
||||
x /= magnitude;
|
||||
y /= magnitude;
|
||||
|
||||
Reference in New Issue
Block a user