Revert "Upstream, generics, formatting"

This reverts commit cd88e513a8.
This commit is contained in:
NotMyFault
2019-06-12 15:45:41 +02:00
parent 6f9fa018b2
commit ec001b8d3b
126 changed files with 3093 additions and 2490 deletions

View File

@ -1,35 +1,17 @@
/*
* WorldEdit, a Minecraft world manipulation toolkit
* Copyright (C) sk89q <http://www.sk89q.com>
* Copyright (C) WorldEdit team and contributors
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.sk89q.worldedit.math.transform;
import java.io.IOException;
import java.io.Serializable;
import com.sk89q.worldedit.math.MutableBlockVector3;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.math.MathUtils;
import com.sk89q.worldedit.math.MutableVector3;
import com.sk89q.worldedit.math.Vector3;
import java.io.IOException;
import java.io.Serializable;
/**
* An affine transform.
*
* <p>
* <p>This class is from the
* <a href="http://geom-java.sourceforge.net/index.html">JavaGeom project</a>,
* which is licensed under LGPL v2.1.</p>
@ -171,7 +153,7 @@ public class AffineTransform implements Transform, Serializable {
*
* @return the determinant of the transform.
*/
private double determinant() {
public double determinant() {
return m00 * (m11 * m22 - m12 * m21) - m01 * (m10 * m22 - m20 * m12)
+ m02 * (m10 * m21 - m20 * m11);
}
@ -320,10 +302,13 @@ public class AffineTransform implements Transform, Serializable {
@Override
public Vector3 apply(Vector3 vector) {
return MutableVector3.at(
vector.getX() * m00 + vector.getY() * m01 + vector.getZ() * m02 + m03,
vector.getX() * m10 + vector.getY() * m11 + vector.getZ() * m12 + m13,
vector.getX() * m20 + vector.getY() * m21 + vector.getZ() * m22 + m23);
double x = (vector.getX() * m00 + vector.getY() * m01 + vector.getZ() * m02 + m03);
double y = (vector.getX() * m10 + vector.getY() * m11 + vector.getZ() * m12 + m13);
double z = (vector.getX() * m20 + vector.getY() * m21 + vector.getZ() * m22 + m23);
vector = vector.mutX(x);
vector = vector.mutY(y);
vector = vector.mutZ(z);
return vector;
}
public AffineTransform combine(AffineTransform other) {
@ -334,8 +319,7 @@ public class AffineTransform implements Transform, Serializable {
public Transform combine(Transform other) {
if (other instanceof Identity || other.isIdentity()) {
return this;
}
if (other instanceof AffineTransform) {
} else if (other instanceof AffineTransform) {
return concatenate((AffineTransform) other);
} else {
return new CombinedTransform(this, other);
@ -352,4 +336,4 @@ public class AffineTransform implements Transform, Serializable {
}
}
}