KudanAR - Android
ARRenderer Class Reference
+ Collaboration diagram for ARRenderer:

Public Member Functions

long getRenderTime ()
 
void setBlendInfluence (float influence)
 
float getBlendInfluence ()
 
void setBones (List< Matrix4f > bones)
 
List< Matrix4f > getBones ()
 
void addRenderTarget (ARRenderTarget renderTarget)
 
List< ARRenderTargetgetRenderTargets ()
 
ARRenderTarget getDefaultRenderTarget ()
 
String getDataDir ()
 
void setDataDir (String dataDir)
 
ARActivity getActivity ()
 
void setActivity (ARActivity mActivity)
 
void setScreenSize (int x, int y)
 
void setCameraSize (int x, int y)
 
Matrix4f getProjectionMatrix ()
 
void setProjectionMatrix (Matrix4f projectionMatrix)
 
Matrix4f getModelViewMatrix ()
 
void setModelViewMatrix (Matrix4f modelViewMatrix)
 
Matrix4f getModelMatrix ()
 
void setModelMatrix (Matrix4f modelMatrix)
 
Matrix3f getNormalMatrix ()
 
void setNormalMatrix (Matrix3f normalMatrix)
 
Vector3f getWorldCameraPosition ()
 
void setWorldCameraPosition (Vector3f worldCameraPosition)
 
Vector3f getLightPosition ()
 
void setLightPosition (Vector3f lightPosition)
 
Matrix4f getModelViewProjectionMatrix ()
 
ARCamera getCamera ()
 
void setCamera (ARCamera camera)
 
boolean getRenderForCapture ()
 
void cameraDraw ()
 
void render ()
 
void draw ()
 
AssetManager getAssetManager ()
 
void setAssetManager (AssetManager assetManager)
 
void initialise ()
 
void initialise (ARActivity mARActivity)
 
void reset ()
 
void makeActiveVideoTexture (ARVideoTexture videoTexture)
 
void addMediaPlayer (MediaPlayer mediaPlayer)
 
List< MediaPlayer > getMediaPlayers ()
 
List< ARVertexBuffer > getVertexBuffers ()
 
List< ARIndexBuffergetIndexBuffers ()
 
List< ARTexturegetTextures ()
 
List< ARShaderProgram > getShaders ()
 
void addVertexBuffer (final ARVertexBuffer vertexBuffer)
 
void addIndexBuffer (final ARIndexBuffer indexBuffer)
 
void addTexture (final ARTexture texture)
 
void addShader (final ARShaderProgram shader)
 
void queuePreRenderEvent (Runnable runnable)
 
void loadContext ()
 
void setupCameraFBO ()
 
void setupCaptureFBO ()
 
void setTouchCoords (Point point)
 
Vector3f getNextCaptureColour ()
 
void enableVertexAttribute (int n)
 
void disableVertexAttribute (int n)
 
void pause ()
 
synchronized void addListener (ARRendererListener listener)
 
synchronized void removeListener (ARRendererListener listener)
 
void resume ()
 

Static Public Member Functions

static ARRenderer getInstance ()
 

Data Fields

List< ARRendererListenermListeners
 
Vector2f cameraFBOResolution
 
Vector2f mScreenSize
 

Detailed Description

The ARRenderer is a singleton class used for controlling the render state of the application.

Member Function Documentation

void addIndexBuffer ( final ARIndexBuffer  indexBuffer)
inline

Adds an ARIndexBuffer to ARRenderer's list of ARIndexBuffers.

Parameters
indexBufferIndex buffer to be added.
synchronized void addListener ( ARRendererListener  listener)
inline

Add an ARRendererListener to ARRenderer's list of ARRendererListeners. This notifies the subscribers of the renderer's events.

Parameters
listenerARRendererListener to be added.
void addMediaPlayer ( MediaPlayer  mediaPlayer)
inline

Adds MediaPlayer to ARRenderer's list of MediaPlayers.

Parameters
mediaPlayerThe MediaPlayer to be added.
void addRenderTarget ( ARRenderTarget  renderTarget)
inline

