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 Serenity::Object

Public Functions

Name
TransformTracker()
~TransformTracker()

Public Attributes

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

Protected Attributes

Name
Property<::Serenity::Transform * > transform
Property< glm::mat4 > viewMatrix
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
Property< AssetCollections * > assetCollections { nullptr };

variable name

1
Property< String > name {};

variable screenSize

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

variable viewportRect

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

variable camera

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

variable matrix

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

variable worldMatrix

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

variable screenPosition

1
Property< glm::vec2 > screenPosition;

Protected Attributes Documentation

variable transform

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

variable viewMatrix

1
Property< glm::mat4 > viewMatrix;

variable projectionMatrix

1
Property< glm::mat4 > projectionMatrix;

Updated on 2022-10-18 at 11:12:51 +0200