Package com.sk89q.worldedit.math.transform

Examples of com.sk89q.worldedit.math.transform.Transform


            return;
        }

        ClipboardHolder holder = session.getClipboard();
        Clipboard clipboard = holder.getClipboard();
        Transform transform = holder.getTransform();
        Clipboard target;

        // If we have a transform, bake it into the copy
        if (!transform.isIdentity()) {
            FlattenedClipboardTransform result = FlattenedClipboardTransform.transform(clipboard, transform, holder.getWorldData());
            target = new BlockArrayClipboard(result.getTransformedRegion());
            target.setOrigin(clipboard.getOrigin());
            Operations.completeLegacy(result.copyTo(target));
        } else {
View Full Code Here


    public Region getTransformedRegion() {
        Region region = original.getRegion();
        Vector minimum = region.getMinimumPoint();
        Vector maximum = region.getMaximumPoint();

        Transform transformAround =
                new CombinedTransform(
                        new AffineTransform().translate(original.getOrigin().multiply(-1)),
                        transform,
                        new AffineTransform().translate(original.getOrigin()));

        Vector[] corners = new Vector[] {
                minimum,
                maximum,
                minimum.setX(maximum.getX()),
                minimum.setY(maximum.getY()),
                minimum.setZ(maximum.getZ()),
                maximum.setX(minimum.getX()),
                maximum.setY(minimum.getY()),
                maximum.setZ(minimum.getZ()) };

        for (int i = 0; i < corners.length; i++) {
            corners[i] = transformAround.apply(corners[i]);
        }

        Vector newMinimum = corners[0];
        Vector newMaximum = corners[0];
View Full Code Here

TOP

Related Classes of com.sk89q.worldedit.math.transform.Transform

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.