QCameraLens Class | Qt 3D 5.6

Qt 5.6 | Qt 3D | C++ Classes | QCameraLens

Qt 5.6.2 Reference Documentation

# QCameraLens Class

(Qt3DCore::QCameraLens)

Qt3DCore::QCameraLens specifies the projection matrix that will be used to define a Camera for a 3D scene. More...

Header: | #include <QCameraLens>
qmake: | QT += 3dcore
Since: | Qt 5.5
Instantiated By: | CameraLens
Inherits: | QComponent

- List of all members, including inherited members

## Public Types

enum | ProjectionType { OrthographicProjection, PerspectiveProjection, FrustumProjection }

## Properties

aspectRatio : float bottom : float farPlane : float fieldOfView : float left : float | nearPlane : float projectionMatrix : const QMatrix4x4 projectionType : ProjectionType right : float top : float

- 1 property inherited from Qt3DCore::QComponent
- 2 properties inherited from Qt3DCore::QNode
- 1 property inherited from QObject

## Public Functions

| QCameraLens(QNode *parent = Q_NULLPTR)
| ~QCameraLens()
float | aspectRatio() const
float | bottom() const
float | farPlane() const
float | fieldOfView() const
float | left() const
float | nearPlane() const
QMatrix4x4 | projectionMatrix() const
ProjectionType | projectionType() const
float | right() const
void | setFrustumProjection(float left, float right, float bottom, float top, float nearPlane, float farPlane)
void | setOrthographicProjection(float left, float right, float bottom, float top, float nearPlane, float farPlane)
void | setPerspectiveProjection(float fieldOfView, float aspectRatio, float nearPlane, float farPlane)
float | top() const

- 2 public functions inherited from Qt3DCore::QComponent
- 6 public functions inherited from Qt3DCore::QNode
- 31 public functions inherited from QObject

## Public Slots

void | setAspectRatio(float aspectRatio)
void | setBottom(float bottom)
void | setFarPlane(float farPlane)
void | setFieldOfView(float fieldOfView)
void | setLeft(float left)
void | setNearPlane(float nearPlane)
void | setProjectionType(ProjectionType projectionType)
void | setRight(float right)
void | setTop(float top)

- 1 public slot inherited from Qt3DCore::QComponent
- 2 public slots inherited from Qt3DCore::QNode
- 1 public slot inherited from QObject

## Signals

void | aspectRatioChanged(float aspectRatio)
void | bottomChanged(float bottom)
void | farPlaneChanged(float farPlane)
void | fieldOfViewChanged(float fieldOfView)
void | leftChanged(float left)
void | nearPlaneChanged(float nearPlane)
void | projectionMatrixChanged(const QMatrix4x4 &projectionMatrix)
void | projectionTypeChanged(QCameraLens::ProjectionType projectionType)
void | rightChanged(float right)
void | topChanged(float top)

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

## Protected Functions

| QCameraLens(QCameraLensPrivate &dd, QNode *parent = Q_NULLPTR)

## Reimplemented Protected Functions

virtual void | copy(const QNode *ref)

- 1 protected function inherited from Qt3DCore::QComponent
- 3 protected functions inherited from Qt3DCore::QNode
- 9 protected functions inherited from QObject

### Additional Inherited Members

- 1 public variable inherited from QObject
- 10 static public members inherited from QObject
- 2 protected variables inherited from QObject
- 1 static protected member inherited from Qt3DCore::QNode

## Detailed Description

Qt3DCore::QCameraLens specifies the projection matrix that will be used to define a Camera for a 3D scene.

## Member Type Documentation

### enum QCameraLens::ProjectionType

## Property Documentation

### aspectRatio : float

Access functions:

float | aspectRatio() const
void | setAspectRatio(float aspectRatio)

Notifier signal:

void | aspectRatioChanged(float aspectRatio)

### bottom : float

Access functions:

float | bottom() const
void | setBottom(float bottom)

Notifier signal:

void | bottomChanged(float bottom)

### farPlane : float

Access functions:

float | farPlane() const
void | setFarPlane(float farPlane)

Notifier signal:

void | farPlaneChanged(float farPlane)

### fieldOfView : float

Access functions:

float | fieldOfView() const
void | setFieldOfView(float fieldOfView)

Notifier signal:

void | fieldOfViewChanged(float fieldOfView)

### left : float

Access functions:

float | left() const
void | setLeft(float left)

Notifier signal:

void | leftChanged(float left)

### nearPlane : float

Access functions:

float | nearPlane() const
void | setNearPlane(float nearPlane)

Notifier signal:

void | nearPlaneChanged(float nearPlane)

### projectionMatrix : const QMatrix4x4

Access functions:

QMatrix4x4 | projectionMatrix() const

Notifier signal:

void | projectionMatrixChanged(const QMatrix4x4 &projectionMatrix)

### projectionType : ProjectionType

Access functions:

ProjectionType | projectionType() const
void | setProjectionType(ProjectionType projectionType)

Notifier signal:

void | projectionTypeChanged(QCameraLens::ProjectionType projectionType)

### right : float

Access functions:

float | right() const
void | setRight(float right)

Notifier signal:

void | rightChanged(float right)

### top : float

Access functions:

float | top() const
void | setTop(float top)

Notifier signal:

void | topChanged(float top)

## Member Function Documentation

### QCameraLens::QCameraLens(QNode *parent = Q_NULLPTR)

Default constructs an instance of QCameraLens.

