First Person Controls navigation constrained to navmesh

How do I constrain first-person navigation to a navmesh?