Gorilla.Controller.Input.FirstPerson
Unit Gorilla.Controller.Input.FirstPerson.pasClasses
- TGorillaFirstPersonController = class ( TGorillaCharacterController )
TGorillaFirstPersonController
The first-person controller is a non-visual control to handle movement in 3D space from ego-perspective.
Remarks
You have to link an input controller to the controller to react on mouse and key input.Ancestors
Members
Fields
- protected FRotationDragMode :
Boolean
- protected FRotationDragModeButton :
TGorillaMouseState
- protected FRotateAroundCenter :
Boolean
- protected FMovementDragMode :
Boolean
- protected FMovementDragModeButton :
TGorillaMouseState
- protected FInvertMovementDragModeXAxis :
Boolean
- protected FInvertMovementDragModeYAxis :
Boolean
- protected FMouseIsDown :
Boolean
- protected FMouseControllerSpeed :
Single
- protected FGamePadThumbstickSpeed :
Single
- protected FShowCursor :
Boolean
- protected FUseDefaultBehaviour :
Boolean
- protected FUseDefaultMovement :
Boolean
- protected FJumpAnim :
TFloatAnimation
- protected FCrouchAnim :
TFloatAnimation
- protected FCrawlAnim :
TFloatAnimation
- protected FLatestLeftThumbStick :
NativeUInt
- protected FLatestRightThumbStick :
NativeUInt
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected procedure SetInputController ( const AValue : TGorillaInputController ) ; override;
- protected procedure SetCamera ( const AValue : TCamera ) ; override;
- protected procedure SetMovementDragMode ( const AValue : Boolean ) ; virtual;
- protected procedure SetRotateAroundCenter ( const AValue : Boolean ) ; virtual;
- protected function GetJumpingStartPos ( ) : TPoint3D ; override;
- protected function GetJumpingEndPos ( ) : TPoint3D ; override;
- protected function GetCrouchingStartPos ( ) : TPoint3D ; override;
- protected function GetCrouchingEndPos ( ) : TPoint3D ; override;
- protected function GetCrawlingStartPos ( ) : TPoint3D ; override;
- protected function GetCrawlingEndPos ( ) : TPoint3D ; override;
- protected function GetCurrentJumpingTime ( ) : Single ; override;
- protected function GetCurrentCrouchingTime ( ) : Single ; override;
- protected function GetCurrentCrawlingTime ( ) : Single ; override;
- protected procedure DoUpdateJumpAnimation ( ) ; override;
- protected procedure DoUpdateCrouchAnimation ( ) ; override;
- protected procedure DoUpdateCrawlAnimation ( ) ; override;
- protected function GetShowCursor ( ) : Boolean ; virtual;
- protected procedure SetShowCursor ( const AValue : Boolean ) ; virtual;
- protected procedure AddControlPosition ( ACtrl : TControl3D; ADir : TPoint3D ) ;
- protected procedure AddControlRotation ( ACtrl : TControl3D; ADir : TPoint3D ) ;
- protected procedure DoOnMoveForward ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; override;
- protected procedure DoOnMoveBackward ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; override;
- protected procedure DoOnMoveLeft ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; override;
- protected procedure DoOnMoveRight ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; override;
- protected procedure DoOnJump ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; override;
- protected procedure DoOnCrouch ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; override;
- protected procedure DoOnCrawl ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; override;
- protected procedure DoOnBoost ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; override;
- protected procedure DoOnAim ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; override;
- protected procedure DoOnPush ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; override;
- protected procedure DoOnPull ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; override;
- protected procedure DoOnStart ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; override;
- protected procedure DoOnMode ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; override;
- protected procedure DoOnBack ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; override;
- protected procedure DoOnMenuUp ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; override;
- protected procedure DoOnMenuDown ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; override;
- protected procedure DoOnMenuLeft ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; override;
- protected procedure DoOnMenuRight ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; override;
- protected procedure DoOnMouseClick ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; override;
- protected procedure DoOnCustomAction ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; override;
- protected procedure DoOnMouseDown ( ASender : TObject; AStates : TGorillaMouseStates; APos : TPointF ) ; override;
- protected procedure DoOnMouseUp ( ASender : TObject; AStates : TGorillaMouseStates; APos : TPointF ) ; override;
- protected procedure DoHandleRotationByMouseMove ( ASender : TObject; AStates : TGorillaMouseStates; APos : TPointF ) ;
- protected procedure DoHandleMovementByMouseMove ( ASender : TObject; AStates : TGorillaMouseStates; APos : TPointF ) ;
- protected procedure DoOnMouseMove ( ASender : TObject; AStates : TGorillaMouseStates; APos : TPointF ) ; override;
- protected procedure DoOnGamePadButtonDown ( ASender : TObject; AState : NativeInt; AButtons : TGorillaGamePadButtons ) ; override;
- protected procedure DoOnGamePadButtonUp ( ASender : TObject; AState : NativeInt; AButtons : TGorillaGamePadButtons ) ; override;
- protected procedure DoOnGamePadThumbstickPos ( ASender : TObject; AState : NativeInt; const AButtons : TGorillaGamePadButtons; APos : TPointF; AFlags : UInt64 ) ; override;
- protected procedure DoOnJumpingProcess ( ASender : TObject ) ; virtual;
- protected procedure DoOnJumpingFinish ( ASender : TObject ) ; virtual;
- protected procedure DoOnCrouchingProcess ( ASender : TObject ) ; virtual;
- protected procedure DoOnCrouchingFinish ( ASender : TObject ) ; virtual;
- protected procedure DoOnCrawlingProcess ( ASender : TObject ) ; virtual;
- protected procedure DoOnCrawlingFinish ( ASender : TObject ) ; virtual;
- public procedure AfterConstruction ( ) ; override;
- public function GetCurrentSpeed ( ) : Single ; override;
- public procedure AbortJumping ( ) ; override;
Properties
- published Camera : TCamera
- published InputController : TGorillaInputController
- published TriggerPoints : TGorillaTriggerPointManager
- published AudioManagerController : TGorillaAudioManagerController
- published LockXAxis : Boolean
- published LockYAxis : Boolean
- published LockZAxis : Boolean
- published MoveSideways : Boolean
- published CameraYAngleLimit : TPointF
- published CameraXAngleLimit : TPointF
- published Speed : Single
- published CrouchingSpeedReduction : Single
- published CrawlingSpeedReduction : Single
- published RunningSpeedBoost : Single
- published JumpingHeight : Single
- published CrouchingHeight : Single
- published CrawlingHeight : Single
- published JumpingAnimationTime : Single
- published CrouchingAnimationTime : Single
- published CrawlingAnimationTime : Single
- published MouseControllerSpeed : Single
Get or set mouse controller speed. The value reduces movement speed on mouse interaction. Default value is 0.075.
read FMouseControllerSpeed
write FMouseControllerSpeed - published GamePadThumbstickSpeed : Single
Get or set gamepad controller speed, when using thumbsticks to move. The value reduces movement speed on gamepad interaction. Default value is 0.5.
read FGamePadThumbstickSpeed
write FGamePadThumbstickSpeed - published ShowCursor : Boolean
You can show/hide mouse cursor while first person controller is running.
read GetShowCursor
write SetShowCursor - published RotationDragMode : Boolean
Get or set RotationDragMode value, which defines if camera rotation is only been applied, if mouse-down button is active. Set RotationDragModeButton to define the mouse button to be used. Valid states are: LButtonDown, MButtonDown, RButtonDown
read FRotationDragMode
write FRotationDragMode - published RotationDragModeButton : TGorillaMouseState
Get or set mouse button to be used if RotationDragMode is enabled. Valid states are: LButtonDown, MButtonDown, RButtonDown
read FRotationDragModeButton
write FRotationDragModeButton - published MovementDragMode : Boolean
Get or set MovementDragMode value, which defines if camera movement is only been applied, if mouse-down button is active. Set MovementDragModeButton to define the mouse button to be used. Valid states are: LButtonDown, MButtonDown, RButtonDown
read FMovementDragMode
write SetMovementDragMode - published MovementDragModeButton : TGorillaMouseState
Get or set mouse button to be used if MovementDragMode is enabled. Valid states are: LButtonDown, MButtonDown, RButtonDown
read FMovementDragModeButton
write FMovementDragModeButton - published InvertMovementDragModeXAxis : Boolean
Invert the X-Axis direction value if MovementDragMode is enabled.
read FInvertMovementDragModeXAxis
write FInvertMovementDragModeXAxis - published InvertMovementDragModeYAxis : Boolean
Invert the Y-Axis direction value if MovementDragMode is enabled.
read FInvertMovementDragModeYAxis
write FInvertMovementDragModeYAxis - published RotateAroundCenter : Boolean
In case you want to use the first person controller without a free camera rotation, but instead with a rotating first-person controller component, activate this option.
read FRotateAroundCenter
write SetRotateAroundCenter - published UseDefaultBehaviour : Boolean
Activate / Deactivate default behaviour on hotkeys triggered.
read FUseDefaultBehaviour
write FUseDefaultBehaviour - published UseDefaultMovement : Boolean
Activate / Deactivate default movement behaviour. This flag allows to disable default HotKey (W-A-S-D keys) / Gamepad (thumbstick) movement. This has no influence on camera rotation.
read FUseDefaultMovement
write FUseDefaultMovement