Package engine.geometry

Examples of engine.geometry.Point


        translate(shape, vector.getX(), vector.getY());
    }

    public static void translate(final Shape shape, final double x, final double y) {
        if (shape instanceof Point) {
            Point point = (Point) shape;
            point.setX(point.getX() + x);
            point.setY(point.getY() + y);
        } else if (shape instanceof Line) {
            Line line = (Line) shape;
            line.setX1(line.getX1() + x);
            line.setY1(line.getY1() + y);
            line.setX2(line.getX2() + x);
View Full Code Here


        scale(shape, vector.getX(), vector.getY());
    }

    public static void scale(final Shape shape, final double x, final double y) {
        if (shape instanceof Point) {
            Point point = (Point) shape;
            point.setX(point.getX() * x);
            point.setY(point.getY() * y);
        } else if (shape instanceof Line) {
            Line line = (Line) shape;
            line.setX1(line.getX1() * x);
            line.setY1(line.getY1() * y);
            line.setX2(line.getX2() * x);
 
View Full Code Here

        shear(shape, vector.getX(), vector.getY());
    }

    public static void shear(final Shape shape, final double x, final double y) {
        if (shape instanceof Point) {
            Point point = (Point) shape;
            point.set(point.getX() + x * point.getY(), point.getY() + y * point.getX());
        } else if (shape instanceof Line) {
            Line line = (Line) shape;
            line.setStart(line.getX1() + x * line.getY1(), line.getY1() + y * line.getX1());
            line.setEnd(line.getX2() + x * line.getY2(), line.getY2() + y * line.getX2());
        } else if (shape instanceof Polygon) {
View Full Code Here

        this.dynamic = dynamic;
        centre = new Vector();
        mousePos = new Vector();
        direction = new Vector();
       
        startPoint = new Point();
        endCircle = new Circle();
        bounds = new Rectangle();
    }
View Full Code Here

        this.bounds = bounds;
    }

    @Override
    public void onBeforeMove(final Keyboard keyboard, final Mouse mouse, final Clock clock) {
        Point mousePos = new Point(mouse.getX(), mouse.getY());

        if (mouse.wasReleased(Button.MB_LEFT) && Geometry.pointIntersectsRectangle(mousePos, bounds)) {
            if (listener != null) {
                listener.onClick(this);
            }
View Full Code Here

TOP

Related Classes of engine.geometry.Point

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.