Package jinngine.math

Examples of jinngine.math.Matrix4


                    0., 0., 0., 0.,}, m);
    }

    @Test
    public void testAssignZero() {
        final Matrix4 m = new Matrix4(
                1., 2., 3., 4.,
                5., 6., 7., 8.,
                9., 10, 11, 12,
                13, 14, 15, 16);
        final Matrix4 r = m.assignZero();
        assertSame(r, m);//assert it return this
        //assert every value is 0.
        assertMatrixEquals(new double[]{
                    0., 0., 0., 0.,
                    0., 0., 0., 0.,
View Full Code Here


                    0., 0., 0., 0.,}, m);
    }

    @Test
    public void testCtorD() {
        final Matrix4 m = new Matrix4(new double[]{
                    1., 2., 3., 4.,
                    5., 6., 7., 8.,
                    9., 10, 11, 12,
                    13, 14, 15, 16});
        assertMatrixEquals(new double[]{
View Full Code Here

                    4., 8., 12, 16}, m);
    }

    @Test
    public void testAssignD() {
        final Matrix4 m = new Matrix4();
        final Matrix4 r = m.assign(new double[]{
                    1., 2., 3., 4.,
                    5., 6., 7., 8.,
                    9., 10, 11, 12,
                    13, 14, 15, 16});
        assertSame(r, m);//assert it return this
View Full Code Here

                    4., 8., 12, 16}, m);
    }

    @Test
    public void testCtor() {
        final Matrix4 m = new Matrix4(
                1., 2., 3., 4.,
                5., 6., 7., 8.,
                9., 10, 11, 12,
                13, 14, 15, 16);
        assertMatrixEquals(new double[]{
View Full Code Here

                    13, 14, 15, 16}, m);
    }

    @Test
    public void testAssign() {
        final Matrix4 m = new Matrix4();
        final Matrix4 r = m.assign(
                1., 2., 3., 4.,
                5., 6., 7., 8.,
                9., 10, 11, 12,
                13, 14, 15, 16);
        assertSame(r, m);//assert it return this
View Full Code Here

                    13, 14, 15, 16}, m);
    }

    @Test
    public void testCtorMatrix() {
        final Matrix4 m = new Matrix4(new Matrix4(
                1., 2., 3., 4.,
                5., 6., 7., 8.,
                9., 10, 11, 12,
                13, 14, 15, 16));
View Full Code Here

                    13, 14, 15, 16}, m);
    }

    @Test
    public void testAssignMatrix() {
        final Matrix4 m = new Matrix4();
        final Matrix4 r = m.assign(new Matrix4(
                1., 2., 3., 4.,
                5., 6., 7., 8.,
                9., 10, 11, 12,
                13, 14, 15, 16));
        assertSame(r, m);//assert it return this
View Full Code Here

    }

    @Test
    public void testFtorIdentity() {
        final Matrix4 m = Matrix4.identity();
        final Matrix4 n = Matrix4.identity();
        assertNotSame(n, m);//create a new referene everytime like a ctor
        assertMatrixEquals(new double[]{
                    1., 0., 0., 0.,
                    0., 1., 0., 0.,
                    0., 0., 1., 0.,
View Full Code Here

                    0., 0., 0., 1.}, m);
    }

    @Test
    public void testAssignIdentity() {
        final Matrix4 m = new Matrix4(
                2., 2., 3., 4.,
                5., 6., 7., 8.,
                9., 10, 11, 12,
                13, 14, 15, 16);
        final Matrix4 r = m.assignIdentity();
        assertSame(r, m);//assert it return this
        assertMatrixEquals(new double[]{
                    1., 0., 0., 0.,
                    0., 1., 0., 0.,
                    0., 0., 1., 0.,
View Full Code Here

                    0., 0., 0., 1.}, m);
    }

    @Test
    public void testFtorScaleDouble() {
        final Matrix4 m = Matrix4.scaleMatrix(3.);
        final Matrix4 n = Matrix4.scaleMatrix(3.);
        assertNotSame(n, m);//create a new referene everytime like a ctor
        assertMatrixEquals(new double[]{
                    3., 0., 0., 0.,
                    0., 3., 0., 0.,
                    0., 0., 3., 0.,
View Full Code Here

TOP

Related Classes of jinngine.math.Matrix4

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.