Class TCastleAutoNavigationViewport
Unit
Declaration
type TCastleAutoNavigationViewport = class(TCastleViewport)
Description
Warning: this symbol is deprecated: use TCastleViewport instead of this; it is more straightforward to create TCastleNavigation explicitly (rather than auto-detecting it) and just add it as TCastleViewport child
Automatically create and switch between various navigation classes on a viewport.
We don't advise using this class – usually it is more straightforward to just explicitly create own instances of classes like TCastleExamineNavigation, TCastleWalkNavigation, add them as TCastleViewport children, control which one is used by TCastleUserInterface.Exists.
This class allows more implicit management of current navigation type. Navigation can be adjusted using
auto-created when you use WalkNavigation, ExamineNavigation,
get and set by NavigationType,
it can also automatically follow navigation requested in the X3D file (using TNavigationInfoNode in MainScene) if AutoNavigation.
Hierarchy
- TObject
- TPersistent
- TComponent
- TCastleComponent
- TCastleUserInterface
- TCastleScreenEffects
- TCastleViewport
- TCastleAutoNavigationViewport
Overview
Methods
procedure Notification(AComponent: TComponent; Operation: TOperation); override; |
|
procedure BoundNavigationInfoChanged; override; |
|
function RequiredNavigation: TCastleNavigation; |
|
function WalkNavigation(const SwitchNavigationTypeIfNeeded: boolean = true): TCastleWalkNavigation; deprecated 'instead of this, just get and set "Navigation"; you can check if it is "TCastleWalkNavigation", you can set it to new "TCastleWalkNavigation" instance'; |
|
function ExamineNavigation(const SwitchNavigationTypeIfNeeded: boolean = true): TCastleExamineNavigation; deprecated 'instead of this, just get and set "Navigation"; you can check if it is "TCastleExamineNavigation", you can set it to new "TCastleExamineNavigation" instance'; |
|
function InternalExamineNavigation: TCastleExamineNavigation; |
|
function InternalWalkNavigation: TCastleWalkNavigation; |
|
function Internal2DNavigation: TCastle2DNavigation; |
|
procedure AssignDefaultNavigation; virtual; |
|
class function InternalGetNavigationType(const V: TCastleViewport): TNavigationType; |
Properties
property NavigationType: TNavigationType
read GetNavigationType write SetNavigationType
default ntNone; |
|
property AutoNavigation: Boolean
read FAutoNavigation write SetAutoNavigation default false; |
Description
Methods
procedure Notification(AComponent: TComponent; Operation: TOperation); override; |
|
This item has no description. |
procedure BoundNavigationInfoChanged; override; |
|
This item has no description. |
function RequiredNavigation: TCastleNavigation; |
|
Return current navigation. Automatically creates it if missing. |
function WalkNavigation(const SwitchNavigationTypeIfNeeded: boolean = true): TCastleWalkNavigation; deprecated 'instead of this, just get and set "Navigation"; you can check if it is "TCastleWalkNavigation", you can set it to new "TCastleWalkNavigation" instance'; |
|
Warning: this symbol is deprecated: instead of this, just get and set "Navigation"; you can check if it is "TCastleWalkNavigation", you can set it to new "TCastleWalkNavigation" instance Return the currently used navigation as TCastleWalkNavigation, making sure that current NavigationType is something using TCastleWalkNavigation.
|
function ExamineNavigation(const SwitchNavigationTypeIfNeeded: boolean = true): TCastleExamineNavigation; deprecated 'instead of this, just get and set "Navigation"; you can check if it is "TCastleExamineNavigation", you can set it to new "TCastleExamineNavigation" instance'; |
|
Warning: this symbol is deprecated: instead of this, just get and set "Navigation"; you can check if it is "TCastleExamineNavigation", you can set it to new "TCastleExamineNavigation" instance Return the currently used navigation as TCastleExamineNavigation, making sure that current NavigationType is something using TCastleExamineNavigation (but not TCastle2DNavigation, this wants a 3D navigation).
|
function InternalExamineNavigation: TCastleExamineNavigation; |
|
Navigation instances internally used by this viewport. Using these methods automatically creates these instances (so they are never Using these methods does not make these navigation instances current (in contast to calling ExamineNavigation, WalkNavigation or setting NavigationType). When you switch navigation types by calling ExamineNavigation, WalkNavigation or setting NavigationType the viewport keeps using these instances of navigation, instead of creating new navigation instances. This way all the navigation properties are preserved when you switch e.g. NavigationType from ntWalk to ntExamine to ntWalk again. |
function InternalWalkNavigation: TCastleWalkNavigation; |
|
This item has no description. |
function Internal2DNavigation: TCastle2DNavigation; |
|
This item has no description. |
procedure AssignDefaultNavigation; virtual; |
|
Assign Navigation to a default TCastleNavigation suitable for navigating in this scene. This is automatically used when Navigation is The implementation in base TCastleViewport uses TNavigationInfoNode from MainScene. If MainScene is not assigned, we create a simple navigation in Examine mode. |
class function InternalGetNavigationType(const V: TCastleViewport): TNavigationType; |
|
This item has no description. |
Properties
property NavigationType: TNavigationType
read GetNavigationType write SetNavigationType
default ntNone; |
|
Set Navigation and some of its' parameters (like TCastleWalkNavigation.Gravity and so on). If AutoNavigation, the initial Navigation as well as initial value of this property are automatically determined by the currently bound X3D NavigatinInfo node in the MainScene, and world bounding box. They are also automatically adjusted e.g. when current NavigatinInfo node changes. But you can set Navigation, or this property, manually to override the detected navigation. You should set AutoNavigation to Note that you can also affect the current Setting this sets:
If you write to |
property AutoNavigation: Boolean
read FAutoNavigation write SetAutoNavigation default false; |
|
Assign sensible Navigation looking at the initial world (Items) if it is not assigned. This also allows to later synchronize navigation properties when X3D NavigationInfo node changes, or a new NavigationInfo node is bound. By default it is |
Generated by PasDoc 0.16.0-snapshot.