Container that holds all the BeyondarObject to be rendered in the augmented reality world. More...
Public Member Functions | |
World (Context context) | |
Create an instance of the augmented reality world. More... | |
void | onResume () |
Notify the world that the application has been resumed. | |
void | onPause () |
Notify the world that the application has been paused. | |
BitmapCache | getBitmapCache () |
Get the bitmap cache used to load all the images. More... | |
void | addPlugin (WorldPlugin plugin) |
Add a WorldPlugin to the World. More... | |
boolean | removePlugin (WorldPlugin plugin) |
Remove existing plugin. More... | |
void | removeAllPlugins () |
WorldPlugin | getFirstPlugin (Class<?extends WorldPlugin > pluginClass) |
boolean | containsAnyPlugin (Class<?extends WorldPlugin > pluginClass) |
boolean | containsPlugin (WorldPlugin plugin) |
List< WorldPlugin > | getAllPugins (Class<?extends WorldPlugin > pluginClass) |
List< WorldPlugin > | getAllPlugins (Class<?extends WorldPlugin > pluginClass, List< WorldPlugin > result) |
List< WorldPlugin > | getAllPlugins () |
final synchronized void | addBeyondarObject (BeyondarObject beyondarObject) |
Add a BeyondarObject to the default list in the world. More... | |
synchronized void | addBeyondarObject (BeyondarObject beyondarObject, int worldListType) |
Add a BeyondarObject to the specified list in the world. More... | |
synchronized boolean | remove (BeyondarObject beyondarObject) |
Remove a BeyondarObject form the World. More... | |
synchronized void | forceProcessRemoveQueue () |
Force the world to remove all the removed BeyondarObject. | |
synchronized void | clearWorld () |
Clean all the data stored in the world object. | |
double | getLongitude () |
Get the user's longitude. More... | |
double | getAltitude () |
Get the user's altitude. More... | |
double | getLatitude () |
Get the user's latitude. More... | |
void | setGeoPosition (double latitude, double longitude, double altitude) |
Set user geo position. More... | |
final void | setGeoPosition (double latitude, double longitude) |
Set user geo position. More... | |
void | setLocation (Location location) |
Set user geo position using the Location object. More... | |
synchronized void | setDefaultImage (int imageResId) |
Set the default image of the world. More... | |
synchronized void | setDefaultImage (String uri) |
Set the default image of the world. More... | |
synchronized boolean | setDefaultImage (String uri, int type) |
Set the default image for the specified list type. More... | |
synchronized boolean | setDefaultBitmap (int imageResource, int type) |
Set the default image for the specified list type. More... | |
synchronized String | getDefaultImage (int type) |
Get the default image URI of the specified list. More... | |
synchronized String | getDefaultImage () |
Get the default image URI of the world. More... | |
int | checkIntersectionPlane (Plane plane, Point3 position, Vector3 direction, double[] lamda, Vector3 pNormal) |
BeyondarObjectList | getBeyondarObjectList (int type) |
Get the BeyondarObjectList for the specified type. More... | |
List< BeyondarObjectList > | getBeyondarObjectLists () |
Get the container that holds all the BeyondarObjectList in the World. More... | |
void | getBeyondarObjectsCollideRay (Ray ray, ArrayList< BeyondarObject > beyondarObjectsOutput, float maxDistance) |
Get all the BeyondarObject that collide with the com.beyondar.android.util.math.geom.Ray. More... | |
Static Public Member Functions | |
static List< BeyondarObject > | sortGeoObjectByDistanceFromCenter (List< BeyondarObject > vec) |
Static Public Attributes | |
static final int | LIST_TYPE_DEFAULT = 0 |
Default list type. | |
static final String | URI_PREFIX_DEFAULT_IMAGE = "com.beyondar_default_type" |
Image uri prefix for the default images. | |
Protected Member Functions | |
Context | getContext () |
Protected Attributes | |
List< WorldPlugin > | plugins |
Object | lockplugins = new Object() |
Container that holds all the BeyondarObject to be rendered in the augmented reality world.
com.beyondar.android.world.World.World | ( | Context | context | ) |
Create an instance of the augmented reality world.
context |
final synchronized void com.beyondar.android.world.World.addBeyondarObject | ( | BeyondarObject | beyondarObject | ) |
Add a BeyondarObject to the default list in the world.
beyondarObject |
synchronized void com.beyondar.android.world.World.addBeyondarObject | ( | BeyondarObject | beyondarObject, |
int | worldListType | ||
) |
Add a BeyondarObject to the specified list in the world.
beyondarObject |
void com.beyondar.android.world.World.addPlugin | ( | WorldPlugin | plugin | ) |
Add a WorldPlugin to the World.
If the plugin exist it will not be added again.
double com.beyondar.android.world.World.getAltitude | ( | ) |
Get the user's altitude.
BeyondarObjectList com.beyondar.android.world.World.getBeyondarObjectList | ( | int | type | ) |
Get the BeyondarObjectList for the specified type.
List<BeyondarObjectList> com.beyondar.android.world.World.getBeyondarObjectLists | ( | ) |
Get the container that holds all the BeyondarObjectList in the World.
void com.beyondar.android.world.World.getBeyondarObjectsCollideRay | ( | Ray | ray, |
ArrayList< BeyondarObject > | beyondarObjectsOutput, | ||
float | maxDistance | ||
) |
Get all the BeyondarObject that collide with the com.beyondar.android.util.math.geom.Ray.
ray | The ray to use for the collision calculus |
beyondarObjectsOutput | The ArrayList that will store the objects sorted by proximity. This list will be cleaned before. |
maxDistance | Max distance to consider if a com.beyondar.android.world.BeyondarObject can collide (in meters). |
BitmapCache com.beyondar.android.world.World.getBitmapCache | ( | ) |
Get the bitmap cache used to load all the images.
synchronized String com.beyondar.android.world.World.getDefaultImage | ( | int | type | ) |
Get the default image URI of the specified list.
type | the type of the list |
synchronized String com.beyondar.android.world.World.getDefaultImage | ( | ) |
Get the default image URI of the world.
double com.beyondar.android.world.World.getLatitude | ( | ) |
Get the user's latitude.
double com.beyondar.android.world.World.getLongitude | ( | ) |
Get the user's longitude.
synchronized boolean com.beyondar.android.world.World.remove | ( | BeyondarObject | beyondarObject | ) |
Remove a BeyondarObject form the World.
To do this, the function getWorldListType
is used.
beyondarObject |
boolean com.beyondar.android.world.World.removePlugin | ( | WorldPlugin | plugin | ) |
Remove existing plugin.
plugin | plugin to be removed |
synchronized boolean com.beyondar.android.world.World.setDefaultBitmap | ( | int | imageResource, |
int | type | ||
) |
Set the default image for the specified list type.
This image is used when there are no images loaded for a BeyondarObject.
imageResource | The default image reference. |
type | The type of the list to set the image. |
synchronized void com.beyondar.android.world.World.setDefaultImage | ( | int | imageResId | ) |
Set the default image of the world.
This default image is used when the BeyondarObject image is not available.
imageResId | Default image. |
synchronized void com.beyondar.android.world.World.setDefaultImage | ( | String | uri | ) |
Set the default image of the world.
This default image is used when the BeyondarObject image is not available.
uri | Default image. |
synchronized boolean com.beyondar.android.world.World.setDefaultImage | ( | String | uri, |
int | type | ||
) |
Set the default image for the specified list type.
This image is used when there are not any image loaded for a BeyondarObject.
uri | The default image |
type | The type of the list to set the bitmap |
void com.beyondar.android.world.World.setGeoPosition | ( | double | latitude, |
double | longitude, | ||
double | altitude | ||
) |
Set user geo position.
latitude | |
longitude | |
altitude |
final void com.beyondar.android.world.World.setGeoPosition | ( | double | latitude, |
double | longitude | ||
) |
Set user geo position.
latitude | |
longitude |
void com.beyondar.android.world.World.setLocation | ( | Location | location | ) |
Set user geo position using the Location object.
The altitude is not used because it is a big source of issues, the accuracy is too bad.
location |