Castle Game EngineIntroduction Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers |
Class TUniversalCamera
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
Overview
Methods
 |
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 MouseMove(const OldX, OldY, NewX, NewY: Integer): boolean; override; |
 |
function Mouse3dTranslation(const X, Y, Z, Length: Double; const SecondsPassed: Single): boolean; override; |
 |
function Mouse3dRotation(const X, Y, Z, Angle: Double; const SecondsPassed: Single): boolean; override; |
 |
procedure ContainerResize(const AContainerWidth, AContainerHeight: Cardinal); override; |
 |
procedure SetInitialView( const AInitialPosition: TVector3Single; AInitialDirection, AInitialUp: TVector3Single; const TransformCurrentCamera: boolean); override; |
Properties
Description
Methods
 |
constructor Create(AOwner: TComponent); override; |
|
 |
procedure GetView(out APos, ADir, AUp, AGravityUp: 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 MouseMove(const OldX, OldY, NewX, NewY: Integer): boolean; override; |
|
 |
function Mouse3dTranslation(const X, Y, Z, Length: Double; const SecondsPassed: Single): boolean; override; |
|
 |
function Mouse3dRotation(const X, Y, Z, Angle: Double; const SecondsPassed: Single): boolean; override; |
|
 |
procedure ContainerResize(const AContainerWidth, AContainerHeight: Cardinal); override; |
|
 |
procedure SetInitialView( const AInitialPosition: TVector3Single; AInitialDirection, AInitialUp: TVector3Single; const TransformCurrentCamera: boolean); override; |
|
Properties
 |
property NavigationClass: TCameraNavigationClass
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: TCameraNavigationType
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:
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 TCameraNavigationType value that is similar to your configuration.
|
Generated by PasDoc 0.13.0 on 2013-08-17 21:27:12
|