ArViewer  Android Version
Arvos - Augmented reality viewer open source
 All Classes Namespaces Files Functions Variables
MatrixGrabber.java
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.mission_base.arviewer_android.viewer.utilities;
18 
19 import javax.microedition.khronos.opengles.GL10;
20 
21 public class MatrixGrabber
22 {
23  public MatrixGrabber()
24  {
25  mModelView = new float[16];
26  mProjection = new float[16];
27  }
28 
35  public void getCurrentState(GL10 gl)
36  {
39  }
40 
47  public void getCurrentModelView(GL10 gl)
48  {
49  getMatrix(gl, GL10.GL_MODELVIEW, mModelView);
50  }
51 
58  public void getCurrentProjection(GL10 gl)
59  {
60  getMatrix(gl, GL10.GL_PROJECTION, mProjection);
61  }
62 
63  private void getMatrix(GL10 gl, int mode, float[] mat)
64  {
66  gl2.glMatrixMode(mode);
67  gl2.getMatrix(mat, 0);
68  }
69 
70  public float[] mModelView;
71  public float[] mProjection;
72 }