Gorilla.Controller.Input.FirstPerson Unit Reference

Overview

The Gorilla.Controller.Input.FirstPerson unit provides TGorillaFirstPersonController, a concrete implementation of the character controller for ego-perspective (first-person) 3D navigation. It handles mouse look, keyboard movement (WASD), gamepad input, jump/crouch/crawl animations, and drag-mode interactions.

Classes

TGorillaFirstPersonController

First-person camera and character controller with mouse look, keyboard movement, and gamepad support.

Inheritance: TDummy → TGorillaCharacterController → TGorillaFirstPersonController

Platforms: All Gorilla3D supported platforms

Inherited Published Properties

All properties from TGorillaCharacterController are published (Camera, InputController, TriggerPoints, AudioManagerController, Speed, LockXAxis/Y/Z, MoveSideways, CameraXAngleLimit, CameraYAngleLimit, CrouchingSpeedReduction, CrawlingSpeedReduction, RunningSpeedBoost, JumpingHeight, CrouchingHeight, CrawlingHeight, JumpingAnimationTime, CrouchingAnimationTime, CrawlingAnimationTime, and all events).

Published Properties

Property Type Default Description
MouseControllerSpeed Single 0.075 Mouse look sensitivity. Lower values = slower rotation.
GamePadThumbstickSpeed Single 0.5 Gamepad right thumbstick sensitivity for rotation.
ShowCursor Boolean True Show or hide the mouse cursor during controller operation.
RotationDragMode Boolean False If true, camera rotation only applies while a mouse button is held.
RotationDragModeButton TGorillaMouseState — Which mouse button activates rotation drag mode (LButtonDown, MButtonDown, RButtonDown).
UseCameraDirection Boolean True If true, movement direction follows the camera; if false, follows the controller orientation.
MovementDragMode Boolean False If true, movement by mouse only applies while a mouse button is held.
MovementDragModeButton TGorillaMouseState — Which mouse button activates movement drag mode.
InvertMovementDragModeXAxis Boolean False Invert horizontal axis when in movement drag mode.
InvertMovementDragModeYAxis Boolean False Invert vertical axis when in movement drag mode.
RotateAroundCenter Boolean False Rotate the controller component itself instead of free camera rotation.
UseDefaultBehaviour Boolean True Enable or disable built-in hotkey behavior.
UseDefaultMovement Boolean True Enable or disable built-in WASD/gamepad movement. Camera rotation is unaffected.

Public Methods

constructor Create(AOwner: TComponent); override;
destructor Destroy(); override;
procedure AfterConstruction(); override;
function GetCurrentSpeed(): Single; override;

Returns the current effective speed accounting for crouch, crawl, and boost modifiers.

procedure AbortJumping(); override;

Cancels the current jump animation immediately.