GL View to draw the World using the ARRenderer. More...
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 |
GL View to draw the World using the ARRenderer.
|
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()
beyondarObject | The 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.
fill | Enable 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.
x | |
y | |
beyondarObjects | The output list to place all the BeyondarObject that collide with the screen cord |
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.
x | |
y | |
beyondarObjects | The output list to place all the BeyondarObject that collide with the screen cord |
ray | The ray that will hold the direction of the screen coordinate |
float com.beyondar.android.view.BeyondarGLSurfaceView.getDistanceFactor | ( | ) |
Get the distance factor.
float com.beyondar.android.view.BeyondarGLSurfaceView.getMaxDistanceToRender | ( | ) |
Get the distance (in meters) which the objects are being considered when rendering.
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.
float com.beyondar.android.view.BeyondarGLSurfaceView.getPushAwayDistance | ( | ) |
Get the closest distance which all the GeoObject can be displayed.
int com.beyondar.android.view.BeyondarGLSurfaceView.getSensorDelay | ( | ) |
Get the current sensor delay.
See android.hardware.SensorManager for more information
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.
factor | number bigger than 0. |
void com.beyondar.android.view.BeyondarGLSurfaceView.setFpsUpdatable | ( | FpsUpdatable | fpsUpdatable | ) |
Set the FpsUpdatable to get notified about the frames per seconds.
fpsUpdatable | The 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.
meters | to 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
maxDistanceSize | The 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.
minDistanceSize | The 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
delay |
void com.beyondar.android.view.BeyondarGLSurfaceView.setWorld | ( | World | world | ) |
Define the world where the objects are stored.
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.
callBack | GLSnapshotCallback |