3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-09-19 22:30:05 +02:00

Add positive() to Vector and Vector2D

Dieser Commit ist enthalten in:
aumgn 2012-03-13 10:05:33 +01:00 committet von TomyLobo
Ursprung 85cdd49593
Commit 0346228310
2 geänderte Dateien mit 18 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -575,6 +575,15 @@ public class Vector {
return new Vector(Math.floor(x + 0.5), Math.floor(y + 0.5), Math.floor(z + 0.5)); return new Vector(Math.floor(x + 0.5), Math.floor(y + 0.5), Math.floor(z + 0.5));
} }
/**
* Returns a vector with the absolute values of the components of this vector.
*
* @return
*/
public Vector positive() {
return new Vector(Math.abs(x), Math.abs(y), Math.abs(z));
}
/** /**
* 2D transformation. * 2D transformation.
* *

Datei anzeigen

@ -501,6 +501,15 @@ public class Vector2D {
return new Vector2D(Math.floor(x + 0.5), Math.floor(z + 0.5)); return new Vector2D(Math.floor(x + 0.5), Math.floor(z + 0.5));
} }
/**
* Returns a vector with the absolute values of the components of this vector.
*
* @return
*/
public Vector2D positive() {
return new Vector2D(Math.abs(x), Math.abs(z));
}
/** /**
* 2D transformation. * 2D transformation.
* *