HERE Android SDK Developer's Guide

ARModelObject

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

Class Summary

public abstract class ARModelObject

extends java.lang.Object

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

[For complete information, see the section Class Details]

Nested Class Summary

Table 1. Nested Classes in ARModelObject
Nested Classes

public static final enumeration ARModelObject.ShadingMode

Represents object's shading mode

Method Summary

Table 2. Methods in ARModelObject
Methods

public void clearTransformation ()

Set the model transformation to the identity matrix

public boolean equals (Object obj)

For documentation, see java.lang.Object

public void getDynamicScale (PointF interval, PointF factors)

Get the parameters for dynamic scaling of this object.

public float getOpacity ()

Get opacity

public ShadingMode getShadingMode ()

Get object shading mode

public Image getTexture ()

Get the texture for this object

public float[] getTransformation ()

Get the model transformation

public PointF getVisibilityRange ()

Get the distance range in meters around the camera over which this model is visible

public int hashCode ()

For documentation, see java.lang.Object

public void rotate (Vector3f rotationAxis, float rotationAngleDeg)

Apply a rotation to the model (model matrix is post-multiplied)

public void rotate (float xRotationDeg, float yRotationDeg, float zRotationDeg)

Apply a rotation to the model (model matrix is post-multiplied).

public void scale (float xScale, float yScale, float zScale)

Apply scaling to the model (model matrix is post-multiplied)

public void setDynamicScale (PointF interval, PointF factors)

Set the parameters for dynamic scaling of this object.

public void setOpacity (float opacity)

Set opacity

public void setShadingMode (ShadingMode mode)

Set object shading mode

public void setTexture (Image texture)

Set the texture for this object

public void setTransformation (float[] matrix)

Set the model transformation

public void setVisibilityRange (PointF range)

Set the distance range in meters around the camera over which this model is visible

public void translate (float xTranslation, float yTranslation, float zTranslation)

Apply a translation to the model (model matrix is post-multiplied)

Class Details

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

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

Method Details

public void clearTransformation ()

Set the model transformation to the identity matrix

public boolean equals (Object obj)

For documentation, see java.lang.Object

Parameters:

  • obj

public void getDynamicScale (PointF interval, PointF factors)

Get the parameters for dynamic scaling of this object.

Parameters:

  • interval

    in meters over which scaling is linearly interpolated

  • factors

    x and y are min and max scale factors

public float getOpacity ()

Get opacity

Returns:

Opacity used for this ARModelObject.

public ShadingMode getShadingMode ()

Get object shading mode

Returns:

The current object shading mode.

public Image getTexture ()

Get the texture for this object

Returns:

Image object

public float[] getTransformation ()

Get the model transformation

Returns:

array of 16 floats storing the model transformation (4x4 matrix) in column major order

public PointF getVisibilityRange ()

Get the distance range in meters around the camera over which this model is visible

Returns:

x and y are min and max visible distances, respectively

public int hashCode ()

For documentation, see java.lang.Object

public void rotate (Vector3f rotationAxis, float rotationAngleDeg)

Apply a rotation to the model (model matrix is post-multiplied)

Parameters:

  • rotationAxis

    Axis of rotation

  • rotationAngleDeg

    Rotation angle in degrees (right-hand convention)

public void rotate (float xRotationDeg, float yRotationDeg, float zRotationDeg)

Apply a rotation to the model (model matrix is post-multiplied). The rotation is specified as Euler angles: Rx(rx) * Ry(ry) * Rz(rz)

Parameters:

  • xRotationDeg

    rotation in degrees around X-axis (right-hand convention)

  • yRotationDeg

    rotation in degrees around Y-axis (right-hand convention)

  • zRotationDeg

    rotation in degrees around Z-axis (right-hand convention)

public void scale (float xScale, float yScale, float zScale)

Apply scaling to the model (model matrix is post-multiplied)

Parameters:

  • xScale

    Scaling factor in the X-axis direction

  • yScale

    Scaling factor in the Y-axis direction

  • zScale

    Scaling factor in the Z-axis direction

public void setDynamicScale (PointF interval, PointF factors)

Set the parameters for dynamic scaling of this object. After applying the model transformation the object is scaled as a linear function of its distance to the camera. The scaling is defined as follows: scaling(distance) = s_min if distance < d_min, = s_max if distance > d_max, = s_min + (distance - d_min) / (d_max - d_min) * (s_max - s_min), otherwise

Parameters:

  • interval

    in meters over which scaling is linearly interpolated

  • factors

    x and y are min and max scale factors

public void setOpacity (float opacity)

Set opacity

Parameters:

  • opacity

    to be used for this ARModelObject

public void setShadingMode (ShadingMode mode)

Set object shading mode

Parameters:

  • mode

    Shading mode to be used.

public void setTexture (Image texture)

Set the texture for this object

Parameters:

  • texture

    Object Image texture

public void setTransformation (float[] matrix)

Set the model transformation

Parameters:

  • matrix

    array of 16 floats storing the new model transformation (4x4 matrix) in column major order

public void setVisibilityRange (PointF range)

Set the distance range in meters around the camera over which this model is visible

Parameters:

  • range

    - x and y are min and max visible distances, respectively

public void translate (float xTranslation, float yTranslation, float zTranslation)

Apply a translation to the model (model matrix is post-multiplied)

Parameters:

  • xTranslation

    Translation in meters the X-axis direction

  • yTranslation

    Translation in meters the Y-axis direction

  • zTranslation

    Translation in meters the Z-axis direction