HERE iOS SDK Developer's Guide

NMAGeoMesh

Class Summary

class NMAGeoMesh

Derived from: NSObject

Represents a 3D model.

Include: NMAKit.framework/headers/NMAGeoMesh.h

Inheritance Diagrams

Figure 1. Public inheritance diagram for NMAGeoMesh

[For complete information, see the section Class Details]

Instance Method Summary

Table 1. Instance Methods
Instance Method Summary

-(BOOL) isValid

Checks if the current mesh data is valid.

-(void) setTextureCoordinates:(const float *) textureCoordinates withCount:(NSUInteger) count

Sets the texture coordinates of the mesh.

-(void) setTriangles:(const short *) triangles withCount:(NSUInteger) count

Sets the triangles of the mesh.

-(void) setVertices:(NSArray *) vertices

Sets the vertices(geo-coordinates) of the mesh as an array of NMAGeoCoordinates

-(void) setVertices:(const double *) vertices withCount:(NSUInteger) count

Sets the vertices(geo-coordinates) of the mesh.

Class Details

Represents a 3D model.

The NMAGeoMesh class encapsulates all the geometric information needed to render a 3D model. This information includes the vertices, texture coordinates, and triangles of the model.

Instance Method Details

-(BOOL) isValid

Checks if the current mesh data is valid.

A mesh is considered valid if it has equal numbers of vertices and texture coordinates and the indices of the triangle array are all less than the number of vertices.

-(void) setTextureCoordinates:(const float *) textureCoordinates withCount:(NSUInteger) count

Sets the texture coordinates of the mesh.

Every mesh vertex must also have a texture coordinate defined, which identifies the location on the mesh texture corresponding to that vertex. Texture coordinates are defined by two float values in the range [0, 1], with a value of (0, 0) corresponding to the upper left corner of the texture and (1, 1) the lower right corner.

Parameters:

  • textureCoordinates

    A pointer to an array of floats representing the texture coordinates.

  • count

    The number of texture coordinates in the array. The length of the textureCoordinates array should be 3 * count.

-(void) setTriangles:(const short *) triangles withCount:(NSUInteger) count

Sets the triangles of the mesh.

A mesh is rendered as a collection of triangles. Each triangle is defined by specifying the indices of the three vertices which make up its corners. The indices may be specified in any order.

Parameters:

  • triangles

    A pointer to an array of shorts representing the triangles of the mesh.

  • count

    The number of triangles in the array. The length of the triangles array should be 3 * count.

-(void) setVertices:(NSArray *) vertices

Sets the vertices(geo-coordinates) of the mesh as an array of NMAGeoCoordinates.

Note:

The mesh is limited to 65536 NMAGeoCoordinates.

Parameters:

-(void) setVertices:(const double *) vertices withCount:(NSUInteger) count

Sets the vertices(geo-coordinates) of the mesh.

Each mesh vertex is represented by three float values representing its longitude, latitude, altitude positions. Three values are always required for each vertex, so the length of the vertices array should always be a multiple of 3.

Note:

The mesh is limited to 65536 vertices.

Parameters:

  • vertices

    A pointer to an array of floats representing the mesh vertices.

  • count

    The number of vertices in the array. The length of the vertices array should be 3 * count.