public boolean movePosition ( float [ ] npos , NavMeshQuery navquery , QueryFilter filter ) { // Move along navmesh and update new position. Result < MoveAlongSurfaceResult > masResult = navquery . moveAlongSurface ( m_path . get ( 0 ) , m_pos , npos , filter ) ; if ( masResult . succeeded ( ) ) { m_path = mergeCorridorStartMoved ( m_path , masResult . result . getVisited ( ) ) ; // Adjust the position to stay on top of the navmesh. vCopy ( m_pos , masResult . result . getResultPos ( ) ) ; Result < Float > hr = navquery . getPolyHeight ( m_path . get ( 0 ) , masResult . result . getResultPos ( ) ) ; if ( hr . succeeded ( ) ) { m_pos [ 1 ] = hr . result ; } return true ; } return false ; }
Moves the position from the current location to the desired location adjusting the corridor as needed to reflect the change .