Skip to content

Kuesa::Serenity::TransformTracker

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

Name
TransformTracker()
~TransformTracker()

Public Attributes

Name
KDBindings::Property< AssetCollections * > assetCollections
KDBindings::Property< String > name
KDBindings::Property< glm::vec2 > screenSize
KDBindings::Property< glm::vec4 > viewportRect
KDBindings::Property<::Serenity::Camera * > camera
KDBindings::Property< glm::mat4 > matrix
KDBindings::Property< glm::mat4 > worldMatrix
KDBindings::Property< glm::vec2 > screenPosition

Protected Attributes

Name
KDBindings::Property<::Serenity::Transform * > transform
KDBindings::Property< glm::mat4 > viewMatrix
KDBindings::Property< glm::mat4 > projectionMatrix

Detailed Description

1
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

function TransformTracker

1
TransformTracker()

function ~TransformTracker

1
~TransformTracker()

Public Attributes Documentation

variable assetCollections

1
KDBindings::Property< AssetCollections * > assetCollections { nullptr };

variable name

1
KDBindings::Property< String > name {};

variable screenSize

1
KDBindings::Property< glm::vec2 > screenSize { { 0.0f, 0.0f } };

variable viewportRect

1
KDBindings::Property< glm::vec4 > viewportRect { { 0.0f, 0.0f, 0.0f, 0.0f } };

variable camera

1
KDBindings::Property<::Serenity::Camera * > camera { nullptr };

variable matrix

1
KDBindings::Property< glm::mat4 > matrix { glm::mat4(1.0f) };

variable worldMatrix

1
KDBindings::Property< glm::mat4 > worldMatrix { glm::mat4(1.0f) };

variable screenPosition

1
KDBindings::Property< glm::vec2 > screenPosition;

Protected Attributes Documentation

variable transform

1
KDBindings::Property<::Serenity::Transform * > transform;

variable viewMatrix

1
KDBindings::Property< glm::mat4 > viewMatrix;

variable projectionMatrix

1
KDBindings::Property< glm::mat4 > projectionMatrix;

Updated on 2023-07-03 at 11:02:09 +0000