Examples of Matrix3


Examples of com.ardor3d.math.Matrix3

        // Add a spinning 3D box to show behind UI.
        final Box box = new Box("Box", new Vector3(0, 0, 0), 5, 5, 5);
        box.setModelBound(new BoundingBox());
        box.setTranslation(new Vector3(0, 0, -15));
        box.addController(new SpatialController<Box>() {
            private final Matrix3 rotate = new Matrix3();
            private double angle = 0;
            private final Vector3 axis = new Vector3(1, 1, 0.5f).normalizeLocal();

            public void update(final double time, final Box caller) {
                angle += time * 50;
                angle %= 360;
                rotate.fromAngleNormalAxis(angle * MathUtils.DEG_TO_RAD, axis);
                caller.setRotation(rotate);
            }
        });
        // Add a texture to the box.
        final TextureState ts = new TextureState();
View Full Code Here

Examples of com.badlogic.gdx.math.Matrix3

    batch.setTransformMatrix(newBatchTransform);
    batch.begin();
  }

  protected Matrix4 updateTransform () {
    Matrix3 temp = worldTransform;
    if (originX != 0 || originY != 0)
      localTransform.setToTranslation(originX, originY);
    else
      localTransform.idt();
    if (rotation != 0) localTransform.mul(temp.setToRotation(rotation));
    if (scaleX != 1 || scaleY != 1) localTransform.mul(temp.setToScaling(scaleX, scaleY));
    if (originX != 0 || originY != 0) localTransform.mul(temp.setToTranslation(-originX, -originY));
    localTransform.trn(x, y);

    Group parentGroup = parent;
    while (parentGroup != null) {
      if (parentGroup.transform) break;
View Full Code Here

Examples of jinngine.math.Matrix3

        new Matrix3().multiply((Vector3) null);
    }

    @Test
    public void testAssignTranspose() {
        final Matrix3 m = new Matrix3(1., 2., 3.,
                4., 5., 6.,
                7., 8., 9.);
        final Matrix3 r = m.assignTranspose();
        assertSame(r, m);
        assertMatrixEquals(new double[]{
                    1., 4., 7.,
                    2., 5., 8.,
                    3., 6., 9.}, m);
View Full Code Here

Examples of jinngine.math.Matrix3

    }

    @Test
    public void testTranspose() {
        final Matrix3 m = new Matrix3(1., 2., 3.,
                4., 5., 6.,
                7., 8., 9.);
        final Matrix3 r = m.transpose();
        assertNotSame(r, m);
        assertMatrixEquals(new double[]{
                    1., 2., 3.,
                    4., 5., 6.,
                    7., 8., 9.}, m);
View Full Code Here

Examples of jinngine.math.Matrix3

                    3., 6., 9.}, r);
    }

    @Test
    public void testAdd01() {
        final Matrix3 m = new Matrix3(
                1., 2., 3.,
                4., 5., 6.,
                7., 8., 9.);
        final Matrix3 n = new Matrix3(
                10., 20., 30.,
                40., 50., 60.,
                70., 80., 90.);
        final Matrix3 r = m.add(n);
        assertNotSame(r, m);
        assertNotSame(r, n);
        assertMatrixEquals(new double[]{
                    1., 2., 3.,
                    4., 5., 6.,
View Full Code Here

Examples of jinngine.math.Matrix3

                    77., 88., 99.}, r);
    }

    @Test(expected = NullPointerException.class)
    public void testAdd02() {
        new Matrix3().add(null);
    }
View Full Code Here

Examples of jinngine.math.Matrix3

        new Matrix3().add(null);
    }

    @Test
    public void testAssignAdd01() {
        final Matrix3 m = new Matrix3(
                1., 2., 3.,
                4., 5., 6.,
                7., 8., 9.);
        final Matrix3 n = new Matrix3(
                10., 20., 30.,
                40., 50., 60.,
                70., 80., 90.);
        final Matrix3 r = m.assignAdd(n);
        assertSame(r, m);
        assertNotSame(r, n);
        assertMatrixEquals(new double[]{
                    10., 20., 30.,
                    40., 50., 60.,
View Full Code Here

Examples of jinngine.math.Matrix3

                    77., 88., 99.}, r);
    }

    @Test(expected = NullPointerException.class)
    public void testAssignAdd02() {
        new Matrix3().assignAdd(null);
    }
View Full Code Here

Examples of jinngine.math.Matrix3

        new Matrix3().assignAdd(null);
    }

    @Test
    public void testSub01() {
        final Matrix3 m = new Matrix3(
                -1., -2., -3.,
                -4., -5., -6.,
                -7., -8., -9.);
        final Matrix3 n = new Matrix3(
                10., 20., 30.,
                40., 50., 60.,
                70., 80., 90.);
        final Matrix3 r = m.subtract(n);
        assertNotSame(r, m);
        assertNotSame(r, n);
        assertMatrixEquals(new double[]{
                    -1., -2., -3.,
                    -4., -5., -6.,
View Full Code Here

Examples of jinngine.math.Matrix3

                    -77., -88., -99.}, r);
    }

    @Test(expected = NullPointerException.class)
    public void testSub02() {
        new Matrix3().subtract(null);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.