Support fragment class that displays and control the CameraView and the BeyondarGLSurfaceView More...
Public Member Functions | |
void | onCreate (Bundle savedInstanceState) |
void | onAttach (Activity activity) |
CameraView | getCameraView () |
Returns the CameraView for this class instance. More... | |
BeyondarGLSurfaceView | getGLSurfaceView () |
Returns the SurfaceView for this class instance. More... | |
View | onCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) |
void | onResume () |
void | onPause () |
void | setOnTouchBeyondarViewListener (OnTouchBeyondarViewListener listener) |
Set the listener to get notified when the user touch the AR view. More... | |
void | setOnClickBeyondarObjectListener (OnClickBeyondarObjectListener listener) |
Set the OnClickBeyondarObjectListener to get notified when the user click on a BeyondarObject. More... | |
boolean | onTouch (View v, final MotionEvent event) |
void | onClick (View v) |
World | getWorld () |
Get the World in use by the fragment. More... | |
void | setWorld (World world) |
Set the World that contains all the BeyondarObject that will be displayed. More... | |
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 | setFpsUpdatable (FpsUpdatable fpsUpdatable) |
Use this method to check the frames per second. More... | |
void | stopRenderingAR () |
Disable the GLSurface to stop rendering the AR world. | |
void | startRenderingAR () |
Enable the GLSurface to start rendering the AR world. | |
List< BeyondarObject > | getBeyondarObjectsOnScreenCoordinates (float x, float y) |
Get the GeoObject that intersect with the coordinates x, y on the screen. More... | |
void | getBeyondarObjectsOnScreenCoordinates (float x, float y, ArrayList< BeyondarObject > beyondarObjects) |
Get the GeoObject that intersect with the coordinates x, y on the screen. More... | |
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 | takeScreenshot (OnScreenshotListener listener, BitmapFactory.Options options) |
Take a screenshot of the beyondar fragment. More... | |
void | takeScreenshot (OnScreenshotListener listener) |
Take a screenshot of the beyondar fragment. More... | |
void | showFPS (boolean show) |
Show the number of frames per second in the left upper corner. More... | |
void | onFpsUpdate (final float fps) |
void | setBeyondarViewAdapter (BeyondarViewAdapter adapter) |
Set the adapter to draw the views on top of the AR View. More... | |
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... | |
void | setMaxFarDistance (float maxDistanceSize) |
Use setPullCloserDistance instead. | |
float | getMaxDistanceSize () |
Use getPushFrontDistance instead. | |
void | setMinFarDistanceSize (float minDistanceSize) |
Use setPushAwayDistance instead. | |
float | getMinDistanceSize () |
Use getPushAwayDistance instead. | |
void | onFpsUpdate (float fps) |
This method will get the frames per second rendered by the ARRenderer. More... | |
Protected Member Functions | |
BeyondarGLSurfaceView | createBeyondarGLSurfaceView () |
Override this method to personalize the BeyondarGLSurfaceView that will be instantiated. More... | |
CameraView | createCameraView () |
Override this method to personalize the CameraView that will be instantiated. More... | |
Support fragment class that displays and control the CameraView and the BeyondarGLSurfaceView
It also provide a set of utilities to control the usage of the augmented reality world.
|
protected |
Override this method to personalize the BeyondarGLSurfaceView that will be instantiated.
|
protected |
Override this method to personalize the CameraView that will be instantiated.
void com.beyondar.android.fragment.BeyondarFragmentSupport.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.fragment.BeyondarFragmentSupport.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. |
List<BeyondarObject> com.beyondar.android.fragment.BeyondarFragmentSupport.getBeyondarObjectsOnScreenCoordinates | ( | float | x, |
float | y | ||
) |
Get the GeoObject that intersect with the coordinates x, y on the screen.
Important When this method is called a new List is created.
x | X screen position. |
y | Y screen position. |
void com.beyondar.android.fragment.BeyondarFragmentSupport.getBeyondarObjectsOnScreenCoordinates | ( | float | x, |
float | y, | ||
ArrayList< BeyondarObject > | beyondarObjects | ||
) |
Get the GeoObject that intersect with the coordinates x, y on the screen.
x | X screen position. |
y | Y screen position. |
beyondarObjects | The output list where all the BeyondarObject that collide with the screen cord will be stored. |
void com.beyondar.android.fragment.BeyondarFragmentSupport.getBeyondarObjectsOnScreenCoordinates | ( | float | x, |
float | y, | ||
ArrayList< BeyondarObject > | beyondarObjects, | ||
Ray | ray | ||
) |
Get the GeoObject that intersect with the coordinates x, y on the screen.
x | screen position. |
y | screen position. |
beyondarObjects | The output list where all the BeyondarObject that collide with the screen cord will be stored. |
ray | The ray that will hold the direction of the screen coordinate. |
CameraView com.beyondar.android.fragment.BeyondarFragmentSupport.getCameraView | ( | ) |
Returns the CameraView for this class instance.
float com.beyondar.android.fragment.BeyondarFragmentSupport.getDistanceFactor | ( | ) |
Get the distance factor.
BeyondarGLSurfaceView com.beyondar.android.fragment.BeyondarFragmentSupport.getGLSurfaceView | ( | ) |
Returns the SurfaceView for this class instance.
float com.beyondar.android.fragment.BeyondarFragmentSupport.getMaxDistanceToRender | ( | ) |
Get the distance (in meters) which the objects are being considered when rendering.
float com.beyondar.android.fragment.BeyondarFragmentSupport.getPullCloserDistance | ( | ) |
Get the distance which all the GeoObject will be rendered if the are farther that the returned distance.
float com.beyondar.android.fragment.BeyondarFragmentSupport.getPushAwayDistance | ( | ) |
Get the closest distance which all the GeoObject can be displayed.
int com.beyondar.android.fragment.BeyondarFragmentSupport.getSensorDelay | ( | ) |
World com.beyondar.android.fragment.BeyondarFragmentSupport.getWorld | ( | ) |
Get the World in use by the fragment.
|
inherited |
This method will get the frames per second rendered by the ARRenderer.
fps | The Frames per second rendered |
void com.beyondar.android.fragment.BeyondarFragmentSupport.setBeyondarViewAdapter | ( | BeyondarViewAdapter | adapter | ) |
Set the adapter to draw the views on top of the AR View.
adapter |
void com.beyondar.android.fragment.BeyondarFragmentSupport.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.fragment.BeyondarFragmentSupport.setFpsUpdatable | ( | FpsUpdatable | fpsUpdatable | ) |
Use this method to check the frames per second.
fpsUpdatable | Listener that will be notified with current fps. |
void com.beyondar.android.fragment.BeyondarFragmentSupport.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.fragment.BeyondarFragmentSupport.setOnClickBeyondarObjectListener | ( | OnClickBeyondarObjectListener | listener | ) |
Set the OnClickBeyondarObjectListener to get notified when the user click on a BeyondarObject.
listener |
void com.beyondar.android.fragment.BeyondarFragmentSupport.setOnTouchBeyondarViewListener | ( | OnTouchBeyondarViewListener | listener | ) |
Set the listener to get notified when the user touch the AR view.
listener |
void com.beyondar.android.fragment.BeyondarFragmentSupport.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.fragment.BeyondarFragmentSupport.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.fragment.BeyondarFragmentSupport.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
delay | Sensor delay. |
void com.beyondar.android.fragment.BeyondarFragmentSupport.setWorld | ( | World | world | ) |
Set the World that contains all the BeyondarObject that will be displayed.
world | The World that holds the information of all the elements. |
IllegalStateException | If the device do not have the required sensors available. |
void com.beyondar.android.fragment.BeyondarFragmentSupport.showFPS | ( | boolean | show | ) |
Show the number of frames per second in the left upper corner.
False by default.
show | True to show the FPS, false otherwise. |
void com.beyondar.android.fragment.BeyondarFragmentSupport.takeScreenshot | ( | OnScreenshotListener | listener, |
BitmapFactory.Options | options | ||
) |
Take a screenshot of the beyondar fragment.
The screenshot will contain the camera and the AR world overlapped.
listener | OnScreenshotListener That will be notified when the screenshot is ready. |
options | Bitmap options. |
void com.beyondar.android.fragment.BeyondarFragmentSupport.takeScreenshot | ( | OnScreenshotListener | listener | ) |
Take a screenshot of the beyondar fragment.
The screenshot will contain the camera and the AR world overlapped.
listener | OnScreenshotListener That will be notified when the screenshot is ready. |