Adds render target to list of ARRenderTargets.

Parameters
renderTarget
void addShader ( final ARShaderProgram  shader)
inline

Adds ARShaderProgram to list of ARRenderer's ARShaderPrograms.

Parameters
shaderShader program to be added.
void addTexture ( final ARTexture  texture)
inline

Adds an ARTexture to ARRenderer's list of ARTextures.

Parameters
textureTexture to be added.
void addVertexBuffer ( final ARVertexBuffer  vertexBuffer)
inline

Adds an ARVertexBuffer to ARRenderer's list of ARVertexBuffers.

Parameters
vertexBufferVertex buffer to be added.
void cameraDraw ( )
inline

Draws the camera FBO.

void disableVertexAttribute ( int  n)
inline

Wrapper method for accessing GLES20.glDisableVertexAttribArray(n);

Parameters
nAttribute to access.
void draw ( )
inline

Draws the current camera frame.

void enableVertexAttribute ( int  n)
inline

Wrapper method for accessing GLES20.glEnableVertexAttribArray(n);

Parameters
nAttribute to access.
ARActivity getActivity ( )
inline

Gets the activity associated with the renderer.

Returns
The ARActivity that is associated with the renderer.
AssetManager getAssetManager ( )
inline

Returns the ARRenderer's AssetManger. Used for accessing assets in the applications package.

Returns
AssetManager The current renderer's asset manager.
float getBlendInfluence ( )
inline

Returns blend influence.

Returns
List<Matrix4f> getBones ( )
inline

Returns list of bones.

Returns
List<Matrix4f>.
ARCamera getCamera ( )
inline

Returns the ARRenderer's current camera.

Returns
String getDataDir ( )
inline

Returns package data directory.

Returns
String of the package's data directory
ARRenderTarget getDefaultRenderTarget ( )
inline

Return the default render target.

Returns
The default render target
List<ARIndexBuffer> getIndexBuffers ( )
inline

Returns list of ARRenderers index buffers.

Returns
List of ARIndexBuffer
static ARRenderer getInstance ( )
inlinestatic

Returns the ARRenderer singleton.

Returns
The singleton instance.
Vector3f getLightPosition ( )
inline

Returns the ARRenderer's current light position.

Returns
Vector3f
List<MediaPlayer> getMediaPlayers ( )
inline

Returns list of ARRenderers media players.

Returns
List<MediaPlayer>
Matrix4f getModelMatrix ( )
inline

Return the ARRenderer's current model matrix.

Returns
Matrix4f
Matrix4f getModelViewMatrix ( )
inline

Return the camera's model view matrix.

Returns
Matrix4f
Matrix4f getModelViewProjectionMatrix ( )
inline

Returns the ARRenderer's current model view projection matrix.

Returns
Matrix4f
Vector3f getNextCaptureColour ( )
inline

Returns a unique colour. Used for determining whether a node has been touched. This is an internal method and should not be used.

Returns
Vector3f The capture colour.
Matrix3f getNormalMatrix ( )
inline

Return the ARRenderer's current normal matrix.

Returns
Matrix4f
Matrix4f getProjectionMatrix ( )
inline

Return the camera's projection matrix.

Returns
Matrix4f of the projection matrix
boolean getRenderForCapture ( )
inline

Returns whether the renderer should render the frame to detect touch events.

Returns
boolean.
List<ARRenderTarget> getRenderTargets ( )
inline

Return the List of ARRenderTargets that are added to this renderer.

Returns
List of ARRenderer's ARRenderTargets.
long getRenderTime ( )
inline

Returns the current render time.

Returns
long Current render time.
List<ARShaderProgram> getShaders ( )
inline

Returns list of ARRenderer's shaders.

Returns
List of ARShaderProgram
List<ARTexture> getTextures ( )
inline

Returns list of ARRenderers textures.

Returns
List of ARTexture
List<ARVertexBuffer> getVertexBuffers ( )
inline

Returns list of ARRenderers vertex buffers.

