mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-11-02 02:47:11 +00:00
Add positive() to Vector and Vector2D
This commit is contained in:
parent
85cdd49593
commit
0346228310
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
|
@ -501,6 +501,15 @@ public class Vector2D {
|
||||
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.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user