Changed the clipboard so it doesn't store min/max anymore, just origin and offset. Added /editrotate.
This commit is contained in:
@@ -356,6 +356,29 @@ public class Vector {
|
||||
Math.pow(pt.z - z, 2));
|
||||
}
|
||||
|
||||
/**
|
||||
* 2D transformation.
|
||||
*
|
||||
* @param vec
|
||||
* @param angle in degrees
|
||||
* @param aboutX
|
||||
* @param aboutY
|
||||
* @param translateX
|
||||
* @param translateY
|
||||
* @return
|
||||
*/
|
||||
public Vector transform2D(double angle,
|
||||
double aboutX, double aboutZ, double translateX, double translateZ) {
|
||||
angle = Math.toRadians(angle);
|
||||
double x = this.x;
|
||||
double z = this.z;
|
||||
double x2 = x * Math.cos(angle) - z * Math.sin(angle);
|
||||
double z2 = x * Math.sin(angle) + z * Math.cos(angle);
|
||||
return new Vector(x2 + aboutX + translateX,
|
||||
y,
|
||||
z2 + aboutZ + translateZ);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a block point from a point.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user