Package jinngine.math

Examples of jinngine.math.Matrix4


    gl.glGetDoublev(GL.GL_PROJECTION_MATRIX, proj, 0);
  }
 
 
  private Matrix4 getCameraMatrix() {
    return new Matrix4(camera);
  }
View Full Code Here


  private Matrix4 getCameraMatrix() {
    return new Matrix4(camera);
  }

  private Matrix4 getProjectionMatrix() {   
    return new Matrix4(proj);
  }
View Full Code Here

    // clipping planes
    Vector3 near = new Vector3(2*x/(double)width-1,-2*(y-((height-drawHeight)*0.5))/(double)drawHeight+1, 0.7);
    Vector3 far = new Vector3(2*x/(double)width-1,-2*(y-((height-drawHeight)*0.5))/(double)drawHeight+1, 0.9);

    //inverse transform
    Matrix4 T = getProjectionMatrix().multiply(getCameraMatrix()).inverse();
 
    Vector3 p1 = new Vector3();
    Vector3 p2 = new Vector3();
   
    Matrix4.multiply(T,near,p1);
View Full Code Here

  }

   
  @Override
  public Matrix4 getTransform() {
    return Matrix4.multiply(body.getTransform(), localtransform4, new Matrix4());
  }
View Full Code Here

        assertMatrixEquals(ref, val, 0.);
    }

    @Test
    public void testCtorZero() {
        final Matrix4 m = new Matrix4();
        assertMatrixEquals(new double[]{
                    0., 0., 0., 0.,
                    0., 0., 0., 0.,
                    0., 0., 0., 0.,
                    0., 0., 0., 0.,}, m);
View Full Code Here

                    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

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.