gramods
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
gramods::gmTouch::TouchState::CameraAdaptor Struct Reference

Base type for camera adaptors providing means to input camera data from different scenegraph or graphics platforms. More...

#include <TouchState.hh>

Inheritance diagram for gramods::gmTouch::TouchState::CameraAdaptor:
Inheritance graph
[legend]

Public Member Functions

virtual void init (int width, int height)
 Called by the owner (TouchState) when eventsInit is called.
 
virtual void done ()
 Called by the owner (TouchState) when eventsDone is called.
 

Protected Member Functions

void setCurrentProjection (Eigen::Matrix4f WPV_inv)
 Sets the current (inverted) projection matrix to use when back-projecting the 2D touch points into 3D.
 

Detailed Description

Base type for camera adaptors providing means to input camera data from different scenegraph or graphics platforms.

Get the platform/library dependent adaptor by calling TouchState::getCameraAdaptor.

Member Function Documentation

◆ done()

void gramods::gmTouch::TouchState::CameraAdaptor::done ( )
virtual

Called by the owner (TouchState) when eventsDone is called.

◆ init()

void gramods::gmTouch::TouchState::CameraAdaptor::init ( int  width,
int  height 
)
virtual

Called by the owner (TouchState) when eventsInit is called.

◆ setCurrentProjection()

void gramods::gmTouch::TouchState::CameraAdaptor::setCurrentProjection ( Eigen::Matrix4f  WPV_inv)
protected

Sets the current (inverted) projection matrix to use when back-projecting the 2D touch points into 3D.

This can be calculated by inverting the matrix product of 1) viewport window matrix, 2) projection matrix and 3) view matrix (W*P*V)^-1, when using column vector matrices.

If the view changes changing over time, one of these methods needs to be called every frame, between calling eventsInit and eventsDone and before extrating 3D lines. If the view is static, the method needs to be called at least twice, to make the current matrix be copied to previous state.

See also
TouchState::getTouchLines

The documentation for this struct was generated from the following files: