HERE Android SDK Developer's Guide

Mesh

The class Mesh is a member of com.here.android.mpa.mapping .

Class Summary

public abstract class Mesh

extends java.lang.Object

Represents a base class specifying common mesh data for a MapGeoModelObject or MapLocalModelObject .

[For complete information, see the section Class Details]

Method Summary

Table 1. Methods in Mesh
Methods

public FloatBuffer getTextureCoordinates ()

Gets a FloatBuffer containing the list of uv coordinates for the mesh.

public IntBuffer getVertexIndices ()

Gets the IntBuffer representing the list of mesh triangles.

public Mesh setTextureCoordinates (FloatBuffer uvCoordinates)

Sets a FloatBuffer representing a list of uv coordinates for the mesh.

public Mesh setVertexIndices (IntBuffer triangles)

Sets an IntBuffer representing a list of mesh triangles to render.

Class Details

Represents a base class specifying common mesh data for a MapGeoModelObject or MapLocalModelObject .

Properties of a mesh include:

  • Vertex positions - positions of the mesh vertices (the maximum number of positions is 65536). Note: the number of vertex positions should match the number of vertex texture coordinates, and both should be equal to the number of vertices in the mesh data.
  • Vertex texture coordinates - coordinates within the range of [0..1], used to reference the specified texture image (the maximum number of texture coordinates is 65536). Note: the number of vertex texture coordinates should match the number of vertex positions, and both should be equal to the number of vertices in the mesh data.
  • Triangles - the triangular faces of the mesh, defined as three indices referencing the corresponding set of vertices.

Method Details

public FloatBuffer getTextureCoordinates ()

Gets a FloatBuffer containing the list of uv coordinates for the mesh. The buffer contains pairs for each coordinate, where each pair is in the format uv( u, v ) and within the range of [0..1].

Returns:

A FloatBuffer with the mesh uv coordinates

public IntBuffer getVertexIndices ()

Gets the IntBuffer representing the list of mesh triangles. The buffer contains triplets for each triangle, where each triplet is in the format t( v1, v2, v3 ) .

Returns:

A IntBuffer with mesh triangles

public Mesh setTextureCoordinates (FloatBuffer uvCoordinates)

Sets a FloatBuffer representing a list of uv coordinates for the mesh. The buffer should be in pairs for each coordinate, where each pair is in the format uv( u, v ) and within the range of [0..1].

Parameters:

  • uvCoordinates

    A FloatBuffer of desired mesh uv coordinates

Returns:

The updated Mesh

Throws:

  • IllegalArgumentException

    if uvCoordinates is empty

  • IllegalArgumentException

    if uvCoordinates does not contain even number of float values.

See also:

java.nio.FloatBuffer

public Mesh setVertexIndices (IntBuffer triangles)

Sets an IntBuffer representing a list of mesh triangles to render. The buffer should be in triplets for each triangle, where each triplet is in the format t( v1, v2, v3 ) .

Parameters:

  • triangles

    A IntBuffer of desired mesh triangles

Returns:

The updated Mesh

Throws:

  • IllegalArgumentException

    if triangles is empty.

  • IllegalArgumentException

    if triangles is not containing triplets of integers.

See also:

java.nio.IntBuffer