public class ArGlRenderer
extends java.lang.Object
implements android.opengl.GLSurfaceView.Renderer
Modifier and Type | Class and Description |
---|---|
static interface |
ArGlRenderer.RenderCallback
A small callback to allow the caller to introduce application-specific code to be executed
in the OpenGL thread.
|
Modifier and Type | Field and Description |
---|---|
private android.content.Context |
mContext |
private OpenGlCameraPreview |
mOpenGlCameraPreview |
private boolean |
mProjectionMatrixConfigured |
private ArGlRenderer.RenderCallback |
mRenderCallback |
private ArScene |
scene |
private static java.lang.String |
TAG |
Constructor and Description |
---|
ArGlRenderer(android.content.Context context,
ArScene scene,
ArGlRenderer.RenderCallback callback) |
Modifier and Type | Method and Description |
---|---|
int |
getTextureId()
It returns the ID currently assigned to the texture where the Tango color camera contents
should be rendered.
|
static float[] |
invert4x4Matrix(float[] matrix) |
boolean |
isProjectionMatrixConfigured() |
void |
onDrawFrame(javax.microedition.khronos.opengles.GL10 gl10) |
void |
onSurfaceChanged(javax.microedition.khronos.opengles.GL10 gl10,
int width,
int height) |
void |
onSurfaceCreated(javax.microedition.khronos.opengles.GL10 gl10,
javax.microedition.khronos.egl.EGLConfig eglConfig) |
static float[] |
projectionMatrixFromCameraIntrinsics(com.google.atap.tangoservice.TangoCameraIntrinsics intrinsics)
Use Tango camera intrinsics to calculate the projection Matrix for the OpenGL scene.
|
void |
setProjectionMatrix(float[] matrixFloats)
Set the Projection matrix matching the Tango RGB camera in order to be able to do
Augmented Reality.
|
void |
updateColorCameraTextureUv(int rotation)
Update background texture's UV coordinates when device orientation is changed (i.e., change between landscape and portrait mode).
|
void |
updateViewMatrix(float[] ssTcamera)
Update the View matrix matching the pose of the Tango RGB camera.
|
private static final java.lang.String TAG
private ArScene scene
private ArGlRenderer.RenderCallback mRenderCallback
private OpenGlCameraPreview mOpenGlCameraPreview
private boolean mProjectionMatrixConfigured
private android.content.Context mContext
public ArGlRenderer(android.content.Context context, ArScene scene, ArGlRenderer.RenderCallback callback)
context
- scene
- callback
- public void onSurfaceCreated(javax.microedition.khronos.opengles.GL10 gl10, javax.microedition.khronos.egl.EGLConfig eglConfig)
onSurfaceCreated
in interface android.opengl.GLSurfaceView.Renderer
gl10
- eglConfig
- public void updateColorCameraTextureUv(int rotation)
rotation
- public void onSurfaceChanged(javax.microedition.khronos.opengles.GL10 gl10, int width, int height)
onSurfaceChanged
in interface android.opengl.GLSurfaceView.Renderer
gl10
- width
- height
- public void onDrawFrame(javax.microedition.khronos.opengles.GL10 gl10)
onDrawFrame
in interface android.opengl.GLSurfaceView.Renderer
gl10
- public int getTextureId()
public void setProjectionMatrix(float[] matrixFloats)
matrixFloats
- public void updateViewMatrix(float[] ssTcamera)
ssTcamera
- The transform from RGB camera to Start of Service.public static float[] projectionMatrixFromCameraIntrinsics(com.google.atap.tangoservice.TangoCameraIntrinsics intrinsics)
intrinsics
- camera instrinsics for computing the project matrix.public static float[] invert4x4Matrix(float[] matrix)
matrix
- public boolean isProjectionMatrixConfigured()