|
gramods
|
Camera adaptor for OSG, providing means to set the projection matrix of TouchState by providing an OSG camera. More...
#include <OSGCameraAdaptor.hh>


Public Member Functions | |
| bool | setCurrentProjection (osg::Camera *camera) |
| Calculates and sets the current projection matrix to use when back-projecting the 2D touch points into 3D, and set the previously current to be used when back-projecting "previous" touch points. | |
Public Member Functions inherited from gramods::gmTouch::TouchState::CameraAdaptor | |
| 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. | |
Additional Inherited Members | |
Protected Member Functions inherited from gramods::gmTouch::TouchState::CameraAdaptor | |
| void | setCurrentProjection (Eigen::Matrix4f WPV_inv) |
| Sets the current (inverted) projection matrix to use when back-projecting the 2D touch points into 3D. | |
Camera adaptor for OSG, providing means to set the projection matrix of TouchState by providing an OSG camera.
Typical use:
| bool gramods::gmTouch::OSGCameraAdaptor::setCurrentProjection | ( | osg::Camera * | camera | ) |
Calculates and sets the current projection matrix to use when back-projecting the 2D touch points into 3D, and set the previously current to be used when back-projecting "previous" touch points.
If the view changes 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, it needs to be called at least twice, to make the current matrix be copied to previous state. The frame copying is performed even when the valid project cannot be extracted.