QAbstractCameraController Class | Qt 3D 5.13.0

Qt 5.13 | Qt 3D | C++ Classes | QAbstractCameraController

Qt 5.13.0 Reference Documentation

# QAbstractCameraController Class

(Qt3DExtras::QAbstractCameraController)

The QAbstractCameraController class provides basic functionality for camera controllers. More...

Header: | #include <QAbstractCameraController>
qmake: | QT += 3dextras
Since: | Qt 5.10
Inherits: | Qt3DCore::QEntity
Inherited By: | Qt3DExtras::QFirstPersonCameraController and Qt3DExtras::QOrbitCameraController

This class was introduced in Qt 5.10.

- List of all members, including inherited members
- Obsolete members

## Properties

- acceleration : float
- camera : Qt3DRender::QCamera*
- deceleration : float

- linearSpeed : float
- lookSpeed : float

- 3 properties inherited from Qt3DCore::QNode
- 1 property inherited from QObject

## Public Functions

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
- 13 public functions inherited from Qt3DCore::QNode
- 30 public functions inherited from QObject

## Signals

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

- 4 signals inherited from Qt3DCore::QNode
- 2 signals inherited from QObject

## Protected Functions

Qt3DInput::QKeyboardDevice * | keyboardDevice() const
Qt3DInput::QMouseDevice * | mouseDevice() const

- 2 protected functions inherited from Qt3DCore::QNode
- 9 protected functions inherited from QObject

## Related Non-Members

typedef | QComponentVector
typedef | QNodePtr
typedef | QNodeVector
typedef | QObjectList
QList<T> | qFindChildren(const QObject *obj, const QRegExp &regExp)
Qt3DCore::QNodeId | qIdForNode(Qt3DCore::QNode *node)
Qt3DCore::QNodeIdVector | qIdsForNodes(const T &nodes)
T | qobject_cast(QObject *object)
T | qobject_cast(const QObject *object)

## Macros

| QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
| Q_CLASSINFO(Name, Value)
| Q_DISABLE_COPY(Class)
| Q_DISABLE_COPY_MOVE(Class)
| Q_DISABLE_MOVE(Class)
| Q_EMIT
| Q_ENUM(...)
| Q_ENUM_NS(...)
| Q_FLAG(...)
| Q_FLAG_NS(...)
| Q_GADGET
| Q_INTERFACES(...)
| Q_INVOKABLE
| Q_NAMESPACE
| Q_OBJECT
| Q_PROPERTY(...)
| Q_REVISION
| Q_SET_OBJECT_NAME(Object)
| Q_SIGNAL
| Q_SIGNALS
| Q_SLOT
| Q_SLOTS

### Additional Inherited Members

- 3 public slots inherited from Qt3DCore::QNode
- 1 public slot inherited from QObject
- 9 static public members inherited from QObject

## Detailed Description

QAbstractCameraController sets up and handles input from keyboard, mouse, and other devices. QAbstractCameraController is an abstract class and cannot itself be instantiated. It provides a standard interface for camera controllers.

Derived classes need only implement the frameActionTriggered() method to move the camera.

## 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.

The default is `10.0`.

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.

The default is `180.0`.

Access functions:

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

Notifier signal:

void | lookSpeedChanged()

## Member Function Documentation

### `[protected]` Qt3DInput::QKeyboardDevice *QAbstractCameraController::keyboardDevice() const

Provides access to the keyboard device.

### `[protected]` Qt3DInput::QMouseDevice *QAbstractCameraController::mouseDevice() const

Provides access to the mouse device.