Module: Kuesa Serenity API
TransformTracker allows watching a transform for change and computing a projected screen position given a window size and a camera. More...
#include <Kuesa/Serenity/api/transformtracker.h>
Inherits from KDFoundation::Object
Public Functions
Public Attributes
Protected Attributes
Detailed Description
| class Kuesa::Serenity::TransformTracker;
|
TransformTracker allows watching a transform for change and computing a projected screen position given a window size and a camera.
Since: Kuesa 2.0
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.
1
2
3
4
5
6
7
8
9
10
11
12
13 | Kuesa::Serenity::TransformTracker *tracker = new Kuesa::Serenity::TransformTracker();
auto *camera = new ::Serenity::Camera();
auto assetCollections = Kuesa::Serenity::AssetCollections;
tracker->assetCollections = &assetCollections;
tracker->name = String("MyTransform");
tracker->camera = camera;
tracker->screenSize = glm::vec2(512, 512);
tracker->viewportRect = glm::vec4(0.0f, 0.0f, 1.0f, 1.0f);
tracker->screenPosition.valueChanged().connect([] (const glm::vec2 screenPos) {
...
});
|
Public Functions Documentation
Public Attributes Documentation
variable assetCollections
| KDBindings::Property< AssetCollections * > assetCollections { nullptr };
|
variable name
| KDBindings::Property< String > name {};
|
variable screenSize
| KDBindings::Property< glm::vec2 > screenSize { { 0.0f, 0.0f } };
|
variable viewportRect
| KDBindings::Property< glm::vec4 > viewportRect { { 0.0f, 0.0f, 0.0f, 0.0f } };
|
variable camera
| KDBindings::Property<::Serenity::Camera * > camera { nullptr };
|
variable matrix
| KDBindings::Property< glm::mat4 > matrix { glm::mat4(1.0f) };
|
variable worldMatrix
| KDBindings::Property< glm::mat4 > worldMatrix { glm::mat4(1.0f) };
|
variable screenPosition
| KDBindings::Property< glm::vec2 > screenPosition;
|
Protected Attributes Documentation
| KDBindings::Property<::Serenity::Transform * > transform;
|
variable viewMatrix
| KDBindings::Property< glm::mat4 > viewMatrix;
|
variable projectionMatrix
| KDBindings::Property< glm::mat4 > projectionMatrix;
|
Updated on 2023-07-03 at 11:02:09 +0000