HERE Android SDK Developer's Guide

ARObject

The class ARObject is a member of com.here.android.mpa.ar .

Class Summary

public abstract class ARObject

extends java.lang.Object

Represents a base class for all AR related objects that users can add to a ARController.

[For complete information, see the section Class Details]

Nested Class Summary

Table 1. Nested Classes in ARObject
Nested Classes

public static final enumeration ARObject.IconType

Icon types used by ARObject

Method Summary

Table 2. Methods in ARObject
Methods

public boolean equals (Object obj)

For documentation, see java.lang.Object

public RectF getBoundingBox ()

Get bounding box limiting where the ARObject can travel on screen.

public GeoCoordinate getCoordinate ()

Gets the current GeoCoordinate for the ARObject.

public Image getIcon (IconType type)

Gets the icon image for the ARObject

public PointF getIconAnchor (IconType type)

Get down icon's anchor point represented as halfs of width and height of the icon.

public float getIconSizeScale (IconType type)

Gets icon's size scaling factor

public float getMaxViewAngle ()

Get item's max view angle when the item is on the right or left from line of sight.

public float getOpacity ()

Get item's opacity.

public ProjectionType getProjectionType ()

Get Camera view ARController.ProjectionType

public long getUid ()

Get unique identifier.

public int hashCode ()

For documentation, see java.lang.Object

public boolean isInfoExtended ()

Checks if info portion of the ARObject is extended

public void setBoundingBox (RectF box)

Set bounding box to limit travel on the screen.

public void setCoordinate (GeoCoordinate coordinate)

Sets a GeoCoordinate for the ARObject.

public void setIcon (IconType type, Image icon)

Sets an icon image for the ARObject.

public void setIcon (IconType type, View icon)

Sets an icon image for the ARObject.

public void setIcon (IconType type, Bitmap icon)

Sets an icon image for the ARObject.

public void setIconAnchor (IconType type, PointF anchor)

Set icon's anchor point represented as halfs of width and height of the icon.

public void setIconSizeScale (IconType type, float scale)

Sets icon's size scaling factor

public void setIconTexture (IconType type, int texture, int width, int height)

Sets an OpenGL texture name for the specified icon in the ARObject.

public void setInfoMaxHeight (int height)

Sets maximum height for the ARObject's info portion of the icon

public void setInfoMaxWidth (int width)

Sets maximum width for the ARObject's info portion of the icon

public void setMaxViewAngle (float angleDeg)

Set item max view angle when the item is on the right or left from line of sight.

public void setOpacity (float value)

Set item's opacity.

public void setProjectionType (ProjectionType type)

Set Camera view ARController.ProjectionType

Class Details

Represents a base class for all AR related objects that users can add to a ARController.

This class serves as a generalization (or abstract base) for more specified object types (such as ARIconObject), bundling their common properties.

Method Details

public boolean equals (Object obj)

For documentation, see java.lang.Object

Parameters:

  • obj

public RectF getBoundingBox ()

Get bounding box limiting where the ARObject can travel on screen.

Returns:

The android.graphics.RectF representing the bounding box.

public GeoCoordinate getCoordinate ()

Gets the current GeoCoordinate for the ARObject.

Returns:

The current GeoCoordinate

public Image getIcon (IconType type)

Gets the icon image for the ARObject

Parameters:

Returns:

An Image representing the front icon

public PointF getIconAnchor (IconType type)

Get down icon's anchor point represented as halfs of width and height of the icon.

Parameters:

Returns:

down icon's opacity.

public float getIconSizeScale (IconType type)

Gets icon's size scaling factor

Parameters:

Returns:

scale A size scaling factor

public float getMaxViewAngle ()

Get item's max view angle when the item is on the right or left from line of sight.

Returns:

The view angle of the item. The range is: - angleDeg to + angleDeg.

public float getOpacity ()

Get item's opacity. NOTE: Setting item's opacity overrides calculated value.

Returns:

A value of the opacity.

public ProjectionType getProjectionType ()

Get Camera view ARController.ProjectionType

Returns:

A value of ProjectionType

public long getUid ()

Get unique identifier. Helper method to accommodate faster mapping of the ARObject and application specific objects (Example: items "radar" implementation)

Returns:

Unique object identifier

public int hashCode ()

For documentation, see java.lang.Object

public boolean isInfoExtended ()

Checks if info portion of the ARObject is extended

Returns:

True, if object has expended info portion of the icon.

public void setBoundingBox (RectF box)

Set bounding box to limit travel on the screen. Left, top, right and bottom values are the ratios of the view's height and width. Value of 0 for left an top and 1 for right and bottom indicate that there are no boundaries are actually used. Values > 0 and < 1 are used to set absolute screen boundaries.

Parameters:

  • box

    android.graphics.RectF Item's bounding box. If null, bounding box is set to {0, 0, 1, 1}.

public void setCoordinate (GeoCoordinate coordinate)

Sets a GeoCoordinate for the ARObject.

Parameters:

public void setIcon (IconType type, Image icon)

Sets an icon image for the ARObject.

Parameters:

public void setIcon (IconType type, View icon)

Sets an icon image for the ARObject.

Parameters:

public void setIcon (IconType type, Bitmap icon)

Sets an icon image for the ARObject.

Parameters:

  • type

    An ARObject.IconType.

  • icon

    An android.graphics.Bitmap representing the icon type.

public void setIconAnchor (IconType type, PointF anchor)

Set icon's anchor point represented as halfs of width and height of the icon. Example: value of (1, 1) means that the center of the icon corresponds to the actual geo position. Value (1,2) means that half width and bottom of the icon corresponds to the actual geo position. Default value is (1, 1).

Parameters:

  • type

    An ARObject.IconType.

  • anchor

    X and Y offset coefficients represented as halfs of the icon width and height. Range is 0 to 2.0f. 0 --- 1 --- 2 | | | 1 --- x --- x | | | 2 --- x --- x

public void setIconSizeScale (IconType type, float scale)

Sets icon's size scaling factor

Parameters:

public void setIconTexture (IconType type, int texture, int width, int height)

Sets an OpenGL texture name for the specified icon in the ARObject. Previously set image (using setIcon(ARObject.IconType, Image) for example) is not disposed and can be used when texture is cleaned. Texture can be cleaned by passing -1 for texture parameter (i.e. setIconTexture(IconType.FRONT, -1, 0, 0)).

Parameters:

  • type

    An ARObject.IconType

  • texture

    An OpenGL texture name corresponding to the icon type specified.

  • width

    An OpenGL texture width

  • height

    An OpenGL texture height

public void setInfoMaxHeight (int height)

Sets maximum height for the ARObject's info portion of the icon

Parameters:

  • height

    A maximum height of the ARObject info portion on the screen

public void setInfoMaxWidth (int width)

Sets maximum width for the ARObject's info portion of the icon

Parameters:

  • width

    A maximum width of the ARObject info portion on the screen

public void setMaxViewAngle (float angleDeg)

Set item max view angle when the item is on the right or left from line of sight.

Parameters:

  • angleDeg

    The view angle of the item. The range is: - angleDeg to + angleDeg.

public void setOpacity (float value)

Set item's opacity. Setting item's opacity overrides the calculated value. Setting negative value resets previous setting to the default - calculated one.

Parameters:

  • value

    A value of the opacity.

public void setProjectionType (ProjectionType type)

Set Camera view ARController.ProjectionType

Parameters:

  • type

    A value of ProjectionType.

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.