Fork me
BeyondAR
Augmented Reality Framework for Android
 All Classes Functions Variables
com.beyondar.android.view.BeyondarGLSurfaceView Class Reference

GL View to draw the World using the ARRenderer. More...

Inheritance diagram for com.beyondar.android.view.BeyondarGLSurfaceView:
Collaboration diagram for com.beyondar.android.view.BeyondarGLSurfaceView:

Public Member Functions

 BeyondarGLSurfaceView (Context context)
 
 BeyondarGLSurfaceView (Context context, AttributeSet attrs)
 
void tackePicture (GLSnapshotCallback callBack)
 Take an snapshot of the view. More...
 
void setFpsUpdatable (FpsUpdatable fpsUpdatable)
 Set the FpsUpdatable to get notified about the frames per seconds. More...
 
void setVisibility (int visibility)
 
void setSensorDelay (int delay)
 Specify the delay to apply to the accelerometer and the magnetic field sensor. More...
 
int getSensorDelay ()
 Get the current sensor delay. More...
 
void setWorld (World world)
 Define the world where the objects are stored. More...
 
void onPause ()
 
void onResume ()
 
boolean onTouchEvent (final MotionEvent event)
 
synchronized void getBeyondarObjectsOnScreenCoordinates (float x, float y, ArrayList< BeyondarObject > beyondarObjects)
 Get the GeoObject that intersect with the coordinates x, y on the screen. More...
 
synchronized void getBeyondarObjectsOnScreenCoordinates (float x, float y, ArrayList< BeyondarObject > beyondarObjects, Ray ray)
 Get the GeoObject that intersect with the coordinates x, y on the screen. More...
 
void setPullCloserDistance (float maxDistanceSize)
 When a GeoObject is rendered according to its position it could look very small if it is far away. More...
 
float getPullCloserDistance ()
 Get the distance which all the GeoObject will be rendered if the are farther that the returned distance. More...
 
void setPushAwayDistance (float minDistanceSize)
 When a GeoObject is rendered according to its position it could look very big if it is too close. More...
 
float getPushAwayDistance ()
 Get the closest distance which all the GeoObject can be displayed. More...
 
void setMaxDistanceToRender (float meters)
 Set the distance (in meters) which the objects will be considered to render. More...
 
float getMaxDistanceToRender ()
 Get the distance (in meters) which the objects are being considered when rendering. More...
 
void setDistanceFactor (float meters)
 Set the distance factor for rendering all the objects. More...
 
float getDistanceFactor ()
 Get the distance factor. More...
 
void setBeyondarViewAdapter (BeyondarViewAdapter beyondarViewAdapter, ViewGroup parent)
 
void onBeyondarObjectsRendered (List< BeyondarObject > renderedBeyondarObjects)
 
void forceFillBeyondarObjectPositionsOnRendering (boolean fill)
 Use this method to fill all the screen positions of the BeyondarObject when a object is rendered. More...
 
void fillBeyondarObjectPositions (BeyondarObject beyondarObject)
 Use this method to fill all the screen positions of the BeyondarObject. More...
 

Protected Member Functions

ARRenderer createRenderer ()
 Override this method to change the renderer. More...
 

Protected Attributes

ARRenderer mRenderer
 

Detailed Description

GL View to draw the World using the ARRenderer.

Member Function Documentation

ARRenderer com.beyondar.android.view.BeyondarGLSurfaceView.createRenderer ( )
protected

Override this method to change the renderer.

For instance:
return new CustomARRenderer();

void com.beyondar.android.view.BeyondarGLSurfaceView.fillBeyondarObjectPositions ( BeyondarObject  beyondarObject)

Use this method to fill all the screen positions of the BeyondarObject.

After this method is called you can use the following:
BeyondarObject.getScreenPositionBottomLeft()
BeyondarObject.getScreenPositionBottomRight()
BeyondarObject.getScreenPositionTopLeft()
BeyondarObject.getScreenPositionTopRight()

Parameters
beyondarObjectThe BeyondarObject to compute
void com.beyondar.android.view.BeyondarGLSurfaceView.forceFillBeyondarObjectPositionsOnRendering ( boolean  fill)

Use this method to fill all the screen positions of the BeyondarObject when a object is rendered.

Remember that the information is filled when the object is rendered, so it is asynchronous.

After this method is called you can use the following:
BeyondarObject.getScreenPositionBottomLeft()
BeyondarObject.getScreenPositionBottomRight()
BeyondarObject.getScreenPositionTopLeft()
BeyondarObject.getScreenPositionTopRight()

Important Enabling this feature will reduce the FPS, use only when is needed.

