mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 20:16:41 +00:00
Add a new block metadata framework and fix //rotate and //flip.
Remove the previous Mapping interfaces.
This commit is contained in:
@ -24,6 +24,15 @@ package com.sk89q.worldedit.math;
|
||||
*/
|
||||
public final class MathUtils {
|
||||
|
||||
/**
|
||||
* Safe minimum, such that 1 / SAFE_MIN does not overflow.
|
||||
* <p>
|
||||
* In IEEE 754 arithmetic, this is also the smallest normalized number
|
||||
* 2<sup>-1022</sup>. The value of this constant is from Apache Commons
|
||||
* Math 2.2.
|
||||
*/
|
||||
public static final double SAFE_MIN = 0x1.0p-1022;
|
||||
|
||||
private MathUtils() {
|
||||
}
|
||||
|
||||
|
@ -292,6 +292,10 @@ public class AffineTransform implements Transform {
|
||||
vector.getX() * m20 + vector.getY() * m21 + vector.getZ() * m22 + m23);
|
||||
}
|
||||
|
||||
public AffineTransform combine(AffineTransform other) {
|
||||
return concatenate(other);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Transform combine(Transform other) {
|
||||
if (other instanceof AffineTransform) {
|
||||
@ -305,4 +309,6 @@ public class AffineTransform implements Transform {
|
||||
public String toString() {
|
||||
return String.format("Affine[%g %g %g %g, %g %g %g %g, %g %g %g %g]}", m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -19,13 +19,20 @@
|
||||
|
||||
package com.sk89q.worldedit.math.transform;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
|
||||
/**
|
||||
* Makes a transformation of {@link Vector}s.
|
||||
*/
|
||||
public interface Transform extends Function<Vector, Vector> {
|
||||
public interface Transform {
|
||||
|
||||
/**
|
||||
* Returns the result of applying the function to the input.
|
||||
*
|
||||
* @param input the input
|
||||
* @return the result
|
||||
*/
|
||||
Vector apply(Vector input);
|
||||
|
||||
/**
|
||||
* Create a new inverse transform.
|
||||
|
Reference in New Issue
Block a user