TransformTracker allows watching a transform for change and computing a projected screen position given a window size and a camera. More...
Header: | #include <TransformTracker> |
Since: | Kuesa 1.3 |
Instantiated By: | TransformTracker |
Inherits: | Kuesa::KuesaNode |
This class was introduced in Kuesa 1.3.
|
Qt3DCore::QEntity * | camera() const |
QMatrix4x4 | matrix() const |
QString | name() const |
QQuaternion | rotation() const |
float | rotationX() const |
float | rotationY() const |
float | rotationZ() const |
float | scale() const |
QVector3D | scale3D() const |
QPointF | screenPosition() const |
QSize | screenSize() const |
QVector3D | translation() const |
QRectF | viewportRect() const |
QMatrix4x4 | worldMatrix() const |
void | setCamera(Qt3DCore::QEntity *camera) |
void | setMatrix(const QMatrix4x4 &matrix) |
void | setName(const QString &name) |
void | setRotation(const QQuaternion &rotation) |
void | setRotationX(float rotationX) |
void | setRotationY(float rotationY) |
void | setRotationZ(float rotationZ) |
void | setScale(float scale) |
void | setScale3D(const QVector3D &scale3D) |
void | setScreenSize(const QSize &screenSize) |
void | setTranslation(const QVector3D &translation) |
void | setViewportRect(qreal x, qreal y, qreal width, qreal height) |
void | setViewportRect(const QRectF &viewportRect) |
void | cameraChanged(Qt3DCore::QEntity *camera) |
void | matrixChanged(const QMatrix4x4 &matrix) |
void | nameChanged(const QString &name) |
void | rotationChanged(const QQuaternion &rotation) |
void | rotationXChanged(float rotationX) |
void | rotationYChanged(float rotationY) |
void | rotationZChanged(float rotationZ) |
void | scale3DChanged(const QVector3D &scale) |
void | scaleChanged(float scale) |
void | screenPositionChanged(const QPointF &screenPosition) |
void | screenSizeChanged(const QSize &screenSize) |
void | translationChanged(const QVector3D &translation) |
void | viewportRectChanged(QRectF viewportRect) |
void | worldMatrixChanged(const QMatrix4x4 &worldMatrix) |
TransformTracker allows watching a transform for change and computing a projected screen position given a window size and a camera.
This is especially useful to place 2D content based on a 3D position.
Kuesa::SceneEntity *sceneEntity = new Kuesa::SceneEntity(); Kuesa::TransformTracker *tracker = new Kuesa::TransformTracker(); Qt3DRender::QCamera *camera = new Qt3DRender::Camera(); tracker->setSceneEntity(sceneEntity); tracker->setName(QStringLiteral("MyTransform"); tracker->setCamera(camera); tracker->setScreenSize({512, 512}); QObject::connect(tracker, &Kuesa::TransformTracker::screenPositionChanged, this, [this] (const QPointF &screenPosition) { // Reacts to new position .... });
Holds the camera entity from which we should compute the screen position.
Access functions:
Qt3DCore::QEntity * | camera() const |
void | setCamera(Qt3DCore::QEntity *camera) |
Notifier signal:
void | cameraChanged(Qt3DCore::QEntity *camera) |
Holds the local transformation matrix associated to the tracker's referenced QTransform instance.
Access functions:
QMatrix4x4 | matrix() const |
void | setMatrix(const QMatrix4x4 &matrix) |
Notifier signal:
void | matrixChanged(const QMatrix4x4 &matrix) |
Holds the name of the Qt3DCore::QTransform instance to retrieve from the Kuesa::SceneEntity.
Access functions:
QString | name() const |
void | setName(const QString &name) |
Notifier signal:
void | nameChanged(const QString &name) |
Holds the local rotation associated to the tracker's referenced QTransform instance.
Access functions:
QQuaternion | rotation() const |
void | setRotation(const QQuaternion &rotation) |
Notifier signal:
void | rotationChanged(const QQuaternion &rotation) |
Holds the local x rotation (euler angle) associated to the tracker's referenced QTransform instance.
Access functions:
float | rotationX() const |
void | setRotationX(float rotationX) |
Notifier signal:
void | rotationXChanged(float rotationX) |
Holds the local y rotation (euler angle) associated to the tracker's referenced QTransform instance.
Access functions:
float | rotationY() const |
void | setRotationY(float rotationY) |
Notifier signal:
void | rotationYChanged(float rotationY) |
Holds the local z rotation (euler angle) associated to the tracker's referenced QTransform instance.
Access functions:
float | rotationZ() const |
void | setRotationZ(float rotationZ) |
Notifier signal:
void | rotationZChanged(float rotationZ) |
Holds the local uniform scale associated to the tracker's referenced QTransform instance.
Access functions:
float | scale() const |
void | setScale(float scale) |
Notifier signal:
void | scaleChanged(float scale) |
Holds the local 3D scale associated to the tracker's referenced QTransform instance.
Access functions:
QVector3D | scale3D() const |
void | setScale3D(const QVector3D &scale3D) |
Notifier signal:
void | scale3DChanged(const QVector3D &scale) |
Holds the 2D screen position computed from the transformation in world space obtained from the tracker's referenced Transform, the camera, the sceneSize and viewportRect.
Access functions:
QPointF | screenPosition() const |
Notifier signal:
void | screenPositionChanged(const QPointF &screenPosition) |
Holds the size of the area within which we should compute screen positions. This would usually be the size of the window or the size of the sub view within the window.
Access functions:
QSize | screenSize() const |
void | setScreenSize(const QSize &screenSize) |
Notifier signal:
void | screenSizeChanged(const QSize &screenSize) |
Holds the local translation associated to the tracker's referenced QTransform instance.
Access functions:
QVector3D | translation() const |
void | setTranslation(const QVector3D &translation) |
Notifier signal:
void | translationChanged(const QVector3D &translation) |
Holds the normalized viewport rectangle defining the area into which screen positions should be computed. If unspecified QRectF(0.0f, 0.0f, 1.0f, 1.0f) will be used.
Access functions:
QRectF | viewportRect() const |
void | setViewportRect(const QRectF &viewportRect) |
void | setViewportRect(qreal x, qreal y, qreal width, qreal height) |
Notifier signal:
void | viewportRectChanged(QRectF viewportRect) |
Holds the world transformation matrix associated to the tracker's referenced QTransform instance.
This property is readonly.
Access functions:
QMatrix4x4 | worldMatrix() const |
Notifier signal:
void | worldMatrixChanged(const QMatrix4x4 &worldMatrix) |