Package libshapedraw.primitive

Examples of libshapedraw.primitive.Vector3


        this.lowerCorner = lowerCorner;
        this.upperCorner = upperCorner;
        getOriginReadonly();
    }
    public WireframeCuboid(double x0, double y0, double z0, double x1, double y1, double z1) {
        this(new Vector3(x0, y0, z0), new Vector3(x1, y1, z1));
    }
View Full Code Here


public class TestWireframeCuboid extends SetupTestEnvironment.TestCase {
    @Test
    public void testConstructors() {
        new WireframeCuboid(1.0,2.0,3.0, 4.0,5.0,6.0);
        new WireframeCuboid(new Vector3(1.0,2.0,3.0), new Vector3(4.0,5.0,6.0));

        // it is valid to have both corners be the same values
        new WireframeCuboid(0,0,0, 0,0,0);
        // or even the same instance
        Vector3 v = new Vector3(8.67, -5.3, 0.9);
        WireframeCuboid shape = new WireframeCuboid(v, v);
        assertSame(shape.getLowerCorner(), shape.getUpperCorner());
    }
View Full Code Here

        assertSame(shape.getLowerCorner(), shape.getUpperCorner());
    }

    @Test(expected=NullPointerException.class)
    public void testConstructorInvalidNullLower() {
        new WireframeCuboid(null, new Vector3(1.0, 2.0, 3.0));
    }
View Full Code Here

        new WireframeCuboid(null, new Vector3(1.0, 2.0, 3.0));
    }

    @Test(expected=NullPointerException.class)
    public void testConstructorInvalidNullUpper() {
        new WireframeCuboid(new Vector3(1.0, 2.0, 3.0), null);
    }
View Full Code Here

        assertEquals("(4.0,5.0,6.0)", shape.getUpperCorner().toString());
        assertNotSame(shape.getLowerCorner(), shape.getUpperCorner());

        shape.setLowerCorner(shape.getUpperCorner());
        assertSame(shape.getLowerCorner(), shape.getUpperCorner());
        shape.setUpperCorner(new Vector3(-1.0, -2.0, -3.0));
        assertNotSame(shape.getLowerCorner(), shape.getUpperCorner());
        // auto-normalized
        assertEquals("(-1.0,-2.0,-3.0)", shape.getLowerCorner().toString());
        assertEquals("(4.0,5.0,6.0)", shape.getUpperCorner().toString());
    }
View Full Code Here

        shape = new WireframeCuboid(1.0,-2.0,3.0, -4.0,5.0,-6.0);
        assertEquals("(-4.0,-2.0,-6.0)(1.0,5.0,3.0)", shape.getLowerCorner().toString() + shape.getUpperCorner().toString());

        // setUpperCorner auto-normalizes
        shape = new WireframeCuboid(1.0,2.0,3.0, 4.0,5.0,6.0);
        shape.setUpperCorner(new Vector3(3.0, -1.5, 5.5));
        assertEquals("(1.0,-1.5,3.0)(3.0,2.0,5.5)", shape.getLowerCorner().toString() + shape.getUpperCorner().toString());

        // setLowerCorner auto-normalizes
        shape = new WireframeCuboid(1.0,2.0,3.0, 4.0,5.0,6.0);
        shape.setLowerCorner(new Vector3(3.0, -1.5, 5.5));
        assertEquals("(3.0,-1.5,5.5)(4.0,5.0,6.0)", shape.getLowerCorner().toString() + shape.getUpperCorner().toString());

        // changing vector components individually does NOT auto-normalize
        shape = new WireframeCuboid(1.0,2.0,3.0, 4.0,5.0,6.0);
        shape.getLowerCorner().setX(55.5);
View Full Code Here

*/
public class ShapeTranslate implements ShapeTransform, Animates<ReadonlyVector3> {
    private Vector3 translateXYZ;

    public ShapeTranslate() {
        this(new Vector3(0.0, 0.0, 0.0));
    }
View Full Code Here

    public ShapeTranslate() {
        this(new Vector3(0.0, 0.0, 0.0));
    }
    public ShapeTranslate(double translateX, double translateY, double translateZ) {
        this(new Vector3(translateX, translateY, translateZ));
    }
View Full Code Here

    private double angle;
    private Vector3 axis;
    private Timeline timelineAngle;

    public ShapeRotate(double angleDegrees, double axisX, double axisY, double axisZ) {
        this(angleDegrees, new Vector3(axisX, axisY, axisZ));
    }
View Full Code Here

    private ReadonlyVector3 getPlayerCoords() {
        if (curPlayer == null) {
            return Vector3.ZEROS;
        }
        float partialTick = getPartialTick();
        return new Vector3(
                // obf: Entity.prevPosX, Entity.posX
                curPlayer.q + partialTick*(curPlayer.t - curPlayer.q),
                // obf: Entity.prevPosY, Entity.posY
                curPlayer.r + partialTick*(curPlayer.u - curPlayer.r),
                // obf: Entity.prevPosZ, Entity.posZ
View Full Code Here

TOP

Related Classes of libshapedraw.primitive.Vector3

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.