PathEngine home | previous: | next: |
We need a way for the user to select a desired position to place or move agents on
a mesh.
The cMeshLOSPreprocess class, defined in "sampleShared/MeshLOSPreprocess.h", is used for this.
cPosition p = losPreprocess.positionAtMouse(*testbed); |
A cPosition uniquely identifies a position on the mesh.
This class is defined in i_pathengine.h, as follows:
(And see
class cPosition { public: cPosition() :cell(-1) {} int32_t x,y,cell; }; |
The 'x' and 'y' members are horizontal coordinates.
(See
The 'cell' member disambiguates between overlapping geometry at a given horizontal position.
The positionAtMouse() function returns the position that will be underneath the mouse cursor after
the mesh has been rendered for the current camera orientation.
(So the position found by intersection of a ray back through view space from the mouse screen position.)
If there are multiple layers underneath the mouse, a position on the top layer is returned.
If there is no position on the mesh currently underneath the mesh then positionAtMouse() returns an invalid position, in other words a position with the 'cell' member set to -1.
Documentation for PathEngine release 6.04 - Copyright © 2002-2024 PathEngine | next: |