PathEngine home previous: iMesh::positionInSection()next: iMesh::positionInSectionInShape()
Contents, API Reference, Interfaces, iMesh, positionInSectionFor3DPoint



Variation on iMesh::positionFor3DPoint() enabling the resulting position to be restricted to a specified section.


cPosition positionInSectionFor3DPoint(int32_t sectionID, int32_t x, int32_t y, int32_t z) const;


sectionID The section to which the resulting position should be restricted.
A value of -1 may be passed in to indicate the entire mesh.
x X coordinate of the 3D query point.
y Y coordinate of the 3D query point.
z Z coordinate (height) of the 3D query point.

Return Value

A cPosition representing a point on the mesh directly underneath the specified 3D point, and in the specified section.
If there is no such position then an explicitly invalid position is returned (i.e. a cPosition with cell set to -1).


If there is no mesh face directly underneath the specified point then an invalid position is returned. (cell=-1)
If there is more than one layer of overlapping geometry directly under the point then a position on the highest layer is returned.
Layers above the point are ignored.

To obtain a position for an object that might be lying flush against the mesh it is advisable to add a small amount to the height of the 3d point passed in to these functions, to ensure the 3D point is actually above the desired ground.

See Converting to and from PathEngine's Position Representation for an overview of all the position conversion methods.

C# Mapping

PathEngine.Position positionInSectionFor3DPoint(int sectionID, int x, int y, int z);

Java Mapping

Position positionInSectionFor3DPoint(int sectionID, int x, int y, int z);

Documentation for PathEngine release 6.03 - Copyright © 2002-2021 PathEnginenext: iMesh::positionInSectionInShape()