mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-10 06:38:35 +00:00
Upstream, generics, formatting
This commit is contained in:
@ -1,17 +1,35 @@
|
||||
/*
|
||||
* 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>
|
||||
@ -153,7 +171,7 @@ public class AffineTransform implements Transform, Serializable {
|
||||
*
|
||||
* @return the determinant of the transform.
|
||||
*/
|
||||
public double determinant() {
|
||||
private double determinant() {
|
||||
return m00 * (m11 * m22 - m12 * m21) - m01 * (m10 * m22 - m20 * m12)
|
||||
+ m02 * (m10 * m21 - m20 * m11);
|
||||
}
|
||||
@ -302,13 +320,10 @@ public class AffineTransform implements Transform, Serializable {
|
||||
|
||||
@Override
|
||||
public Vector3 apply(Vector3 vector) {
|
||||
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;
|
||||
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);
|
||||
}
|
||||
|
||||
public AffineTransform combine(AffineTransform other) {
|
||||
@ -319,7 +334,8 @@ public class AffineTransform implements Transform, Serializable {
|
||||
public Transform combine(Transform other) {
|
||||
if (other instanceof Identity || other.isIdentity()) {
|
||||
return this;
|
||||
} else if (other instanceof AffineTransform) {
|
||||
}
|
||||
if (other instanceof AffineTransform) {
|
||||
return concatenate((AffineTransform) other);
|
||||
} else {
|
||||
return new CombinedTransform(this, other);
|
||||
@ -336,4 +352,4 @@ public class AffineTransform implements Transform, Serializable {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user