Class TCastleMouseLookNavigation

Unit

Declaration

type TCastleMouseLookNavigation = class(TCastleNavigation)

Description

Abstract navigation class that can utilize mouse look, during which mouse cursor is hidden and we look at MouseLookDelta every frame.

Hierarchy

Overview

Fields

Public nested const DefaultMouseLookHorizontalSensitivity = Pi * 0.1 / 180;
Public nested const DefaultMouseLookVerticalSensitivity = Pi * 0.1 / 180;

Methods

Protected function UsingMouseLook: Boolean;
Protected procedure ProcessMouseLookDelta(const Delta: TVector2); virtual;
Public constructor Create(AOwner: TComponent); override;
Public procedure Update(const SecondsPassed: Single; var HandleInput: boolean); override;
Public function Motion(const Event: TInputMotion): boolean; override;

Properties

Public property MouseLook: boolean read FMouseLook write SetMouseLook default false;
Public property MouseLookHorizontalSensitivity: Single read FMouseLookHorizontalSensitivity write FMouseLookHorizontalSensitivity default DefaultMouseLookHorizontalSensitivity;
Public property MouseLookVerticalSensitivity: Single read FMouseLookVerticalSensitivity write FMouseLookVerticalSensitivity default DefaultMouseLookVerticalSensitivity;
Public property InvertVerticalMouseLook: boolean read FInvertVerticalMouseLook write FInvertVerticalMouseLook default false;

Description

Fields

Public nested const DefaultMouseLookHorizontalSensitivity = Pi * 0.1 / 180;
 
Public nested const DefaultMouseLookVerticalSensitivity = Pi * 0.1 / 180;
 

Methods

Protected function UsingMouseLook: Boolean;
 
Protected procedure ProcessMouseLookDelta(const Delta: TVector2); virtual;
 
Public constructor Create(AOwner: TComponent); override;
 
Public procedure Update(const SecondsPassed: Single; var HandleInput: boolean); override;
 
Public function Motion(const Event: TInputMotion): boolean; override;
 

Properties

Public property MouseLook: boolean read FMouseLook write SetMouseLook default false;

Use mouse look to navigate (rotate the camera).

This also makes mouse cursor of Container hidden, and forces mouse position to the middle of the window (to avoid the situation when mouse movement is blocked by screen borders).

Setting this property at design-time (in CGE editor) does not activate the mouse look in CGE editor. It only controls the mouse look once the application is running.

Public property MouseLookHorizontalSensitivity: Single read FMouseLookHorizontalSensitivity write FMouseLookHorizontalSensitivity default DefaultMouseLookHorizontalSensitivity;

Mouse look sensitivity, if MouseLook is working. These properties specify how much angle change is produced by moving mouse by 1 pixel.

Public property MouseLookVerticalSensitivity: Single read FMouseLookVerticalSensitivity write FMouseLookVerticalSensitivity default DefaultMouseLookVerticalSensitivity;
 
Public property InvertVerticalMouseLook: boolean read FInvertVerticalMouseLook write FInvertVerticalMouseLook default false;

If this is True and MouseLook works, then the meaning of vertical mouse movement is inverted: when user moves mouse up, he looks down. Some players are more comfortable with such configuration.


Generated by PasDoc 0.16.0.