Navigation handles user input (key presses, mouse movement, touches on mobile devices, …​) to control the camera.

To use a navigation, just create and add the navigation component as a child of TCastleViewport. You can control the Exists property of the navigation to enable / disable it.

As TCastleNavigation class is abstract, you actually have to use some descendant of it, like:

You have complete freedom how do you handle the input in your games. You can

  • use one of our ready navigation classes listed above,

  • or implement a new descendant of TCastleNavigation,

  • or leave TCastleViewport.Navigation as nil and handle the navigation elsewhere. For example, move the camera in response to user input in your TStatePlay.Update.

See the Tutorial: Designing a 3D world and Tutorial: Designing a 2D world to see the typical workflow how do you manipulate the navigation using the editor.

To improve this documentation just edit the source of this page in AsciiDoctor (simple wiki-like syntax) and create a pull request to Castle Game Engine WWW (cge-www) repository.