PathEngine home previous: iMesh::pointIsIn3DFace()next: iMesh::positionFor3DPoint_ExcludeTerrain()
Contents, API Reference, Interfaces, iMesh, positionFor3DPoint

iMesh::positionFor3DPoint()

Description

Enables you to obtain a position on a mesh underneath a point in 3D space.

Syntax

cPosition positionFor3DPoint(int32_t x, int32_t y, int32_t z) const;

Parameters

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.
If there is no such position then an explicitly invalid position is returned (i.e. a cPosition with cell set to -1).

Remarks

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.

Use iMesh::positionNear3DPoint() when you need to resolve points that may not be directly above the ground mesh.

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

C# Mapping

PathEngine.Position positionFor3DPoint(int x, int y, int z);

Java Mapping

Position positionFor3DPoint(int x, int y, int z);

Documentation for PathEngine release 6.04 - Copyright © 2002-2024 PathEnginenext: iMesh::positionFor3DPoint_ExcludeTerrain()