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, idle) 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

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 Idle(const CompSpeed: Single; const HandleMouseAndKeys: boolean; var LetOthersHandleMouseAndKeys: 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 MouseMove(const OldX, OldY, NewX, NewY: Integer): boolean; override;
Public function Mouse3dTranslation(const X, Y, Z, Length: Double; const CompSpeed: Single): boolean; override;
Public function Mouse3dRotation(const X, Y, Z, Angle: Double; const CompSpeed: Single): boolean; override;
Public procedure ContainerResize(const AContainerWidth, AContainerHeight: Cardinal); 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: TCameraNavigationClass read FNavigationClass write SetNavigationClass default ncExamine;
Published property NavigationType: TCameraNavigationType read GetNavigationType write SetNavigationType default ntExamine;

Description

Methods

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 Idle(const CompSpeed: Single; const HandleMouseAndKeys: boolean; var LetOthersHandleMouseAndKeys: 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 MouseMove(const OldX, OldY, NewX, NewY: Integer): boolean; override;
 
Public function Mouse3dTranslation(const X, Y, Z, Length: Double; const CompSpeed: Single): boolean; override;
 
Public function Mouse3dRotation(const X, Y, Z, Angle: Double; const CompSpeed: Single): boolean; override;
 
Public procedure ContainerResize(const AContainerWidth, AContainerHeight: Cardinal); 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: 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).

Published 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.12.1 on 2013-02-04 20:26:49