### `[protected]` QCameraLens::QCameraLens(QCameraLensPrivate &dd, QNode *parent = Q_NULLPTR)

Copy constructor.

### QCameraLens::~QCameraLens()

Destroys the instance of QCameraLens.

### float QCameraLens::aspectRatio() const

Returns the projection's aspect ratio.

Note: : The return value may be undefined if the projection type is not Qt3DCore::QCameraLens::PerspectiveProjection.

Note: Getter function for property aspectRatio.

See also setAspectRatio().

### float QCameraLens::bottom() const

Returns the bottom window coordinate of the projection.

Note: The return value may be undefined if the projection type is Qt3DCore::QCameraLens::PerspectiveProjection.

Note: Getter function for property bottom.

See also setBottom().

### `[virtual protected]` void QCameraLens::copy(const QNode *ref)

### float QCameraLens::farPlane() const

Returns the projection's far plane.

Note: Getter function for property farPlane.

See also setFarPlane().

### float QCameraLens::fieldOfView() const

Returns the projection's field of view in degrees.

Note: : The return value may be undefined if the projection type is not Qt3DCore::QCameraLens::PerspectiveProjection.

Note: Getter function for property fieldOfView.

See also setFieldOfView().

### float QCameraLens::left() const

Returns the lower left window coordinate of the projection.

Note: The return value may be undefined if the projection type is Qt3DCore::QCameraLens::PerspectiveProjection.

Note: Getter function for property left.

See also setLeft().

### float QCameraLens::nearPlane() const

Returns the projection's near plane.

Note: Getter function for property nearPlane.

See also setNearPlane().

### QMatrix4x4 QCameraLens::projectionMatrix() const

Returns the projection matrix.

Note: Getter function for property projectionMatrix.

### ProjectionType QCameraLens::projectionType() const

Returns the lens' projection type.

Note: Getter function for property projectionType.

See also setProjectionType().

### float QCameraLens::right() const

Returns the upper right window coordinate of the projection.

Note: The return value may be undefined if the projection type is Qt3DCore::QCameraLens::PerspectiveProjection.

Note: Getter function for property right.

See also setRight().

### `[slot]` void QCameraLens::setAspectRatio(float aspectRatio)

Sets the projection's aspect ratio to aspectRatio. This triggers a projection matrix update.

Note: this has no effect if the projection type is not Qt3DCore::QCameraLens::PerspectiveProjection.

Note: Setter function for property aspectRatio.

See also aspectRatio().

### `[slot]` void QCameraLens::setBottom(float bottom)

Sets the projection's bottom window coordinate to bottom. This triggers a projection matrix update.

Note: this has no effect if the projection type is Qt3DCore::QCameraLens::PerspectiveProjection.

Note: Setter function for property bottom.

See also bottom().

### `[slot]` void QCameraLens::setFarPlane(float farPlane)

Sets the projection's far plane to farPlane. This triggers a projection matrix update.

Note: Setter function for property farPlane.

See also farPlane().

### `[slot]` void QCameraLens::setFieldOfView(float fieldOfView)

Sets the projection's field of view to fieldOfView degrees. This triggers a projection matrix update.

Note: this has no effect if the projection type is not Qt3DCore::QCameraLens::PerspectiveProjection.

Note: Setter function for property fieldOfView.

See also fieldOfView().

### void QCameraLens::setFrustumProjection(float left, float right, float bottom, float top, float nearPlane, float farPlane)

Defines an orthographic projection based on left, right, bottom, top, nearPlane, farPlane.

### `[slot]` void QCameraLens::setLeft(float left)

Sets the projection's lower left window coordinate to left. This triggers a projection matrix update.

Note: this has no effect if the projection type is Qt3DCore::QCameraLens::PerspectiveProjection.

Note: Setter function for property left.

See also left().

### `[slot]` void QCameraLens::setNearPlane(float nearPlane)

Sets the projection's near plane to nearPlane. This triggers a projection matrix update.

Note: Setter function for property nearPlane.

See also nearPlane().

### void QCameraLens::setOrthographicProjection(float left, float right, float bottom, float top, float nearPlane, float farPlane)

Defines an orthographic projection based on left, right, bottom, top, nearPlane, farPlane.

### void QCameraLens::setPerspectiveProjection(float fieldOfView, float aspectRatio, float nearPlane, float farPlane)

Defines a perspective projection based on fieldOfView, aspectRatio, nearPlane, farPlane.

### `[slot]` void QCameraLens::setProjectionType(ProjectionType projectionType)

Sets the lens' projection type projectionType.

Note: Qt3DCore::QCameraLens::Frustum and Qt3DCore::QCameraLens::PerspectiveProjection are two different ways of specifying the same projection.

Note: Setter function for property projectionType.

See also projectionType().

### `[slot]` void QCameraLens::setRight(float right)

Sets the projection's upper right window coordinate to right. This triggers a projection matrix update.

Note: this has no effect if the projection type is Qt3DCore::QCameraLens::PerspectiveProjection.

Note: Setter function for property right.

See also right().

### `[slot]` void QCameraLens::setTop(float top)

Sets the projection's top window coordinate to top. This triggers a projection matrix update.

Note: this has no effect if the projection type is Qt3DCore::QCameraLens::PerspectiveProjection.

Note: Setter function for property top.

See also top().

### float QCameraLens::top() const

Returns the bottom window coordinate of the projection.

Note: The return value may be undefined if the projection type is Qt3DCore::QCameraLens::PerspectiveProjection.

Note: Getter function for property top.

See also setTop().