Class TCastleExamineNavigation

Unit

Declaration

type TCastleExamineNavigation = class(TCastleNavigation)

Description

Navigate the 3D model in examine mode, like you would hold a box with the model inside.

Hierarchy

Overview

Fields

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

Methods

Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; 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 Init(const AModelBox: TBox3D; const ARadius: Single); deprecated 'use Viewport.Camera.Init, and set ModelBox, Radius manually';
Public function StopRotating: boolean;
Public procedure Move(coord: integer; const MoveDistance: Single); deprecated 'set Translation instead of using this method';
Public function GetNavigationType: TNavigationType; override;

Properties

Public property RotationEnabled: Boolean read FRotationEnabled write FRotationEnabled default true;
Public property MoveEnabled: Boolean read FMoveEnabled write FMoveEnabled default true;
Public property ZoomEnabled: Boolean read FZoomEnabled write FZoomEnabled default true;
Public property MouseButtonRotate: TMouseButton read FMouseButtonRotate write FMouseButtonRotate default mbLeft;
Public property MouseButtonMove: TMouseButton read FMouseButtonMove write FMouseButtonMove default mbMiddle;
Public property MouseButtonZoom: TMouseButton read FMouseButtonZoom write FMouseButtonZoom default mbRight;
Public property Rotations: TQuaternion read GetRotations write SetRotations;
Public property RotationsAnim: TVector3 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: TVector3 read GetTranslation write SetTranslation; deprecated 'use Translation';
Public property Translation: TVector3 read GetTranslation write SetTranslation;
Public property Turntable: boolean read FTurntable write FTurntable default false;
Public property ScaleFactor: Single read GetScaleFactor write SetScaleFactor default 1; deprecated 'use Camera.Orthographic.Scale';
Public property ScaleFactorMin: Single read FScaleFactorMin write SetScaleFactorMin default 0.01;
Public property ScaleFactorMax: Single read FScaleFactorMax write SetScaleFactorMax default 100.0;
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;
Public property MouseNavigation: boolean read GetMouseNavigation write SetMouseNavigation default true; deprecated;
Public property RotationAccelerationSpeed: Single read FRotationAccelerationSpeed write FRotationAccelerationSpeed default DefaultRotationAccelerationSpeed;
Public property RotationSpeed: Single read FRotationSpeed write FRotationSpeed default DefaultRotationSpeed;
Published property RotationAccelerate: boolean read FRotationAccelerate write SetRotationAccelerate default true;

Description

Fields

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

Methods

Public constructor Create(AOwner: TComponent); override;
 
Public destructor Destroy; 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 Init(const AModelBox: TBox3D; const ARadius: Single); deprecated 'use Viewport.Camera.Init, and set ModelBox, Radius manually';

Warning: this symbol is deprecated: use Viewport.Camera.Init, and set ModelBox, Radius manually

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 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 function GetNavigationType: TNavigationType; override;
 

Properties

Public property RotationEnabled: Boolean read FRotationEnabled write FRotationEnabled default true;

Enable rotating the camera around the model by user input. When False, no keys / mouse dragging / 3D mouse etc. can cause a rotation.

Note that this doesn't prevent from rotating by code, e.g. by setting Rotations property or calling SetView.

Public property MoveEnabled: Boolean read FMoveEnabled write FMoveEnabled default true;

Enable moving the camera by user input. When False, no keys / mouse dragging / 3D mouse etc. can make a move.

Note that this doesn't prevent from moving by code, e.g. by setting Translation property or calling SetView.

Public property ZoomEnabled: Boolean read FZoomEnabled write FZoomEnabled default true;

Enable zooming the camera on the model by user input. Depending on the projection, zooming either moves camera or scales the projection size. When False, no keys / mouse dragging / 3d mouse etc. can make a zoom.

Note that this doesn't prevent from zooming by code, e.g. by setting ScaleFactor property (to scale the projection size) or calling SetView (to move closer to the model).

Public property MouseButtonRotate: TMouseButton read FMouseButtonRotate write FMouseButtonRotate default mbLeft;

Drag with this mouse button to rotate the model.

The default values for MouseButtonRotate (left), MouseButtonMove (middle), MouseButtonZoom (right) were chosen to 1. match as much as possible behaviour of other programs (like Blender) and 2. be accessible to all users (e.g. not everyone has middle mouse button in comfortable place, like laptop+touchpad users). See castlecameras_default_examine_mouse_buttons.txt for more in-depth analysis.

Also note that for this navigation:

  • pressing left mouse button with Ctrl is considered like pressing right mouse button,

  • pressing left mouse button with Shift is considered like pressing middle mouse button.

Public property MouseButtonMove: TMouseButton read FMouseButtonMove write FMouseButtonMove default mbMiddle;

Drag with this mouse button to move the model.

Public property MouseButtonZoom: TMouseButton read FMouseButtonZoom write FMouseButtonZoom default mbRight;

Drag with this mouse button to zoom the model (look closer / further).

Public property Rotations: TQuaternion read GetRotations write SetRotations;

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

Public property RotationsAnim: TVector3 read FRotationsAnim write SetRotationsAnim;

Continuous 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: TVector3 read GetTranslation write SetTranslation; deprecated 'use Translation';

Warning: this symbol is deprecated: use Translation

 
Public property Translation: TVector3 read GetTranslation write SetTranslation;

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

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 GetScaleFactor write SetScaleFactor default 1; deprecated 'use Camera.Orthographic.Scale';

Warning: this symbol is deprecated: use Camera.Orthographic.Scale

Scale the projection size.

Public property ScaleFactorMin: Single read FScaleFactorMin write SetScaleFactorMin default 0.01;
 
Public property ScaleFactorMax: Single read FScaleFactorMax write SetScaleFactorMax default 100.0;
 
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;
 
Public property MouseNavigation: boolean read GetMouseNavigation write SetMouseNavigation default true; deprecated;

Warning: this symbol is deprecated.

Include/exclude niMouseDragging from Input instead.

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

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

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

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

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.


Generated by PasDoc 0.15.0.