Castle Game Engine: CastleCameras: Class TUniversalCamera

# Class TUniversalCamera
Description | Hierarchy | Fields | Methods | Properties
## Unit CastleCameras ## Declaration `type TUniversalCamera = class(TCamera)` ## Description Camera that allows any kind of navigation (Examine, Walk). You can switch between navigation types, while preserving the camera view. This simply keeps an TExamineCamera and TWalkCamera instances inside, and passes events (key, mouse presses, Update) to the current one. Properties (like camera position, direction, up vectors) are simply set on both instances simultaneously. For some uses you can even directly access the internal camera instances inside Examine and Walk properties. However, do not change them directly when you can use instead a property of this class. For example, it is Ok to directly change input key by `Walk.Input_Forward` (see TWalkCamera.Input_Forward). However, do not directly call `Walk.SetInitialView` (see TWalkCamera.SetInitialView), instead use a method of this class: TUniversalCamera.SetInitialView. This way both Examine and Walk will be kept in synch. ## Hierarchy TComponent TInputListener TCamera TUniversalCamera ## Overview ### Methods
| `procedure SetInput(const Value: TCameraInputs); override;`
| `procedure SetEnableDragging(const Value: boolean); override;`
| `procedure SetProjectionMatrix(const Value: TMatrix4Single); override;`
| `procedure SetContainer(const Value: TUIContainer); override;`
| `procedure SetRadius(const Value: Single); override;`
| `constructor Create(AOwner: TComponent); override;`
| `function Current: TCamera;`
| `function Matrix: TMatrix4Single; override;`
| `function RotationMatrix: TMatrix4Single; override;`
| `procedure GetView(out APos, ADir, AUp: TVector3Single); override;`
| `procedure GetView(out APos, ADir, AUp, AGravityUp: TVector3Single); override;`
| `function GetPosition: TVector3Single; override;`
| `function GetGravityUp: TVector3Single; override;`
| `procedure SetView(const APos, ADir, AUp: TVector3Single; const AdjustUp: boolean = true); override;`
| `procedure SetView(const APos, ADir, AUp, AGravityUp: TVector3Single; const AdjustUp: boolean = true); override;`
| `procedure Update(const SecondsPassed: Single; var HandleInput: boolean); override;`
| `function AllowSuspendForInput: boolean; override;`
| `function Press(const Event: TInputPressRelease): boolean; override;`
| `function Release(const Event: TInputPressRelease): boolean; override;`
| `function Motion(const Event: TInputMotion): boolean; override;`
| `function SensorTranslation(const X, Y, Z, Length: Double; const SecondsPassed: Single): boolean; override;`
| `function SensorRotation(const X, Y, Z, Angle: Double; const SecondsPassed: Single): boolean; override;`
| `procedure ContainerResize(const AContainerWidth, AContainerHeight: Cardinal); override;`
| `function GetNavigationType: TNavigationType; override;`
| `procedure SetInitialView( const AInitialPosition: TVector3Single; AInitialDirection, AInitialUp: TVector3Single; const TransformCurrentCamera: boolean); override;`
### Properties
| `property Examine: TExamineCamera read FExamine;`
| `property Walk: TWalkCamera read FWalk;`
| `property NavigationClass: TNavigationClass read FNavigationClass write SetNavigationClass default ncExamine;`
| `property NavigationType: TNavigationType read GetNavigationType write SetNavigationType default ntExamine;`
## Description ### Methods
| `procedure SetInput(const Value: TCameraInputs); override;`
| `procedure SetEnableDragging(const Value: boolean); override;`
| `procedure SetProjectionMatrix(const Value: TMatrix4Single); override;`
| `procedure SetContainer(const Value: TUIContainer); override;`
| `procedure SetRadius(const Value: Single); override;`
| `constructor Create(AOwner: TComponent); override;`
| `function Current: TCamera;`
`Current` (determined by NavigationClass) internal camera, that is either Examine or Walk.
| `function Matrix: TMatrix4Single; override;`
| `function RotationMatrix: TMatrix4Single; override;`
| `procedure GetView(out APos, ADir, AUp: TVector3Single); override;`
| `procedure GetView(out APos, ADir, AUp, AGravityUp: TVector3Single); override;`
| `function GetPosition: TVector3Single; override;`
| `function GetGravityUp: TVector3Single; override;`
| `procedure SetView(const APos, ADir, AUp: TVector3Single; const AdjustUp: boolean = true); override;`
| `procedure SetView(const APos, ADir, AUp, AGravityUp: TVector3Single; const AdjustUp: boolean = true); override;`
| `procedure Update(const SecondsPassed: Single; var HandleInput: boolean); override;`
| `function AllowSuspendForInput: boolean; override;`
| `function Press(const Event: TInputPressRelease): boolean; override;`
| `function Release(const Event: TInputPressRelease): boolean; override;`
| `function Motion(const Event: TInputMotion): boolean; override;`
| `function SensorTranslation(const X, Y, Z, Length: Double; const SecondsPassed: Single): boolean; override;`
| `function SensorRotation(const X, Y, Z, Angle: Double; const SecondsPassed: Single): boolean; override;`
| `procedure ContainerResize(const AContainerWidth, AContainerHeight: Cardinal); override;`
| `function GetNavigationType: TNavigationType; override;`
| `procedure SetInitialView( const AInitialPosition: TVector3Single; AInitialDirection, AInitialUp: TVector3Single; const TransformCurrentCamera: boolean); override;`
### Properties
| `property Examine: TExamineCamera read FExamine;`
| `property Walk: TWalkCamera read FWalk;`
| `property NavigationClass: TNavigationClass read FNavigationClass write SetNavigationClass default ncExamine;`
Choose navigation method by choosing particular camera class. The names of this correspond to camera classes (TExamineCamera, TWalkCamera).
| `property NavigationType: TNavigationType read GetNavigationType write SetNavigationType default ntExamine;`
Choose navigation method by choosing particular camera class, and gravity and some other properties. This is a shortcut property for reading / writing a couple of other properties. When you set this, a couple of other properties are set. When you read this, we determine a sensible answer from a couple of other properties values. Setting this sets: NavigationClass, Input (and derived deprecated properties IgnoreAllInputs and MouseNavigation), Walk.Gravity (see TWalkCamera.Gravity), Walk.PreferGravityUpForRotations (see TWalkCamera.PreferGravityUpForRotations), Walk.PreferGravityUpForMoving (see TWalkCamera.PreferGravityUpForMoving) If you write to `NavigationType`, then you should not touch the above properties directly. That's because not every combination of above properties correspond to some sensible value of `NavigationType`. If you directly set some weird configuration, reading `NavigationType` will try it's best to determine the closest TNavigationType value that is similar to your configuration.
Generated by PasDoc 0.13.0 on 2015-06-15 04:43:09