Class TCastleNavigation

Unit

Declaration

type TCastleNavigation = class(TCastleUserInterface)

Description

Handle user input to modify viewport's camera.

Once you create an instance of this class (create non-abstract descendants like TCastleExamineNavigation, TCastleWalkNavigation, TCastleThirdPersonNavigation) just and add it as TCastleViewport child. The navigation will automatically affect the current camera of parent viewport.

In many ways, this is just a normal TCastleUserInterface descendant. E.g. it processes input just like any other TCastleUserInterface descendant (there isn't any special mechanism through which TCastleViewport passes input to the navigation), the Exists property works and so on.

Note that you don't really need to use any TCastleNavigation to manipulate the camera. You can just access TCastleViewport.Camera from anywhere (like TCastleView code) and move, rotate it as you wish. TCastleNavigation is just a comfortable way to encapsulate some navigation methods, but it's not the only way to manipulate the camera.

Various TCastleNavigation descendants implement various navigation methods, for example TCastleExamineNavigation allows the user to rotate and scale the model (imagine that you're holding a 3D model in your hands and you look at it from various sides) and TCastleWalkNavigation implements typical navigation in the style of first-person shooter games.

Source: transform/castlecameras.pas (line 103).

Hierarchy


Generated by PasDoc 0.17.0.snapshot.