Changed the clipboard so it doesn't store min/max anymore, just origin and offset. Added /editrotate.

This commit is contained in:
sk89q
2010-10-13 10:08:53 -07:00
parent bd9a90f01d
commit 598f4aa6cd
6 changed files with 219 additions and 129 deletions

View File

@@ -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.
*