geforkt von Mirrors/FastAsyncWorldEdit
Updated ClipboardSpline paste
Dieser Commit ist enthalten in:
Ursprung
cd0dac813c
Commit
e5f092c3ef
@ -8,6 +8,7 @@ import com.sk89q.worldedit.function.operation.ForwardExtentCopy;
|
|||||||
import com.sk89q.worldedit.function.operation.Operation;
|
import com.sk89q.worldedit.function.operation.Operation;
|
||||||
import com.sk89q.worldedit.function.operation.Operations;
|
import com.sk89q.worldedit.function.operation.Operations;
|
||||||
import com.sk89q.worldedit.math.BlockVector3;
|
import com.sk89q.worldedit.math.BlockVector3;
|
||||||
|
import com.sk89q.worldedit.math.Vector3;
|
||||||
import com.sk89q.worldedit.math.interpolation.Interpolation;
|
import com.sk89q.worldedit.math.interpolation.Interpolation;
|
||||||
import com.sk89q.worldedit.math.transform.AffineTransform;
|
import com.sk89q.worldedit.math.transform.AffineTransform;
|
||||||
import com.sk89q.worldedit.math.transform.RoundedTransform;
|
import com.sk89q.worldedit.math.transform.RoundedTransform;
|
||||||
@ -80,7 +81,7 @@ public class ClipboardSpline extends Spline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int pasteBlocks(BlockVector3 target, BlockVector3 offset, double angle) throws MaxChangedBlocksException {
|
protected int pasteBlocks(BlockVector3 target, Vector3 offset, double angle) throws MaxChangedBlocksException {
|
||||||
RoundedTransform transform = new RoundedTransform(new AffineTransform()
|
RoundedTransform transform = new RoundedTransform(new AffineTransform()
|
||||||
.translate(offset)
|
.translate(offset)
|
||||||
.rotateY(angle));
|
.rotateY(angle));
|
||||||
|
@ -127,9 +127,9 @@ public abstract class Spline {
|
|||||||
Preconditions.checkArgument(position <= 1);
|
Preconditions.checkArgument(position <= 1);
|
||||||
|
|
||||||
// Calculate position from spline
|
// Calculate position from spline
|
||||||
BlockVector3 target = interpolation.getPosition(position).toBlockPoint();
|
Vector3 target = interpolation.getPosition(position);
|
||||||
BlockVector3 offset = target.subtract(target.round());
|
BlockVector3 blockTarget = target.toBlockPoint();
|
||||||
target = target.subtract(offset).round();
|
Vector3 offset = target.subtract(target.floor());
|
||||||
|
|
||||||
// Calculate rotation from spline
|
// Calculate rotation from spline
|
||||||
|
|
||||||
@ -139,10 +139,10 @@ public abstract class Spline {
|
|||||||
Math.atan2(direction.getZ(), direction.getX()) - Math.atan2(deriv2D.getZ(), deriv2D.getX())
|
Math.atan2(direction.getZ(), direction.getX()) - Math.atan2(deriv2D.getZ(), deriv2D.getX())
|
||||||
);
|
);
|
||||||
|
|
||||||
return pasteBlocks(target, offset, angle);
|
return pasteBlocks(blockTarget, offset, angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract int pasteBlocks(BlockVector3 target, BlockVector3 offset, double angle) throws MaxChangedBlocksException;
|
protected abstract int pasteBlocks(BlockVector3 target, Vector3 offset, double angle) throws MaxChangedBlocksException;
|
||||||
|
|
||||||
private void initSections() {
|
private void initSections() {
|
||||||
int sectionCount = nodeCount - 1;
|
int sectionCount = nodeCount - 1;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren