Qt3DRender::QCamera Class
class Qt3DRender::QCameraQCamera クラスは、シーンがレンダリングされる視点定義します。詳細...
| ヘッダー: | #include <Qt3DRender/QCamera> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS 3drender) target_link_libraries(mytarget PRIVATE Qt6::3drender) |
| qmake: | QT += 3drender |
| QML内: | Camera |
| 継承元: | Qt3DCore::QEntity |
| ステータス: | 非推奨 |
このクラスは非推奨です。新しいコードでの使用は強く推奨されません。
パブリック型
| enum | CameraTranslationOption { TranslateViewCenter, DontTranslateViewCenter } |
プロパティ
|
|
パブリック関数
| QCamera(Qt3DCore::QNode *parent = nullptr) | |
| float | aspectRatio() const |
| float | bottom() const |
| float | exposure() const |
| float | farPlane() const |
| float | fieldOfView() const |
| float | left() const |
| Qt3DRender::QCameraLens * | lens() const |
| float | nearPlane() const |
| void | pan(float angle) |
| void | pan(float angle, const QVector3D &axis) |
| void | panAboutViewCenter(float angle) |
| void | panAboutViewCenter(float angle, const QVector3D &axis) |
| QQuaternion | panRotation(float angle) const |
| QVector3D | position() const |
| QMatrix4x4 | projectionMatrix() const |
| Qt3DRender::QCameraLens::ProjectionType | projectionType() const |
| float | right() const |
| void | roll(float angle) |
| void | rollAboutViewCenter(float angle) |
| QQuaternion | rollRotation(float angle) const |
| void | rotate(const QQuaternion &q) |
| void | rotateAboutViewCenter(const QQuaternion &q) |
| QQuaternion | rotation(float angle, const QVector3D &axis) const |
| void | tilt(float angle) |
| void | tiltAboutViewCenter(float angle) |
| QQuaternion | tiltRotation(float angle) const |
| float | top() const |
| Qt3DCore::QTransform * | transform() const |
| void | translate(const QVector3D &vLocal, Qt3DRender::QCamera::CameraTranslationOption option = TranslateViewCenter) |
| void | translateWorld(const QVector3D &vWorld, Qt3DRender::QCamera::CameraTranslationOption option = TranslateViewCenter) |
| QVector3D | upVector() const |
| QVector3D | viewCenter() const |
| QVector3D | viewVector() const |
パブリックスロット
| void | setAspectRatio(float aspectRatio) |
| void | setBottom(float bottom) |
| void | setExposure(float exposure) |
| void | setFarPlane(float farPlane) |
| void | setFieldOfView(float fieldOfView) |
| void | setLeft(float left) |
| void | setNearPlane(float nearPlane) |
| void | setPosition(const QVector3D &position) |
| void | setProjectionMatrix(const QMatrix4x4 &projectionMatrix) |
| void | setProjectionType(Qt3DRender::QCameraLens::ProjectionType type) |
| void | setRight(float right) |
| void | setTop(float top) |
| void | setUpVector(const QVector3D &upVector) |
| void | setViewCenter(const QVector3D &viewCenter) |
| void | viewAll() |
| void | viewEntity(Qt3DCore::QEntity *entity) |
| void | viewSphere(const QVector3D ¢er, float radius) |
シグナル
| void | aspectRatioChanged(float aspectRatio) |
| void | bottomChanged(float bottom) |
| void | exposureChanged(float exposure) |
| void | farPlaneChanged(float farPlane) |
| void | fieldOfViewChanged(float fieldOfView) |
| void | leftChanged(float left) |
| void | nearPlaneChanged(float nearPlane) |
| void | positionChanged(const QVector3D &position) |
| void | projectionMatrixChanged(const QMatrix4x4 &projectionMatrix) |
| void | projectionTypeChanged(Qt3DRender::QCameraLens::ProjectionType projectionType) |
| void | rightChanged(float right) |
| void | topChanged(float top) |
| void | upVectorChanged(const QVector3D &upVector) |
| void | viewCenterChanged(const QVector3D &viewCenter) |
| void | viewVectorChanged(const QVector3D &viewVector) |
メンバ型のドキュメント
enum QCamera::CameraTranslationOption
この列挙型は、カメラの視点中心がどのように平行移動されるかを指定します
| 定数 | 値 | 説明 |
|---|---|---|
Qt3DRender::QCamera::TranslateViewCenter | 0 | ビュー中心を平行移動させ、ビューの方向は変更しない |
Qt3DRender::QCamera::DontTranslateViewCenter | 1 | ビュー中心を平行移動せず、ビューの方向を変更する |
プロパティのドキュメント
aspectRatio : float
現在のアスペクト比を維持します。
アクセス機能:
| float | aspectRatio() const |
| void | setAspectRatio(float aspectRatio) |
通知信号:
| void | aspectRatioChanged(float aspectRatio) |
bottom : float
カメラの現在の底面を保持します。
このプロパティは、projectionType がQCameraLens::OrthographicProjection の場合にのみ有効です。
アクセス関数:
| float | bottom() const |
| void | setBottom(float bottom) |
通知シグナル:
| void | bottomChanged(float bottom) |
exposure : float
カメラの現在の露出値を保持します。
デフォルト値は 0.0 です。
Qt 3D Extras に含まれる MetalRoughMaterial は、現時点でカメラの露出を利用する唯一のマテリアルです。負の値を設定するとマテリアルは暗くなり、正の値を設定すると明るくなります。
カスタムマテリアルでは、この値の解釈を別様に設定することも可能です。
アクセス関数:
| float | exposure() const |
| void | setExposure(float exposure) |
通知シグナル:
| void | exposureChanged(float exposure) |
farPlane : float
現在のカメラの遠方平面を保持します。farPlaneよりもカメラから遠い位置にあるオブジェクトはレンダリングされません。
アクセス関数:
| float | farPlane() const |
| void | setFarPlane(float farPlane) |
通知シグナル:
| void | farPlaneChanged(float farPlane) |
fieldOfView : float
現在の垂直方向の視野角(度)を保持します。
aspectRatio と合わせて、このプロパティはカメラから見えるシーンの範囲を決定します。その点では、シーンのどの範囲を撮影したいかによって、広角レンズ(水平視野角が広い)や望遠レンズ(水平視野角が狭い)を選ぶのと同じようなものだと考えてください。
fieldOfView は、projectionType が `QCameraLens::PerspectiveProjection` の場合にのみ有効です。
アクセス関数:
| float | fieldOfView() const |
| void | setFieldOfView(float fieldOfView) |
Notifierシグナル:
| void | fieldOfViewChanged(float fieldOfView) |
left : float
カメラの現在の左座標を保持します。
このプロパティは、projectionType がQCameraLens::OrthographicProjection の場合にのみ有効です。
アクセス関数:
| float | left() const |
| void | setLeft(float left) |
通知シグナル:
| void | leftChanged(float left) |
[read-only] lens : Qt3DRender::QCameraLens* const
カメラの Qt3DRender::QCameraLens コンポーネントを保持します。
アクセス関数:
| Qt3DRender::QCameraLens * | lens() const |
nearPlane : float
現在のカメラの近接平面を保持します。nearPlaneよりもカメラに近いオブジェクトはレンダリングされません。
アクセス関数:
| float | nearPlane() const |
| void | setNearPlane(float nearPlane) |
Notifierシグナル:
| void | nearPlaneChanged(float nearPlane) |
position : QVector3D
親エンティティを基準とした座標系で、カメラの位置を保持します。
アクセス関数:
| QVector3D | position() const |
| void | setPosition(const QVector3D &position) |
通知シグナル:
| void | positionChanged(const QVector3D &position) |
projectionMatrix : QMatrix4x4
カメラの現在の投影行列を保持します。
アクセス関数:
| QMatrix4x4 | projectionMatrix() const |
| void | setProjectionMatrix(const QMatrix4x4 &projectionMatrix) |
通知シグナル:
| void | projectionMatrixChanged(const QMatrix4x4 &projectionMatrix) |
projectionType : Qt3DRender::QCameraLens::ProjectionType
カメラの投影方式を保持します。デフォルト値はQCameraLens::PerspectiveProjection です。
- QCameraLens::OrthographicProjection - 平行な線は平行に見えます。物体は距離に関係なく同じ大きさに見えます。
- QCameraLens::PerspectiveProjection - 平行な線は、遠くで交わるように見えます。被写体は、カメラから離れるほど小さく見えます。
- QCameraLens::FrustumProjection
- QCameraLens::CustomProjection
アクセス関数:
| Qt3DRender::QCameraLens::ProjectionType | projectionType() const |
| void | setProjectionType(Qt3DRender::QCameraLens::ProjectionType type) |
通知シグナル:
| void | projectionTypeChanged(Qt3DRender::QCameraLens::ProjectionType projectionType) |
Qt3DRender::QCameraLens::ProjectionTypeも参照してください 。
right : float
カメラの現在の権利を保持します。
このプロパティは、projectionType がQCameraLens::OrthographicProjection に設定されている場合にのみ有効です。
アクセス関数:
| float | right() const |
| void | setRight(float right) |
通知シグナル:
| void | rightChanged(float right) |
top : float
カメラの現在のトップを保持します。
このプロパティは、projectionType がQCameraLens::OrthographicProjection の場合にのみ有効です。
アクセス関数:
| float | top() const |
| void | setTop(float top) |
通知シグナル:
| void | topChanged(float top) |
[read-only] transform : Qt3DCore::QTransform* const
カメラの Qt3DCore::QTransform コンポーネントを保持します。
アクセス関数:
| Qt3DCore::QTransform * | transform() const |
upVector : QVector3D
親エンティティを基準とした座標系における、カメラのアップベクトルを保持します。
upベクトルは、カメラの頂点がどの方向を向いているかを示します。写真を撮る場面を想像してみてください。位置を決めてカメラを被写体に向けた後、カメラを左右に回転させて、縦向きや横向き(あるいは斜め!)のショットを撮ることもあるでしょう。upVectorを使用すると、この種の動きを制御することができます。
アクセス関数:
| QVector3D | upVector() const |
| void | setUpVector(const QVector3D &upVector) |
Notifierシグナル:
| void | upVectorChanged(const QVector3D &upVector) |
viewCenter : QVector3D
カメラの視点中心を、親エンティティを基準とした座標で保持します。
直感的には、viewCenter はカメラが向いている位置です。
アクセス関数:
| QVector3D | viewCenter() const |
| void | setViewCenter(const QVector3D &viewCenter) |
Notifierシグナル:
| void | viewCenterChanged(const QVector3D &viewCenter) |
[read-only] viewVector : QVector3D
親エンティティを基準とした座標系におけるカメラの視線ベクトルを保持します。
このベクトルは、カメラ(position )からそのターゲット(viewCenter )までの変位を表します。
アクセス関数:
| QVector3D | viewVector() const |
通知シグナル:
| void | viewVectorChanged(const QVector3D &viewVector) |
メンバ関数のドキュメント
[explicit] QCamera::QCamera(Qt3DCore::QNode *parent = nullptr)
指定されたparent を使用して、新しいQCameraインスタンスを作成します。
Qt3DRender::QCameraLens *QCamera::lens() const
現在のレンズを返します。
注: プロパティ「lens」のゲッター 関数です。
[invokable] void QCamera::pan(float angle)
カメラのパン角度をangle (度単位)だけ調整します。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable] void QCamera::pan(float angle, const QVector3D &axis)
指定されたaxis に対して、カメラのパン角度をangle 度分調整します。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable] void QCamera::panAboutViewCenter(float angle)
ビューの中心を基準に、カメラのパンをangle 度分調整します。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable] void QCamera::panAboutViewCenter(float angle, const QVector3D &axis)
axis において、ビューの中心を基準に、angle 度だけカメラのパンを調整します。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable] QQuaternion QCamera::panRotation(float angle) const
angle に対するパン回転の計算値を度単位で返し、これを使用してカメラのパンまたは Y 軸上の左右回転を調整します。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable] void QCamera::roll(float angle)
カメラのロールをangle 度分調整します。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable] void QCamera::rollAboutViewCenter(float angle)
ビューの中心を基準に、カメラのロールをangle 度だけ調整します。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable] QQuaternion QCamera::rollRotation(float angle) const
angle に対するロール回転角を度単位で返します。この値は、Z 軸上のカメラのロール(左右への傾き)を調整するために使用されます。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable] void QCamera::rotate(const QQuaternion &q)
q 内のクォータニオンを使用してカメラを回転させます。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable] void QCamera::rotateAboutViewCenter(const QQuaternion &q)
q 内のクォータニオンを使用して、ビューの中心を軸にカメラを回転させます。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable] QQuaternion QCamera::rotation(float angle, const QVector3D &axis) const
angle を基準として計算された回転角度を、度単位で、指定されたaxis の向きに基づいて返します。
注:この関数は 、メタオブジェクトシステムを介して、およびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[slot] void QCamera::setAspectRatio(float aspectRatio)
カメラのアスペクト比をaspectRatio に設定します。
注: プロパティaspectRatio のセッター 関数です。
aspectRatio()も参照してください 。
[slot] void QCamera::setBottom(float bottom)
カメラの底面をbottom に設定します。
注: プロパティ `bottom`のセッター 関数です。
bottom()も参照してください 。
[slot] void QCamera::setExposure(float exposure)
カメラの露出をexposure に設定します。
注: プロパティ `exposure`のセッター 関数です。
exposure()も参照してください 。
[slot] void QCamera::setFarPlane(float farPlane)
カメラの遠方平面を次のように設定します。farPlane
注: プロパティ `farPlane`のセッター 関数です。
farPlane()も参照してください 。
[slot] void QCamera::setFieldOfView(float fieldOfView)
カメラの視野角をfieldOfView (度単位)に設定します。
注: プロパティ `fieldOfView`のセッター 関数です。
関連項目 :fieldOfView()
[slot] void QCamera::setLeft(float left)
カメラの左座標をleft に設定します。
注: プロパティ `left`のセッター 関数です。
left()も参照してください 。
[slot] void QCamera::setNearPlane(float nearPlane)
カメラの近接平面をnearPlane に設定します。
注: プロパティ `nearPlane`のセッター 関数です。
nearPlane()も参照してください 。
[slot] void QCamera::setPosition(const QVector3D &position)
3D空間におけるカメラの位置をposition に設定します。
注: プロパティ `position`のセッター 関数です。
position()も参照してください 。
[slot] void QCamera::setProjectionMatrix(const QMatrix4x4 &projectionMatrix)
カメラの投影行列をprojectionMatrix に設定します。
注: プロパティ `projectionMatrix`のセッター 関数です。
projectionMatrix()も参照してください 。
[slot] void QCamera::setProjectionType(Qt3DRender::QCameraLens::ProjectionType type)
カメラの投影タイプをtype に設定します。
注: プロパティ `projectionType`のセッター 関数です。
関連項目 :projectionType()
[slot] void QCamera::setRight(float right)
カメラの右側をright に設定します。
注: プロパティ `right`のセッター 関数です。
right()も参照してください 。
[slot] void QCamera::setTop(float top)
カメラの頂点をtop に設定します。
注: プロパティ `top`のセッター 関数です。
top()も参照してください 。
[slot] void QCamera::setUpVector(const QVector3D &upVector)
カメラのアップベクトルをupVector に設定します。
注: プロパティ `upVector`のセッター 関数です。
upVector()も参照してください 。
[slot] void QCamera::setViewCenter(const QVector3D &viewCenter)
カメラの視点中心を `viewCenter` に設定します。
注: プロパティ `viewCenter`のセッター 関数です。
viewCenter()も参照してください 。
[invokable] void QCamera::tilt(float angle)
カメラの傾き角度をangle 度分調整します。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable] void QCamera::tiltAboutViewCenter(float angle)
ビューの中心を基準に、カメラのチルトをangle 度だけ調整します。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable] QQuaternion QCamera::tiltRotation(float angle) const
angle に対する計算されたチルト回転を度単位で返します。これは、カメラのチルト(X軸上の上下回転)を調整するために使用されます。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
Qt3DCore::QTransform *QCamera::transform() const
transform を通じてカメラの位置を返します。
注: プロパティ `transform`のゲッター 関数です。
[invokable] void QCamera::translate(const QVector3D &vLocal, Qt3DRender::QCamera::CameraTranslationOption option = TranslateViewCenter)
カメラの位置とそのビューベクトルを、ローカル座標系においてvLocal だけ平行移動させます。option を使用すると、ビューの中心を平行移動させるかどうかを切り替えることができます。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable] void QCamera::translateWorld(const QVector3D &vWorld, Qt3DRender::QCamera::CameraTranslationOption option = TranslateViewCenter)
カメラの位置とそのビューベクトルを、ワールド座標系においてvWorld 分だけ並進させます。option を使用すると、ビューの中心を並進させるかどうかを切り替えることができます。
注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[slot] void QCamera::viewAll()
カメラを回転・移動させ、そのviewCenter がシーンのバウンディングボリュームの中心となり、シーン全体がビューポートに収まるようにします。
注: レンズが透視投影モードまたは正射投影モードの場合にのみ 機能します。
「Qt3D.Render::Camera::projectionType」も参照してください 。
[slot] void QCamera::viewEntity(Qt3DCore::QEntity *entity)
カメラを回転・移動させ、そのviewCenter がentity のバウンディングボリュームの中心となり、エンティティ全体がビューポートに収まるようにします。
注: レンズが透視投影モードまたは正投影モードの場合にのみ 機能します。
「Camera.projectionType」も参照してください 。
[slot] void QCamera::viewSphere(const QVector3D ¢er, float radius)
カメラを回転・移動させ、そのviewCenter がcenter となり、radius の球体がビューポートに収まるようにします。
注: この機能は、レンズが透視投影モードまたは正射投影モードの場合にのみ 動作します。
Qt3D.Render::Camera::projectionTypeも参照してください 。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.