Class TExamineCamera

Unit

Declaration

type TExamineCamera = class(TCamera)

Description

Navigate the 3D model in examine mode, like you would hold a box with the model inside. The model is moved by Translation, rotated by Rotations and scaled by ScaleFactor.

Hierarchy

Overview

Fields

Public internal const DefaultRotationAccelerationSpeed = 5.0;
Public internal const DefaultRotationSpeed = 2.0;

Methods

Protected function GetPositionInternal: TVector3Single; override;
Protected procedure SetPosition(const Value: TVector3Single); override;
Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;
Public function Matrix: TMatrix4Single; override;
Public function MatrixInverse: TMatrix4Single;
Public function RotationMatrix: TMatrix4Single; 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 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 Init(const AModelBox: TBox3D; const ARadius: Single);
Public function StopRotating: boolean;
Public procedure Scale(const ScaleBy: Single); deprecated 'set ScaleFactor instead of using this method';
Public procedure Move(coord: integer; const MoveDistance: Single); deprecated 'set Translation instead of using this method';
Public procedure GetView(out APos, ADir, AUp: TVector3Single); override;
Public procedure GetView(out APos, ADir, AUp, AGravityUp: 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 VisibleChange; override;
Public function GetNavigationType: TNavigationType; override;

Properties

Public property Rotations: TQuaternion read FRotations write SetRotations;
Public property RotationsAnim: TVector3Single read FRotationsAnim write SetRotationsAnim;
Public property DragMoveSpeed: Single read FDragMoveSpeed write FDragMoveSpeed default 1.0;
Public property KeysMoveSpeed: Single read FKeysMoveSpeed write FKeysMoveSpeed default 1.0;
Public property MoveAmount: TVector3Single read FTranslation write SetTranslation; deprecated 'use Translation';
Public property Translation: TVector3Single read FTranslation write SetTranslation;
Public property CenterOfRotation: TVector3Single read FCenterOfRotation write SetCenterOfRotation;
Public property Turntable: boolean read FTurntable write FTurntable default false;
Public property ScaleFactor: Single read FScaleFactor write SetScaleFactor default 1;
Public property ModelBox: TBox3D read FModelBox write SetModelBox;
Public property Inputs_Move: T3BoolInputs read FInputs_Move;
Public property Inputs_Rotate: T3BoolInputs read FInputs_Rotate;
Public property Input_MoveXInc: TInputShortcut read GetInput_MoveXInc;
Public property Input_MoveXDec: TInputShortcut read GetInput_MoveXDec;
Public property Input_MoveYInc: TInputShortcut read GetInput_MoveYInc;
Public property Input_MoveYDec: TInputShortcut read GetInput_MoveYDec;
Public property Input_MoveZInc: TInputShortcut read GetInput_MoveZInc;
Public property Input_MoveZDec: TInputShortcut read GetInput_MoveZDec;
Public property Input_RotateXInc: TInputShortcut read GetInput_RotateXInc;
Public property Input_RotateXDec: TInputShortcut read GetInput_RotateXDec;
Public property Input_RotateYInc: TInputShortcut read GetInput_RotateYInc;
Public property Input_RotateYDec: TInputShortcut read GetInput_RotateYDec;
Public property Input_RotateZInc: TInputShortcut read GetInput_RotateZInc;
Public property Input_RotateZDec: TInputShortcut read GetInput_RotateZDec;
Public property Input_ScaleLarger: TInputShortcut read FInput_ScaleLarger;
Public property Input_ScaleSmaller: TInputShortcut read FInput_ScaleSmaller;
Public property Input_Home: TInputShortcut read FInput_Home;
Public property Input_StopRotating: TInputShortcut read FInput_StopRotating;
Published property MouseNavigation: boolean read GetMouseNavigation write SetMouseNavigation default true; deprecated;
Published property RotationAccelerate: boolean read FRotationAccelerate write SetRotationAccelerate default true;
Published property RotationAccelerationSpeed: Single read FRotationAccelerationSpeed write FRotationAccelerationSpeed default DefaultRotationAccelerationSpeed;
Published property RotationSpeed: Single read FRotationSpeed write FRotationSpeed default DefaultRotationSpeed;

Description

Fields

Public internal const DefaultRotationAccelerationSpeed = 5.0;
 
Public internal const DefaultRotationSpeed = 2.0;
 

Methods

Protected function GetPositionInternal: TVector3Single; override;
 
Protected procedure SetPosition(const Value: TVector3Single); override;
 
Public constructor Create(AOwner: TComponent); override;
 
Public destructor Destroy; override;
 
Public function Matrix: TMatrix4Single; override;
 
Public function MatrixInverse: TMatrix4Single;
 
Public function RotationMatrix: TMatrix4Single; 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 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 Init(const AModelBox: TBox3D; const ARadius: Single);

Initialize most important properties of this class: sets ModelBox and goes to a nice view over the entire scene.

In other words, this is just a shortcut to setting ModelBox, setting suitable initial view by SetInitialView, and then going to initial view by GoToInitial.

Public function StopRotating: boolean;

Sets RotationsAnim to zero, stopping the rotation of the model.

Public procedure Scale(const ScaleBy: Single); deprecated 'set ScaleFactor instead of using this method';

Warning: this symbol is deprecated: set ScaleFactor instead of using this method

 
Public procedure Move(coord: integer; const MoveDistance: Single); deprecated 'set Translation instead of using this method';

Warning: this symbol is deprecated: set Translation instead of using this method

 
Public procedure GetView(out APos, ADir, AUp: TVector3Single); override;
 
Public procedure GetView(out APos, ADir, AUp, AGravityUp: 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 VisibleChange; override;
 
Public function GetNavigationType: TNavigationType; override;
 

Properties

Public property Rotations: TQuaternion read FRotations write SetRotations;

Current rotation of the model. Rotation is done around ModelBox middle (with Translation added).

Public property RotationsAnim: TVector3Single read FRotationsAnim write SetRotationsAnim;

Continous rotation animation, applied each Update to Rotations.

Public property DragMoveSpeed: Single read FDragMoveSpeed write FDragMoveSpeed default 1.0;

How fast user moves the scene by mouse/touch dragging.

Public property KeysMoveSpeed: Single read FKeysMoveSpeed write FKeysMoveSpeed default 1.0;

How fast user moves the scene by pressing keys.

Public property MoveAmount: TVector3Single read FTranslation write SetTranslation; deprecated 'use Translation';

Warning: this symbol is deprecated: use Translation

 
Public property Translation: TVector3Single read FTranslation write SetTranslation;

How much to move the model. By default, zero.

Public property CenterOfRotation: TVector3Single read FCenterOfRotation write SetCenterOfRotation;

Center of rotation and scale, relative to Translation. By default, zero. Setting the ModelBox or calling Init sets this to the middle of the model bounding box (ModelBox), which is usually most natural.

Public property Turntable: boolean read FTurntable write FTurntable default false;

Turntable rotates the scene around its Y axis instead of current camera axis.

Public property ScaleFactor: Single read FScaleFactor write SetScaleFactor default 1;

How the model is scaled. Scaling is done around Translation + CenterOfRotation. This property may never be zero (or too near zero).

Public property ModelBox: TBox3D read FModelBox write SetModelBox;

The aproximate size of 3D model that will be viewed. This is the crucial property of this class that you have to set, to make the navigation work best. Setting this sets also CenterOfRotation to the middle of the box.

This is usually the only property that you have to set. The rest, like ScaleFactor, Translation, RotationsAnim will be almost directly controlled by user (through Press and other events). Rotations will be automatically modified by Update.

So often you only need to set ModelBox, once, and everything else will work smoothly.

Initially this is EmptyBox3D.

Public property Inputs_Move: T3BoolInputs read FInputs_Move;

Alternative ways to access Input_Move/Rotate(X|Y|Z)(Inc|Dec). Index the array (2nd index true means increase) instead of having to use the full identifier.

Public property Inputs_Rotate: T3BoolInputs read FInputs_Rotate;
 
Public property Input_MoveXInc: TInputShortcut read GetInput_MoveXInc;
 
Public property Input_MoveXDec: TInputShortcut read GetInput_MoveXDec;
 
Public property Input_MoveYInc: TInputShortcut read GetInput_MoveYInc;
 
Public property Input_MoveYDec: TInputShortcut read GetInput_MoveYDec;
 
Public property Input_MoveZInc: TInputShortcut read GetInput_MoveZInc;
 
Public property Input_MoveZDec: TInputShortcut read GetInput_MoveZDec;
 
Public property Input_RotateXInc: TInputShortcut read GetInput_RotateXInc;
 
Public property Input_RotateXDec: TInputShortcut read GetInput_RotateXDec;
 
Public property Input_RotateYInc: TInputShortcut read GetInput_RotateYInc;
 
Public property Input_RotateYDec: TInputShortcut read GetInput_RotateYDec;
 
Public property Input_RotateZInc: TInputShortcut read GetInput_RotateZInc;
 
Public property Input_RotateZDec: TInputShortcut read GetInput_RotateZDec;
 
Public property Input_ScaleLarger: TInputShortcut read FInput_ScaleLarger;
 
Public property Input_ScaleSmaller: TInputShortcut read FInput_ScaleSmaller;
 
Public property Input_Home: TInputShortcut read FInput_Home;
 
Public property Input_StopRotating: TInputShortcut read FInput_StopRotating;
 
Published property MouseNavigation: boolean read GetMouseNavigation write SetMouseNavigation default true; deprecated;

Warning: this symbol is deprecated.

Include/exclude ciMouseDragging from Input instead.

Published property RotationAccelerate: boolean read FRotationAccelerate write SetRotationAccelerate default true;

When True, rotation keys make the rotation faster, and the model keeps rotating even when you don't hold any keys. When False, you have to hold rotation keys to rotate.

Published property RotationAccelerationSpeed: Single read FRotationAccelerationSpeed write FRotationAccelerationSpeed default DefaultRotationAccelerationSpeed;

Speed to change the rotation acceleration, used when RotationAccelerate = True.

Published property RotationSpeed: Single read FRotationSpeed write FRotationSpeed default DefaultRotationSpeed;

Speed to change the rotation, used when RotationAccelerate = False.


Generated by PasDoc 0.14.0.