#include <transformtracker.h>
Inherits from Kuesa::Qt3D::KuesaNode, Qt3DCore::QNode
Public Slots
Public Signals
Public Functions
Public Properties
Additional inherited members
Public Slots inherited from Kuesa::Qt3D::KuesaNode
Public Signals inherited from Kuesa::Qt3D::KuesaNode
Public Functions inherited from Kuesa::Qt3D::KuesaNode
Public Properties inherited from Kuesa::Qt3D::KuesaNode
Protected Attributes inherited from Kuesa::Qt3D::KuesaNode
Public Slots Documentation
slot setName
| void setName(
const QString & name
)
|
slot setCamera
| void setCamera(
Qt3DCore::QEntity * camera
)
|
slot setScreenSize
| void setScreenSize(
const QSize & screenSize
)
|
slot setViewportRect
| void setViewportRect(
const QRectF & viewportRect
)
|
slot setViewportRect
| void setViewportRect(
qreal x,
qreal y,
qreal width,
qreal height
)
|
slot setMatrix
| void setMatrix(
const QMatrix4x4 & matrix
)
|
slot setRotation
| void setRotation(
const QQuaternion & rotation
)
|
slot setRotationX
| void setRotationX(
float rotationX
)
|
slot setRotationY
| void setRotationY(
float rotationY
)
|
slot setRotationZ
| void setRotationZ(
float rotationZ
)
|
slot setScale
| void setScale(
float scale
)
|
slot setScale3D
| void setScale3D(
const QVector3D & scale3D
)
|
slot setTranslation
| void setTranslation(
const QVector3D & translation
)
|
Public Signals Documentation
signal nameChanged
| void nameChanged(
const QString & name
)
|
signal cameraChanged
| void cameraChanged(
Qt3DCore::QEntity * camera
)
|
signal screenSizeChanged
| void screenSizeChanged(
const QSize & screenSize
)
|
signal scaleChanged
| void scaleChanged(
float scale
)
|
signal scale3DChanged
| void scale3DChanged(
const QVector3D & scale
)
|
signal rotationChanged
| void rotationChanged(
const QQuaternion & rotation
)
|
signal translationChanged
| void translationChanged(
const QVector3D & translation
)
|
signal matrixChanged
| void matrixChanged(
const QMatrix4x4 & matrix
)
|
signal rotationXChanged
| void rotationXChanged(
float rotationX
)
|
signal rotationYChanged
| void rotationYChanged(
float rotationY
)
|
signal rotationZChanged
| void rotationZChanged(
float rotationZ
)
|
signal worldMatrixChanged
| void worldMatrixChanged(
const QMatrix4x4 & worldMatrix
)
|
signal screenPositionChanged
| void screenPositionChanged(
const QPointF & screenPosition
)
|
signal viewportRectChanged
| void viewportRectChanged(
QRectF viewportRect
)
|
Public Functions Documentation
| explicit TransformTracker(
Qt3DCore::QNode * parent =nullptr
)
|
1
2
3
4
5
6
7
8
9
10
11
12
13 | \class Kuesa::Qt3D::TransformTracker
\ingroup KuesaQt3DAPI
\brief TransformTracker allows watching a transform for change and computing
a projected screen position given a window size and a camera.
\noop Kuesa
\since Kuesa 2.0
\noop Kuesa::Qt3D::KuesaNode
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::Qt3D::SceneEntity sceneEntity = new Kuesa::Qt3D::SceneEntity();
Kuesa::Qt3D::TransformTracker tracker = new Kuesa::Qt3D::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::Qt3D::TransformTracker::screenPositionChanged,
this, [this] (const QPointF &screenPosition) {
| Reacts to new position .... }); ```
### function ~TransformTracker
```cpp
~TransformTracker()
|
function camera
| Qt3DCore::QEntity * camera() const
|
function screenSize
function viewportRect
| QRectF viewportRect() const
|
function name
function matrix
| QMatrix4x4 matrix() const
|
function worldMatrix
| QMatrix4x4 worldMatrix() const
|
function rotation
| QQuaternion rotation() const
|
function rotationX
function rotationY
function rotationZ
function scale
function scale3D
| QVector3D scale3D() const
|
function translation
| QVector3D translation() const
|
function screenPosition
| QPointF screenPosition() const
|
Public Property Documentation
property name
Holds the name of the Qt3DCore::QTransform instance to retrieve from the Kuesa::Qt3D::SceneEntity.
property camera
| Qt3DCore::QEntity * camera;
|
Holds the camera entity from which we should compute the screen position.
property screenSize
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.
property viewportRect
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.
property matrix
Holds the local transformation matrix associated to the tracker's referenced QTransform instance.
property worldMatrix
Holds the world transformation matrix associated to the tracker's referenced QTransform instance.
This property is readonly.
property rotation
Holds the local rotation associated to the tracker's referenced QTransform instance.
property rotationX
Holds the local x rotation (euler angle) associated to the tracker's referenced QTransform instance.
property rotationY
Holds the local y rotation (euler angle) associated to the tracker's referenced QTransform instance.
property rotationZ
Holds the local z rotation (euler angle) associated to the tracker's referenced QTransform instance.
property scale
Holds the local uniform scale associated to the tracker's referenced QTransform instance.
property scale3D
Holds the local 3D scale associated to the tracker's referenced QTransform instance.
property translation
Holds the local translation associated to the tracker's referenced QTransform instance.
property screenPosition
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.
Updated on 2023-07-03 at 11:02:06 +0000