PlaceholderTracker allows watching a placeholder for changes and computing a screen position changes given a window size and a camera. More...
Since: | Kuesa 1.3 |
Instantiates: | PlaceholderTracker |
PlaceholderTracker allows watching a placeholder for changes and computing a screen position changes given a window size and a camera.
This is especially useful to easily map 2D content based on a 3D placeholder. It does so by projecting a plane defined by the Kuesa::Placeholder facing the camera to screen space. setting the x, y, width and height properties of a target QObject to match the projected rectangle
Item { id: uiTarget } ... SceneEntity { id: sceneEntity Camera { id: camera } PlaceholderTracker { name: "MyPlaceholder" camera: camera screenSize: Qt.size(512, 512) target: uiTarget } }
Read more about Kuesa Placeholders.
See also Kuesa::Placeholder.
Holds the camera the tracker is facing and which is used to project the plane to screen space.
Rectangle { id: rect } Kuesa.Asset { id: mainCamera collection: scene.cameras name: "Camera_Orientation" } PlaceholderTracker { name: "MyPlaceholder" camera: camera screenSize: Qt.size(512, 512) target: uiTarget }
Note: using a camera for the tracker different than the one being used for the render might give unexpected results.
Holds the name of the Placeholder instance to retrieve from the SceneEntity.
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.
Holds the target object on which to set x, y, width and height properties computed from the Placeholder and Camera transformations.
Commonly it would be a QtQuick element and should be used as
Rectangle { id: rect } PlaceholderTracker { name: "MyPlaceholder" camera: camera screenSize: Qt.size(512, 512) target: uiTarget }
Holds the normalized viewport rectangle defining the area into which screen positions should be computed. If unspecified Qt.rect(0.0, 0.0, 1.0, 1.0) will be used.