Skip to content

Vp::Trackball

Static utility class for trackball interaction.

#include "Viewport/camera/Trackball.h"

Public Functions

Name
glm::mat4rotate(glm::vec2 screenStart, glm::vec2 screenEnd, glm::ivec2 screenSize =glm::ivec2(1, 1))<br>Resolves trackball movement from one point to another and returns a corresponding rotation matrix.

Public Attributes

Name
glm::vec2debug_trackballScreenSize

Public Functions Documentation

function rotate

cpp
static glm::mat4 rotate(
    glm::vec2 screenStart,
    glm::vec2 screenEnd,
    glm::ivec2 screenSize =glm::ivec2(1, 1)
)
static glm::mat4 rotate(
    glm::vec2 screenStart,
    glm::vec2 screenEnd,
    glm::ivec2 screenSize =glm::ivec2(1, 1)
)

Resolves trackball movement from one point to another and returns a corresponding rotation matrix.

Parameters:

  • screenStart Start point in range (-1, 1) or (0, screenSize)
  • screenEnd End point in range (-1, 1) or (0, screenSize)
  • screenSize Optionally screen size

Return: Immediate rotation matrix

Public Attributes Documentation

variable debug_trackballScreenSize

cpp
static glm::vec2 debug_trackballScreenSize = glm::vec2(0);
static glm::vec2 debug_trackballScreenSize = glm::vec2(0);

Updated on 2024-03-16 at 19:15:01 +0000