PathEngine home previous: Interface iMeshFederationnext: iMeshFederation::buildTileMeshFromLocalGroundTiles()
Contents, API Reference, Interfaces, iMeshFederation, buildTileMeshFromContent

iMeshFederation::buildTileMeshFromContent()

Description

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

Syntax

iMesh* buildTileMeshFromContent(tSigned32 tileIndex, const iContentChunkInstance* const* instancePointers, tSigned32 numberOfInstances, const char *const* options, iOutputStream* os) const;

Parameters

tileIndexThe index of the federation tile for which a mesh is being built.
instancePointers An array of pointers to content chunk instance objects. The objects pointed to will not be deleted by PathEngine and pointers to these objects are not held after this method completes.
numberOfInstancesThe size of the array pointed to by instancePointers.
options

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.

Remarks

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().)

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.

The created Interface iMesh can be explicitly deleted when no longer required, but will also be deleted if iPathEngine::deleteAllObjects() is called - in either case the pointer can no longer be used. Any meshes not deleted will be cleaned up automatically when PathEngine is shut down.


Documentation for PathEngine release 5.16 - Copyright © 2002-2008 PathEnginenext: iMeshFederation::buildTileMeshFromLocalGroundTiles()