Class TUniversalCamera

DescriptionHierarchyFieldsMethodsProperties

Unit

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

Protected procedure SetInput(const Value: TCameraInputs); override;
Protected procedure SetEnableDragging(const Value: boolean); override;
Protected procedure SetProjectionMatrix(const Value: TMatrix4Single); override;
Protected procedure SetContainer(const Value: TUIContainer); override;
Protected procedure SetRadius(const Value: Single); override;
Public constructor Create(AOwner: TComponent); override;
Public function Current: TCamera;
Public function Matrix: TMatrix4Single; override;
Public function RotationMatrix: TMatrix4Single; override;
Public procedure GetView(out APos, ADir, AUp: TVector3Single); override;
Public procedure GetView(out APos, ADir, AUp, AGravityUp: TVector3Single); override;
Public function GetPosition: TVector3Single; override;
Public function GetGravityUp: TVector3Single; override;
Public procedure SetView(const APos, ADir, AUp: TVector3Single; const AdjustUp: boolean = true); override;
Public procedure SetView(const APos, ADir, AUp, AGravityUp: TVector3Single; const AdjustUp: boolean = true); override;
Public procedure Update(const SecondsPassed: Single; var HandleInput: boolean); override;
Public function AllowSuspendForInput: boolean; override;
Public function Press(const Event: TInputPressRelease): boolean; override;
Public function Release(const Event: TInputPressRelease): boolean; override;
Public function Motion(const Event: TInputMotion): boolean; override;
Public function SensorTranslation(const X, Y, Z, Length: Double; const SecondsPassed: Single): boolean; override;
Public function SensorRotation(const X, Y, Z, Angle: Double; const SecondsPassed: Single): boolean; override;
Public procedure ContainerResize(const AContainerWidth, AContainerHeight: Cardinal); override;
Public function GetNavigationType: TNavigationType; override;
Public procedure SetInitialView( const AInitialPosition: TVector3Single; AInitialDirection, AInitialUp: TVector3Single; const TransformCurrentCamera: boolean); override;

Properties

Published property Examine: TExamineCamera read FExamine;
Published property Walk: TWalkCamera read FWalk;
Published property NavigationClass: TNavigationClass read FNavigationClass write SetNavigationClass default ncExamine;
Published property NavigationType: TNavigationType read GetNavigationType write SetNavigationType default ntExamine;

Description

Methods

Protected procedure SetInput(const Value: TCameraInputs); override;
 
Protected procedure SetEnableDragging(const Value: boolean); override;
 
Protected procedure SetProjectionMatrix(const Value: TMatrix4Single); override;
 
Protected procedure SetContainer(const Value: TUIContainer); override;
 
Protected procedure SetRadius(const Value: Single); override;
 
Public constructor Create(AOwner: TComponent); override;
 
Public function Current: TCamera;

Current (determined by NavigationClass) internal camera, that is either Examine or Walk.

Public function Matrix: TMatrix4Single; override;
 
Public function RotationMatrix: TMatrix4Single; override;
 
Public procedure GetView(out APos, ADir, AUp: TVector3Single); override;
 
Public procedure GetView(out APos, ADir, AUp, AGravityUp: TVector3Single); override;
 
Public function GetPosition: TVector3Single; override;
 
Public function GetGravityUp: TVector3Single; override;
 
Public procedure SetView(const APos, ADir, AUp: TVector3Single; const AdjustUp: boolean = true); override;
 
Public procedure SetView(const APos, ADir, AUp, AGravityUp: TVector3Single; const AdjustUp: boolean = true); override;
 
Public procedure Update(const SecondsPassed: Single; var HandleInput: boolean); override;
 
Public function AllowSuspendForInput: boolean; override;
 
Public function Press(const Event: TInputPressRelease): boolean; override;
 
Public function Release(const Event: TInputPressRelease): boolean; override;
 
Public function Motion(const Event: TInputMotion): boolean; override;
 
Public function SensorTranslation(const X, Y, Z, Length: Double; const SecondsPassed: Single): boolean; override;
 
Public function SensorRotation(const X, Y, Z, Angle: Double; const SecondsPassed: Single): boolean; override;
 
Public procedure ContainerResize(const AContainerWidth, AContainerHeight: Cardinal); override;
 
Public function GetNavigationType: TNavigationType; override;
 
Public procedure SetInitialView( const AInitialPosition: TVector3Single; AInitialDirection, AInitialUp: TVector3Single; const TransformCurrentCamera: boolean); override;
 

Properties

Published property Examine: TExamineCamera read FExamine;
 
Published property Walk: TWalkCamera read FWalk;
 
Published 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).

Published 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:

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.14.0.