PathEngine home previous: iMeshFederation::build2DTileMesh()next: iMeshFederation::buildTileMeshFromLocalGroundTiles()
Contents, API Reference, Interfaces, iMeshFederation, buildTileMeshFromContent



Generates an iMesh object for the specified tile in this federation, from local 2D content processing source data.


iMesh* buildTileMeshFromContent(int32_t tileIndex, const iContentChunkInstance* const * chunks_Buffer, uint32_t chunks_BufferEntries, const char *const* options, iOutputStream& os) const;


tileIndexThe index of the federation tile for which a mesh is being built.
chunks_Buffer, chunks_BufferEntries (See Passing Arrays.) An array of pointers to content chunk instance objects.

A set of named attributes to control how the geometry is processed.
Refer to Handling Attributes for information about passing sets of named attributes, and 2D Content Processing Options for information about the set of options that may be passed in to control geometry processing.

Note that some mesh loading options may also be passed into this method, to affect the final ground mesh ground mesh construction phase.

In addition to the above, a 'terrainHeight' value may also be specified to control the base height of the terrain stand-in geometry generated for the resulting tile mesh.

The 'filterFacesWithSlopeAbove' and 'optimiseWithThreshold' content processing options are currently ignored by this method. (If these are specified then a warning will be emitted.)

os If non-zero then a 'content snapshot' will be saved out to this output stream, (in tokenised format), just before performing the actual 2D content process.
This content snapshot can be useful for troubleshooting the 2D content process, or for reporting bugs or issues with this process.

Return Value

If the geometry passed in is validated successfully then a newly created Interface iMesh object is constructed to serve as the federation tile mesh for the federation tile with the specified index.
Otherwise non-fatal errors will be reported relating to the validation failure and zero will be returned.


The content chunk instance vector passed into this method should include all content chunk instances that are partially or fully overlapped by the represented region of this tile.
(This represented region can be obtained by calling iMeshFederation::getRepresentedRegion_World(). The horizontal extents of a given content chunk instance can be obtained with iContentChunkInstance::getHorizontalRange().)

To avoid ID conflicts across content chunk instances, anchor and named obstacle IDs are prefixed by the section ID of the containing content chunk instance, and then the separator character ':' (e.g. the prefix string "25:" in the case of a content chunk instance with section ID 25).

Note that the geometry passed in is in 'federation world coordinates', with the resulting mesh geometry being generated in local coordinates for the tile being generated.

Refer to 2D Content Processing for information about PathEngine's 2D content processing functionality.
The process applied to the source geometry in this method is similar to the process applied to the source geometry for iPathEngine::buildMeshFromContent(), but with some additional constraints and restrictions.
Refer to Constructing Mesh Federations for details about these additional constraints and restrictions.

It's important to correctly handle errors emitted by this method.
The 2D content processing will attempt to continue after most error cases in order to generate a useable mesh, but whilst the resulting tile mesh may be valid as an independant mesh some error situations will result in failure to translate between a mesh and neighbouring tiles.
Some examples are: if a portal fails to go down due to overlapping another portal, if an external shapes is not cut due to portals being cut by other external shapes, or if 'terrain external shapes' cross out of the terrain.

C# Mapping

Mesh buildTileMeshFromContent(int tileIndex, ContentChunkInstance[] chunks, string[] options, OutputStream os);

Java Mapping

Mesh buildTileMeshFromContent(int tileIndex, ContentChunkInstance[] chunks, String[] options, OutputStream os);

Documentation for PathEngine release 6.00 - Copyright © 2002-2016 PathEnginenext: iMeshFederation::buildTileMeshFromLocalGroundTiles()