Parameters
fillEnable or disable this feature.
synchronized void com.beyondar.android.view.BeyondarGLSurfaceView.getBeyondarObjectsOnScreenCoordinates ( float  x,
float  y,
ArrayList< BeyondarObject beyondarObjects 
)

Get the GeoObject that intersect with the coordinates x, y on the screen.

Parameters
x
y
beyondarObjectsThe output list to place all the BeyondarObject that collide with the screen cord
Returns
synchronized void com.beyondar.android.view.BeyondarGLSurfaceView.getBeyondarObjectsOnScreenCoordinates ( float  x,
float  y,
ArrayList< BeyondarObject beyondarObjects,
Ray  ray 
)

Get the GeoObject that intersect with the coordinates x, y on the screen.

Parameters
x
y
beyondarObjectsThe output list to place all the BeyondarObject that collide with the screen cord
rayThe ray that will hold the direction of the screen coordinate
Returns

Here is the call graph for this function:

float com.beyondar.android.view.BeyondarGLSurfaceView.getDistanceFactor ( )

Get the distance factor.

Returns
Distance factor
float com.beyondar.android.view.BeyondarGLSurfaceView.getMaxDistanceToRender ( )

Get the distance (in meters) which the objects are being considered when rendering.

Returns
meters

Here is the caller graph for this function:

float com.beyondar.android.view.BeyondarGLSurfaceView.getPullCloserDistance ( )

Get the distance which all the GeoObject will be rendered if the are farther that the returned distance.

Returns
The current max distance. 0 is the default behavior.
float com.beyondar.android.view.BeyondarGLSurfaceView.getPushAwayDistance ( )

Get the closest distance which all the GeoObject can be displayed.

Returns
The current minimum distance. 0 is the default behavior.
int com.beyondar.android.view.BeyondarGLSurfaceView.getSensorDelay ( )

Get the current sensor delay.

See android.hardware.SensorManager for more information

Returns
sensor delay
void com.beyondar.android.view.BeyondarGLSurfaceView.setDistanceFactor ( float  meters)

Set the distance factor for rendering all the objects.

As bigger the factor the closer the objects.

Parameters
factornumber bigger than 0.
void com.beyondar.android.view.BeyondarGLSurfaceView.setFpsUpdatable ( FpsUpdatable  fpsUpdatable)

Set the FpsUpdatable to get notified about the frames per seconds.

Parameters
fpsUpdatableThe event listener. Use null to remove the FpsUpdatable
void com.beyondar.android.view.BeyondarGLSurfaceView.setMaxDistanceToRender ( float  meters)

Set the distance (in meters) which the objects will be considered to render.

Parameters
metersto be rendered from the user.
void com.beyondar.android.view.BeyondarGLSurfaceView.setPullCloserDistance ( float  maxDistanceSize)

When a GeoObject is rendered according to its position it could look very small if it is far away.

Use this method to render far objects as if there were closer.
For instance if there are objects farther than 50 meters and we want them to be displayed as they where at 50 meters, we could use this method for that purpose.
To set it to the default behavior just set it to 0

Parameters
maxDistanceSizeThe top far distance (in meters) which we want to draw a GeoObject , 0 to set again the default behavior
void com.beyondar.android.view.BeyondarGLSurfaceView.setPushAwayDistance ( float  minDistanceSize)

When a GeoObject is rendered according to its position it could look very big if it is too close.

Use this method to render near objects as if there were farther.
For instance if there is an object at 1 meters and we want to have everything at to look like if they where at least at 10 meters, we could use this method for that purpose.
To set it to the default behavior just set it to 0.

Parameters
minDistanceSizeThe top near distance (in meters) which we want to draw a GeoObject , 0 to set again the default behavior.
void com.beyondar.android.view.BeyondarGLSurfaceView.setSensorDelay ( int  delay)

Specify the delay to apply to the accelerometer and the magnetic field sensor.

If you don't know what is the best value, don't touch it. The following values are applicable:

SensorManager.SENSOR_DELAY_UI
SensorManager.SENSOR_DELAY_NORMAL
SensorManager.SENSOR_DELAY_GAME
SensorManager.SENSOR_DELAY_GAME
SensorManager.SENSOR_DELAY_FASTEST

You can find more information in the android.hardware.SensorManager class

Parameters
delay
void com.beyondar.android.view.BeyondarGLSurfaceView.setWorld ( World  world)

Define the world where the objects are stored.

Parameters
world
void com.beyondar.android.view.BeyondarGLSurfaceView.tackePicture ( GLSnapshotCallback  callBack)

Take an snapshot of the view.

The callback will be notified when the picture is ready.

Parameters
callBackGLSnapshotCallback

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