QFirstPersonCameraController Class | Qt 3D 5.9

Qt 5.9 | Qt 3D | C++ Classes | QFirstPersonCameraController

Qt 5.9.9 Reference Documentation

# QFirstPersonCameraController Class

(Qt3DExtras::QFirstPersonCameraController)

The QFirstPersonCameraController class allows controlling the scene camera from the first person perspective. More...

Header: | #include <QFirstPersonCameraController>
qmake: | QT += 3dextras
Since: | Qt 5.7
Inherits: | Qt3DCore::QEntity

- List of all members, including inherited members

## Properties

acceleration : float camera : Qt3DRender::QCamera * deceleration : float | linearSpeed : float lookSpeed : float

- 3 properties inherited from Qt3DCore::QNode

## Public Functions

| QFirstPersonCameraController(Qt3DCore::QNode *parent = nullptr)
| ~QFirstPersonCameraController()
float | acceleration() const
Qt3DRender::QCamera * | camera() const
float | deceleration() const
float | linearSpeed() const
float | lookSpeed() const
void | setAcceleration(float acceleration)
void | setCamera(Qt3DRender::QCamera *camera)
void | setDeceleration(float deceleration)
void | setLinearSpeed(float linearSpeed)
void | setLookSpeed(float lookSpeed)

- 4 public functions inherited from Qt3DCore::QEntity
- 11 public functions inherited from Qt3DCore::QNode

## Signals

void | accelerationChanged(float acceleration)
void | cameraChanged()
void | decelerationChanged(float deceleration)
void | linearSpeedChanged()
void | lookSpeedChanged()

- 4 signals inherited from Qt3DCore::QNode

### Additional Inherited Members

- 3 public slots inherited from Qt3DCore::QNode
- 2 protected functions inherited from Qt3DCore::QNode

## Detailed Description

The QFirstPersonCameraController class allows controlling the scene camera from the first person perspective.

The controls are:

Input | Action
--- | ---
Left mouse button | While the left mouse button is pressed, mouse movement along x-axis pans the camera and movement along y-axis tilts it.
Mouse scroll wheel | Zooms the camera in and out without changing the view center.
Shift key | Turns the fine motion control active while pressed. Makes mouse pan and tilt less sensitive.
Arrow keys | Move the camera horizontally relative to camera viewport.
Page up and page down keys | Move the camera vertically relative to camera viewport.

## Property Documentation

### acceleration : float

Holds the current acceleration of the camera controller.

Access functions:

float | acceleration() const
void | setAcceleration(float acceleration)

Notifier signal:

void | accelerationChanged(float acceleration)

### camera : Qt3DRender::QCamera *

Holds the currently controlled camera.

Access functions:

Qt3DRender::QCamera * | camera() const
void | setCamera(Qt3DRender::QCamera *camera)

Notifier signal:

void | cameraChanged()

### deceleration : float

Holds the current deceleration of the camera controller.

Access functions:

float | deceleration() const
void | setDeceleration(float deceleration)

Notifier signal:

void | decelerationChanged(float deceleration)

### linearSpeed : float

Holds the current linear speed of the camera controller. Linear speed determines the movement speed of the camera.

Access functions:

float | linearSpeed() const
void | setLinearSpeed(float linearSpeed)

Notifier signal:

void | linearSpeedChanged()

### lookSpeed : float

Holds the current look speed of the camera controller. The look speed determines the turn rate of the camera pan and tilt.

Access functions:

float | lookSpeed() const
void | setLookSpeed(float lookSpeed)

Notifier signal:

void | lookSpeedChanged()

## Member Function Documentation

### QFirstPersonCameraController::QFirstPersonCameraController(Qt3DCore::QNode *parent = nullptr)

Default constructs an instance of QFirstPersonCameraController.

### QFirstPersonCameraController::~QFirstPersonCameraController()

Destroys the instance of QFirstPersonCameraController.