Gorilla.Controller.Input.Character
Unit Gorilla.Controller.Input.Character.pasClasses
- TGorillaCharacterController = class ( TDummy )
Records
Constants
- const GORILLA_CHARACTERCONTROLLER_HOTKEYS : :2 = ;
TGorillaCharacterController
General character controller class used as basis for FirstPerson and ThirdPersonControllers.
Ancestors
Members
Fields
- protected FEnabled :
Boolean
- protected FCamera :
TCamera
- protected FInputController :
TGorillaInputController
- protected FHotKeys :
- protected FTriggerPoints :
TGorillaTriggerPointManager
- protected FAudioManagerController :
TGorillaAudioManagerController
- protected FStates :
TGorillaCharacterControllerStates
- protected FLastPos :
TPointF
- protected FLastMovePos :
TPointF
- protected FRotationDelta :
TPointF
- protected FLockXAxis :
Boolean
- protected FLockYAxis :
Boolean
- protected FLockZAxis :
Boolean
- protected FCameraYAngleLimit :
TPointF
- protected FCameraXAngleLimit :
TPointF
- protected FMoveSideways :
Boolean
- protected FRotateOnSideways :
Boolean
- protected FSpeed :
Single
- protected FSidewayRotationSpeed :
Single
- protected FCrouchingSpeedReduction :
Single
- protected FCrawlingSpeedReduction :
Single
- protected FRunningSpeedBoost :
Single
- protected FJumpingHeight :
Single
- protected FCrouchingHeight :
Single
- protected FCrawlingHeight :
Single
- protected FJumpingAnimationTime :
Single
- protected FCrouchingAnimationTime :
Single
- protected FCrawlingAnimationTime :
Single
- protected FAdjustJumpingPosition :
Boolean
- protected FAdjustCrouchingPosition :
Boolean
- protected FAdjustCrawlingPosition :
Boolean
- protected FOnIdle :
TOnCharacterControllerEvent
- protected FOnMove :
TOnCharacterControllerMoveEvent
- protected FOnRotate :
TOnCharacterControllerRotateEvent
- protected FOnBoost :
TOnCharacterControllerEvent
- protected FOnCrouch :
TOnCharacterControllerEvent
- protected FOnCrawl :
TOnCharacterControllerEvent
- protected FOnJump :
TOnCharacterControllerEvent
- protected FOnAim :
TOnCharacterControllerEvent
- protected FOnPush :
TOnCharacterControllerEvent
- protected FOnPull :
TOnCharacterControllerEvent
- protected FOnCustomAction :
TOnCharacterControllerHotKeyTriggered
- protected FOnClick :
TOnCharacterControllerHotKeyTriggered
- protected FOnStart :
TOnCharacterControllerEvent
- protected FOnMode :
TOnCharacterControllerEvent
- protected FOnBack :
TOnCharacterControllerEvent
- protected FOnNavigate :
TOnCharacterControllerHotKeyTriggered
- protected FOnChangeSize :
TNotifyEvent
- protected FOnHotKey :
TOnCharacterControllerHotKeyTriggered
- protected FOnTriggerPoint :
TOnCharacterControllerTriggerPoint
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected function GetEnabled ( ) : Boolean ; virtual;
- protected procedure SetEnabled ( const AValue : Boolean ) ; virtual;
- protected function GetCamera ( ) : TCamera ; virtual;
- protected procedure SetCamera ( const AValue : TCamera ) ; virtual;
- protected procedure SetCameraYAngleLimit ( const AValue : TPointF ) ;
- protected procedure SetCameraXAngleLimit ( const AValue : TPointF ) ;
- protected procedure SetCrouchingSpeedReduction ( const AValue : Single ) ; virtual;
- protected procedure SetCrawlingSpeedReduction ( const AValue : Single ) ; virtual;
- protected procedure SetRunningSpeedBoost ( const AValue : Single ) ; virtual;
- protected function GetCharacterHeight ( ) : Single ; virtual;
- protected procedure SetCharacterHeight ( const AValue : Single ) ; virtual;
- protected function GetJumpingStartPos ( ) : TPoint3D ; abstract virtual;
- protected function GetCrouchingStartPos ( ) : TPoint3D ; abstract virtual;
- protected function GetCrawlingStartPos ( ) : TPoint3D ; abstract virtual;
- protected function GetJumpingEndPos ( ) : TPoint3D ; abstract virtual;
- protected function GetCrouchingEndPos ( ) : TPoint3D ; abstract virtual;
- protected function GetCrawlingEndPos ( ) : TPoint3D ; abstract virtual;
- protected function GetCurrentJumpingTime ( ) : Single ; abstract virtual;
- protected function GetCurrentCrouchingTime ( ) : Single ; abstract virtual;
- protected function GetCurrentCrawlingTime ( ) : Single ; abstract virtual;
- protected procedure SetJumpingHeight ( const AValue : Single ) ; virtual;
- protected procedure SetCrouchingHeight ( const AValue : Single ) ; virtual;
- protected procedure SetCrawlingHeight ( const AValue : Single ) ; virtual;
- protected procedure SetJumpingAnimationTime ( const AValue : Single ) ; virtual;
- protected procedure SetCrouchingAnimationTime ( const AValue : Single ) ; virtual;
- protected procedure SetCrawlingAnimationTime ( const AValue : Single ) ; virtual;
- protected function GetInputController ( ) : TGorillaInputController ; virtual;
- protected procedure SetInputController ( const AValue : TGorillaInputController ) ; virtual;
- protected function GetTriggerPoints ( ) : TGorillaTriggerPointManager ; virtual;
- protected procedure SetTriggerPoints ( const AValue : TGorillaTriggerPointManager ) ; virtual;
- protected function GetAudioManagerController ( ) : TGorillaAudioManagerController ; virtual;
- protected procedure SetAudioManagerController ( const AValue : TGorillaAudioManagerController ) ; virtual;
- protected procedure SetStates ( const AValue : TGorillaCharacterControllerStates ) ; virtual;
- protected function GetHotKey ( AIndex : TGorillaCharacterControllerHotKey ) : TGorillaHotKeyItem ; virtual;
- protected procedure DoClearHotKeys ( ) ; virtual;
- protected procedure DoSetSensitivitiy ( ) ; virtual;
- protected procedure DoSetupDefaultHotKeys ( ) ; virtual;
- protected procedure DoSetupMouseInteraction ( ) ; virtual;
- protected procedure DoSetupGamePadInteraction ( ) ; virtual;
- protected procedure DoSetRotation ( ARotationDelta : TPointF ) ; virtual;
- protected function ComputeRotationDelta ( ADiffPos : TPointF; ASpeed : Single ) : TPointF ; virtual;
- protected procedure DoTriggerPointCheck ( ) ; virtual;
- protected procedure DoAudioManagerCheck ( AHotKey : TGorillaCharacterControllerHotKey; AStates : TGorillaCharacterControllerStates ) ; virtual;
- protected procedure DoUpdateJumpAnimation ( ) ; abstract virtual;
- protected procedure DoUpdateCrouchAnimation ( ) ; abstract virtual;
- protected procedure DoUpdateCrawlAnimation ( ) ; abstract virtual;
- protected procedure DoOnMoveForward ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; abstract virtual;
- protected procedure DoOnMoveBackward ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; abstract virtual;
- protected procedure DoOnMoveLeft ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; abstract virtual;
- protected procedure DoOnMoveRight ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; abstract virtual;
- protected procedure DoOnJump ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; abstract virtual;
- protected procedure DoOnCrouch ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; abstract virtual;
- protected procedure DoOnCrawl ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; abstract virtual;
- protected procedure DoOnBoost ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; abstract virtual;
- protected procedure DoOnAim ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; abstract virtual;
- protected procedure DoOnPush ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; abstract virtual;
- protected procedure DoOnPull ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; abstract virtual;
- protected procedure DoOnStart ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; abstract virtual;
- protected procedure DoOnMode ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; abstract virtual;
- protected procedure DoOnBack ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; abstract virtual;
- protected procedure DoOnMenuUp ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; abstract virtual;
- protected procedure DoOnMenuDown ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; abstract virtual;
- protected procedure DoOnMenuLeft ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; abstract virtual;
- protected procedure DoOnMenuRight ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; abstract virtual;
- protected procedure DoOnMouseClick ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; abstract virtual;
- protected procedure DoOnCustomAction ( const AItem : TGorillaHotKeyItem; const ACurrentInput : TGorillaHotKeyRaw; const AMode : TGorillaInputMode ) ; abstract virtual;
- protected procedure DoOnMouseDown ( ASender : TObject; AStates : TGorillaMouseStates; APos : TPointF ) ; abstract virtual;
- protected procedure DoOnMouseUp ( ASender : TObject; AStates : TGorillaMouseStates; APos : TPointF ) ; abstract virtual;
- protected procedure DoOnMouseMove ( ASender : TObject; AStates : TGorillaMouseStates; APos : TPointF ) ; abstract virtual;
- protected procedure DoOnGamePadButtonDown ( ASender : TObject; AState : NativeInt; AButtons : TGorillaGamePadButtons ) ; abstract virtual;
- protected procedure DoOnGamePadButtonUp ( ASender : TObject; AState : NativeInt; AButtons : TGorillaGamePadButtons ) ; abstract virtual;
- protected procedure DoOnGamePadThumbstickPos ( ASender : TObject; AState : NativeInt; const AButtons : TGorillaGamePadButtons; APos : TPointF; AFlags : UInt64 ) ; abstract virtual;
- protected procedure Notification ( AComponent : TComponent; Operation : TOperation ) ; override;
- public procedure AfterConstruction ( ) ; override;
- public function GetCurrentSpeed ( ) : Single ; abstract virtual;
- public function GetHotKeyType
(
AItem :
TGorillaHotKeyItem
)
: TGorillaCharacterControllerHotKey
;
virtual;
Get the corresponding hotkey enumeration value for a specific hotkey item.
- public function GetStatesString
(
AStates :
TGorillaCharacterControllerStates
)
: string
;
class;
Returns a string build from states-value, like "[fpIdle,fpCrouching]"
- public function GetStatesValue
(
AValue :
string
)
: TGorillaCharacterControllerStates
;
class;
Returns a states-value from given string in form of, like "[fpIdle,fpCrouching]".
- public procedure AddState
(
AState :
TGorillaCharacterControllerState
)
;
virtual;
Adds a state to states-value and fixes colliding states like (idle/moving) or (crouch/boost).
- public procedure RemoveState
(
AState :
TGorillaCharacterControllerState
)
;
virtual;
Removes a state from states-value and fixes colliding states like (idle/moving) or (crouch/boost).
- public procedure Push
(
AEnabled :
Boolean
)
;
virtual;
Manually activates the pushing state.
- public procedure Pull
(
AEnabled :
Boolean
)
;
virtual;
Manually activates the pulling state.
- public procedure AbortJumping ( ) ; abstract virtual;
Properties
- public States : TGorillaCharacterControllerStates
- public HotKey[Index] : TGorillaHotKeyItem
- public CharacterHeight : Single
Get or set character height value. The value defines the size of the character on y-axis.
read GetCharacterHeight
write SetCharacterHeight - public JumpingStartPos : TPoint3D
On jumping animation start this value is going to be set as starting value to return to aftwards.
read GetJumpingStartPos - public CrouchingStartPos : TPoint3D
On crouching animation start this value is going to be set as starting value to return to aftwards.
read GetCrouchingStartPos - public CrawlingStartPos : TPoint3D
On crawling animation start this value is going to be set as starting value to return to aftwards.
read GetCrawlingStartPos - public JumpingEndPos : TPoint3D
On jumping animation start this value is going to be set as destination value to move to.
read GetJumpingEndPos - public CrouchingEndPos : TPoint3D
On crouching animation start this value is going to be set as destination value to move to.
read GetCrouchingEndPos - public CrawlingEndPos : TPoint3D
On crawling animation start this value is going to be set as destination value to move to.
read GetCrawlingEndPos - public CurrentJumpingTime : Single
- public CurrentCrouchingTime : Single
- public CurrentCrawlingTime : Single
- public AdjustJumpingPosition : Boolean
- public AdjustCrouchingPosition : Boolean
- public AdjustCrawlingPosition : Boolean
- published Camera : TCamera
- published InputController : TGorillaInputController
Get or set input controller to retrieve input information for keyboard and mouse interaction.
read GetInputController
write SetInputController - published TriggerPoints : TGorillaTriggerPointManager
Link an existing TriggerPointManager with the first person controller to react on triggered points in 3D Space.
read GetTriggerPoints
write SetTriggerPoints - published AudioManagerController : TGorillaAudioManagerController
Link to an audio manager controller, to automatically playback sounds. In the audio manager controller you can map between hotkeys and sounds.
read GetAudioManagerController
write SetAudioManagerController - published LockXAxis : Boolean
Lock or unlock X-axis for movement. Enable this property if you don't want the character to force movement on x direction.
read FLockXAxis
write FLockXAxis - published LockYAxis : Boolean
Lock or unlock Y-axis for movement. Enable this property if you don't want the character to force movement on y direction.
read FLockYAxis
write FLockYAxis - published LockZAxis : Boolean
Lock or unlock Z-axis for movement. Enable this property if you don't want the character to force movement on Z direction.
read FLockZAxis
write FLockZAxis - published MoveSideways : Boolean
Activate or deactivate moving character sideways on move-left/right hotkeys. If this mode is deactivated, the character will rotate on move-left/right hotkey instead.
read FMoveSideways
write FMoveSideways - published RotateOnSideways : Boolean
Activate or deactivate rotating character constroller on sideway keys.
read FRotateOnSideways
write FRotateOnSideways - published CameraYAngleLimit : TPointF
Define the min/max limit of camera rotation on Y-axis. While the X-value defines the lower barrier and the Y-value defines the upper barrier. The Y-axis means left-right rotation. The value is given in degree. Default value is: (X=-180, Y=180).
read FCameraYAngleLimit
write SetCameraYAngleLimit - published CameraXAngleLimit : TPointF
Define the min/max limit of camera rotation on X-axis. While the X-value defines the lower barrier and the Y-value defines the upper barrier. The X-axis means up-down rotation. The value is given in degree. Default value is: (X=-45, Y=45).
read FCameraXAngleLimit
write SetCameraXAngleLimit - published Speed : Single
- published SidewayRotationSpeed : Single
Get or set speed of sideway rotation. A basis speed value applied to direction vector. Default value is 1. This value will only be recognized, if RotateOnSideways is enabled.
read FSidewayRotationSpeed
write FSidewayRotationSpeed - published CrouchingSpeedReduction : Single
Factor of reduction on speed if state is fpCrouching. Values between 0.0 - 1.0 are allowed. Default value is 0.75.
read FCrouchingSpeedReduction
write SetCrouchingSpeedReduction - published CrawlingSpeedReduction : Single
Factor of reduction on speed if state is fpCrawling. Values between 0.0 - 1.0 are allowed. Default value is 0.9.
read FCrawlingSpeedReduction
write SetCrawlingSpeedReduction - published RunningSpeedBoost : Single
Boost factor on speed if state is fpBoost. Values between 1-1000 are allowed. Default value is 2.0.
read FRunningSpeedBoost
write SetRunningSpeedBoost - published JumpingHeight : Single
Get or set jumping height value. The value defines the height of jumping. Default value is 2;
read FJumpingHeight
write SetJumpingHeight - published CrouchingHeight : Single
Get or set crouching height value. The value defines how deep the character getting down. Default value is 0.5.
read FCrouchingHeight
write SetCrouchingHeight - published CrawlingHeight : Single
Get or set crawling height value. The value defines how deep the character getting down if crawling. Default value is 0.25.
read FCrawlingHeight
write SetCrawlingHeight - published JumpingAnimationTime : Single
Get or set animation length in seconds used for jumping.
read FJumpingAnimationTime
write SetJumpingAnimationTime - published CrouchingAnimationTime : Single
Get or set animation length for changing into crouching.
read FCrouchingAnimationTime
write SetCrouchingAnimationTime - published CrawlingAnimationTime : Single
Get or set animation length for changing into crawling.
read FCrawlingAnimationTime
write SetCrawlingAnimationTime