Returns
List of ARVertexBuffer
Vector3f getWorldCameraPosition ( )
inline

Return the ARRenderer's current camera world position.

Returns
Vector3f
void initialise ( )
inline

Initialises the ARRenderer. This is called automatically by getInstance() if the ARRenderer is not initialised. Calling this directly will clear all values held by the renderer.

void initialise ( ARActivity  mARActivity)
inline

Initialises the ARRenderer with the current ARActivity being rendered. Called when the ARFragment is associated with its ARActivity.

Parameters
mARActivitythe ARActivity to use for initialisation
void loadContext ( )
inline

Loads the ARRenderer's current context.

void makeActiveVideoTexture ( ARVideoTexture  videoTexture)
inline

Sets active video texture and opens it.

Parameters
videoTextureThe texure being set.
void pause ( )
inline

Pause the ARRenderer. Updates all ARRendererListener's that the ARRenderer has paused.

void queuePreRenderEvent ( Runnable  runnable)
inline

Queues an event for running on the ARRenderer's thread. Event is triggered before preRender.

Parameters
runnableTask to be completed.
synchronized void removeListener ( ARRendererListener  listener)
inline

Remove an ARRendererListener from ARRenderer's list of ARRendererListeners.

Parameters
listenerARRendererListener listener to be removed.
void render ( )
inline

Renders the current camera frame and updates listeners with ARRendererListerner events.

void reset ( )
inline

Clears all values held by the ARRenderer.

void resume ( )
inline

Resume the ARRenderer. Updates all ARRendererListener's that the ARRenderer has resumed.

void setActivity ( ARActivity  mActivity)
inline

Sets the activity associated with the renderer.

Parameters
mActivityThe ARActivity to assign to the renderer.
void setAssetManager ( AssetManager  assetManager)
inline

Sets the ARRenderer's AssetManger.

Parameters
assetManagerThe asset manager used by the renderer to retrieve assets in the application package.
void setBlendInfluence ( float  influence)
inline

Sets blend influence.

Parameters
influence
void setBones ( List< Matrix4f >  bones)
inline

Sets list of bones.

Parameters
bones
void setCamera ( ARCamera  camera)
inline

Sets the ARRenderer's current camera.

Parameters
camera
void setCameraSize ( int  x,
int  y 
)
inline

Sets camera resolution in pixels.

Parameters
xCamera width.
yCamera height.
void setDataDir ( String  dataDir)
inline

Sets package data directory.

Parameters
dataDiras a String
void setLightPosition ( Vector3f  lightPosition)
inline

Sets the ARRenderer's current light position.

Parameters
lightPosition
void setModelMatrix ( Matrix4f  modelMatrix)
inline

Sets ARRenderer's current model matrix.

Parameters
modelMatrixas a Matrix4f
void setModelViewMatrix ( Matrix4f  modelViewMatrix)
inline

Sets model view matrix.

Parameters
modelViewMatrixas a Matrix4f
void setNormalMatrix ( Matrix3f  normalMatrix)
inline

Sets the ARRenderer's current normal matrix.

Parameters
normalMatrixas a Matrix3f
void setProjectionMatrix ( Matrix4f  projectionMatrix)
inline

Sets camera's projection matrix.

Parameters
projectionMatrix
void setScreenSize ( int  x,
int  y 
)
inline

Sets device's screen size in pixels.

Parameters
xDevice width.
yDevice height.
void setTouchCoords ( Point  point)
inline

Sets coordinates of user touch interaction.

Parameters
point
void setupCameraFBO ( )
inline

Sets up the camera Frame Buffer Object.

void setupCaptureFBO ( )
inline

Sets up the capture frame buffer object used for detecting whether a node was touched.

void setWorldCameraPosition ( Vector3f  worldCameraPosition)
inline

Set the ARRenderer's current camera world position.

Parameters
worldCameraPosition

Field Documentation

Vector2f cameraFBOResolution

Frame buffer object resolution.

Vector2f mScreenSize

Device screen size in pixels.


The documentation for this class was generated from the following file: