SPH
Public Member Functions | List of all members
ArcBall Class Reference

Helper object providing rotation matrix based on mouse drag. More...

#include <ArcBall.h>

Public Member Functions

 ArcBall ()
 
 ArcBall (const Pixel size)
 
void resize (const Pixel newSize)
 
void click (const Pixel point)
 Called on mouse click, starting the rotation. More...
 
AffineMatrix drag (const Pixel point, const Vector &pivot)
 Called when mouse moves, rotating the object. More...
 

Detailed Description

Helper object providing rotation matrix based on mouse drag.

Member function correspond need to be called from mouse events, function drag then returns the rotation matrix. The functions must be called in order: click - drag - drag - ... - drag - stop - click - drag ..., etc. Order is checked by assert.

Done according to https://gist.github.com/vilmosioo/5318327

Definition at line 21 of file ArcBall.h.

Constructor & Destructor Documentation

◆ ArcBall() [1/2]

ArcBall::ArcBall ( )
inline

Definition at line 30 of file ArcBall.h.

◆ ArcBall() [2/2]

ArcBall::ArcBall ( const Pixel  size)
inlineexplicit

Definition at line 34 of file ArcBall.h.

Member Function Documentation

◆ click()

void ArcBall::click ( const Pixel  point)
inline

Called on mouse click, starting the rotation.

Definition at line 42 of file ArcBall.h.

◆ drag()

AffineMatrix ArcBall::drag ( const Pixel  point,
const Vector pivot 
)
inline

Called when mouse moves, rotating the object.

Parameters
pointCurrent mouse position in image space.
pivotCenter of rotation.
Returns
New rotation matrix of the object

Definition at line 51 of file ArcBall.h.

◆ resize()

void ArcBall::resize ( const Pixel  newSize)
inline

Definition at line 37 of file ArcBall.h.


The documentation for this class was generated from the following file: