Package com.sk89q.worldedit

Examples of com.sk89q.worldedit.Vector2D


     * @return a region
     */
    public static CylinderRegion createRadius(Extent extent, Vector center, double radius) {
        checkNotNull(extent);
        checkNotNull(center);
        Vector2D radiusVec = new Vector2D(radius, radius);
        int minY = extent.getMinimumPoint().getBlockY();
        int maxY = extent.getMaximumPoint().getBlockY();
        return new CylinderRegion(center, radiusVec, minY, maxY);
    }
View Full Code Here


        }

        final List<BlockVector2D> points = new ArrayList<BlockVector2D>(nPoints);
        for (int i = 0; i < nPoints; ++i) {
            double angle = i * (2.0 * Math.PI) / nPoints;
            final Vector2D pos = new Vector2D(Math.cos(angle), Math.sin(angle));
            final BlockVector2D blockVector2D = pos.multiply(radius).add(center).toBlockVector2D();
            points.add(blockVector2D);
        }

        return points;
    }
View Full Code Here

TOP

Related Classes of com.sk89q.worldedit.Vector2D

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.