Gorilla.Camera
Unit Gorilla.Camera.pasClasses
- TGorillaCamera = class ( TCamera )
- TGorillaSmoothCameraController = class ( TDummy )
Enumerations
- enum TGorillaSmoothCameraControlType = ( scctRotateY, scctMoveY, scctZoom, scctShiftX, scctShiftY, scctShiftZ ) ;
Constants
Functions / Procedures
TGorillaSmoothCameraControlType
A type defining which camera controlling will be done by the TGorillaSmoothCameraController.
TGorillaCamera
Ancestors
Members
Fields
- protected FDef :
TCameraDef
- protected FSelfDef :
TCameraDef
- protected FDefIsStandalone :
Boolean
- protected FUpdateNeeded :
Boolean
- protected FNearPlane :
Single
- protected FFarPlane :
Single
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected function GetFOV ( ) : Single ;
- protected procedure SetFOV ( const AValue : Single ) ;
- protected function GetViewport ( ) : TObject ;
- protected function GetPerspectiveMatrix ( ) : TMatrix3D ;
- protected procedure MatrixChanged ( Sender : TObject ) ; override;
- protected procedure Render ( ) ; override;
- public procedure AfterConstruction ( ) ; override;
- public procedure AssignFrom ( Src : TPersistent ) ;
- public procedure LoadFromDefinition ( const ADef : TCameraDef ) ; virtual;
- public procedure Update ( ) ; virtual;
Properties
TGorillaSmoothCameraController
The smooth camera controller is a dummy component linked to a camera component and allows to rotate the linked camera around y-axis and move it on y-axis. Use this component in viewers where users need fluid control. The controller works by impulse which can be set by a viewport mouse events or by input controller events (gamepad, keyboard, mouse).
Ancestors
Members
Fields
- protected FCamera :
TCamera
- protected FViewport :
TControl
- protected FTimer :
TTimer
- protected FStopWatch :
TStopwatch
- protected FShowController :
Boolean
- protected FTypes :
TGorillaSmoothCameraControlTypes
- protected FImpulse :
TPoint3D
- protected FImpulseLimit :
TPoint3D
- protected FIntensity :
TPoint3D
- protected FDamping :
TPoint3D
- protected FLimitX :
TPointF
- protected FLimitY :
TPointF
- protected FLimitZ :
TPointF
- protected FShiftImpulse :
TPoint3D
- protected FShiftImpulseLimit :
Single
- protected FShiftDamping :
Single
- protected FShiftIntensity :
Single
- protected FIsUpdating :
Boolean
- protected FOnBeforeModify :
TOnCameraControllerEvent
- protected FOnAfterModify :
TOnCameraControllerEvent
- protected FMouseMove :
Boolean
- protected FLastMousePos :
TPointF
- protected FOnInternalMouseUp :
TMouseEvent
- protected FOnInternalMouseDown :
TMouseEvent
- protected FOnInternalMouseMove :
TMouseMoveEvent
- protected FOnInternalMouseWheel :
TMouseWheelEvent
- protected FOnStoredMouseUp :
TMouseEvent
- protected FOnStoredMouseDown :
TMouseEvent
- protected FOnStoredMouseMove :
TMouseMoveEvent
- protected FOnStoredMouseWheel :
TMouseWheelEvent
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
- private :
Single
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected function GetDeltaTime ( ) : Single ;
- protected procedure DoOnTimer ( Sender : TObject ) ; virtual;
- protected procedure SetCamera ( const AValue : TCamera ) ; virtual;
- protected procedure SetViewport ( const AValue : TControl ) ; virtual;
- protected function GetInterval ( ) : Integer ; virtual;
- protected procedure SetInterval ( const AValue : Integer ) ; virtual;
- protected function GetEnabled ( ) : Boolean ; virtual;
- protected procedure SetEnabled ( const AValue : Boolean ) ; virtual;
- protected procedure Notification ( AComponent : TComponent; Operation : TOperation ) ; override;
- protected procedure Render ( ) ; override;
- protected procedure DoOnMouseUp ( ASender : TObject; AButton : TMouseButton; AShift : TShiftState; X : Single; Y : Single ) ;
- protected procedure DoOnMouseDown ( ASender : TObject; AButton : TMouseButton; AShift : TShiftState; X : Single; Y : Single ) ;
- protected procedure DoOnMouseMove ( ASender : TObject; AShiftState : TShiftState; X : Single; Y : Single ) ;
- protected procedure DoOnMouseWheel ( ASender : TObject; AShift : TShiftState; AWheelDelta : Integer; var AHandled : Boolean ) ;
- protected procedure OverwriteViewportEvents ( ) ;
- protected procedure ResetViewportEvents ( ) ;
- public procedure AddImpulse
(
AOfs :
TPointF
)
;
virtual;
Call this procedure to rotate around Y axis (AOfs.X) and move the camera up or down (AOfs.Y).
- public procedure AddXImpulse
(
AAngle :
Single
)
;
virtual;
Call this procedure to rotate around Y axis.
- public procedure AddYImpulse
(
AAngle :
Single
)
;
virtual;
Call this procedure to move camera up and down.
- public procedure Zoom
(
AStrength :
Single
=
1
)
;
virtual;
Call this procedure if you want to zoom in or out. The strength parameter defines the intensity of zooming.
- public procedure Shift
(
AOfs :
TPoint3D
)
;
virtual;
Move the camera controller on X, Y and Z axis.
Properties
- public Impulse : TPoint3D
- public ShiftImpulse : TPoint3D
Get or set the current impulse for shifting on X, Y and Z axis.
read FShiftImpulse
write FShiftImpulse - published Types : TGorillaSmoothCameraControlTypes
- published ImpulseLimitRotate : Single
Limit the maximum input values for the rotation impulse.
- published ImpulseLimitUpAndDown : Single
Limit the maximum input values for the up/down movement impulse.
- published ImpulseLimitZoom : Single
Limit the maximum input values for the zoom impulse.
- published IntensityRotate : Single
Get or set the intensity of camera rotation.
- published IntensityUpAndDown : Single
Get or set the intensity of camera up and down movement.
- published IntensityZoom : Single
Get or set the intensity of camera zoom.
- published DampingRotate : Single
Get or set the damping value of camera rotation impulse.
- published DampingUpAndDown : Single
Get or set the damping value of camera up/down movement impulse.
- published DampingZoom : Single
Get or set the damping value of camera zoom impulse.
- published LimitRotationMin : Single
Get or set the min value of camera rotation around Y axis.
- published LimitRotationMax : Single
Get or set the max value of camera rotation around Y axis.
- published LimitUpAndDownMin : Single
Get or set the min value of camera up/down movement on Y axis.
- published LimitUpAndDownMax : Single
Get or set the max value of camera up/down movement on Y axis.
- published LimitZoomMin : Single
Get or set the min value of camera zoom on Z axis.
- published LimitZoomMax : Single
Get or set the min value of camera zoom on Z axis.
- published ShiftImpulseLimit : Single
- published ShiftDamping : Single
- published ShiftIntensity : Single
- published Camera : TCamera
- published Viewport : TControl
Link a viewport to the controller for automatic mouse event registration. If you do not link a viewport you have to call AddImpulse(), Zoom() and Shift() yourself.
read FViewport
write SetViewport - published ShowController : Boolean
Activate or deactivate a cube rendered at the position of the controller from the view of the attached camera.
read FShowController
write FShowController - published Interval : Integer
- published Enabled : Boolean