HOG2
Functions | Variables
Trackball.cpp File Reference
#include "Trackball.h"
#include <math.h>
Include dependency graph for Trackball.cpp:

Go to the source code of this file.

Functions

void startTrackball (long x, long y, long originX, long originY, long width, long height)
 
void rollToTrackball (long x, long y, float rot[4])
 
static void rotation2Quat (float *A, float *q)
 
void addToRotationTrackball (float *dA, float *A)
 

Variables

static const float kTol = 0.001
 
static const float kRad2Deg = 180. / 3.1415927
 
static const float kDeg2Rad = 3.1415927 / 180.
 
float gRadiusTrackball
 
float gStartPtTrackball [3]
 
float gEndPtTrackball [3]
 
long gXCenterTrackball = 0
 
long gYCenterTrackball = 0
 

Function Documentation

◆ addToRotationTrackball()

void addToRotationTrackball ( float *  dA,
float *  A 
)

Definition at line 168 of file Trackball.cpp.

References kRad2Deg, and rotation2Quat().

Referenced by if(), and mouseMovedNoButton().

◆ rollToTrackball()

void rollToTrackball ( long  x,
long  y,
float  rot[4] 
)

◆ rotation2Quat()

static void rotation2Quat ( float *  A,
float *  q 
)
static

Definition at line 153 of file Trackball.cpp.

References kDeg2Rad.

Referenced by addToRotationTrackball().

◆ startTrackball()

void startTrackball ( long  x,
long  y,
long  originX,
long  originY,
long  width,
long  height 
)

Definition at line 62 of file Trackball.cpp.

References gRadiusTrackball, gStartPtTrackball, gXCenterTrackball, gYCenterTrackball, height, and width.

Referenced by if().

Variable Documentation

◆ gEndPtTrackball

float gEndPtTrackball[3]

Definition at line 58 of file Trackball.cpp.

Referenced by rollToTrackball().

◆ gRadiusTrackball

float gRadiusTrackball

Definition at line 56 of file Trackball.cpp.

Referenced by rollToTrackball(), and startTrackball().

◆ gStartPtTrackball

float gStartPtTrackball[3]

Definition at line 57 of file Trackball.cpp.

Referenced by rollToTrackball(), and startTrackball().

◆ gXCenterTrackball

long gXCenterTrackball = 0

Definition at line 59 of file Trackball.cpp.

Referenced by rollToTrackball(), and startTrackball().

◆ gYCenterTrackball

long gYCenterTrackball = 0

Definition at line 59 of file Trackball.cpp.

Referenced by rollToTrackball(), and startTrackball().

◆ kDeg2Rad

const float kDeg2Rad = 3.1415927 / 180.
static

Definition at line 54 of file Trackball.cpp.

Referenced by rotation2Quat().

◆ kRad2Deg

const float kRad2Deg = 180. / 3.1415927
static

Definition at line 53 of file Trackball.cpp.

Referenced by addToRotationTrackball(), and rollToTrackball().

◆ kTol

const float kTol = 0.001
static

Definition at line 52 of file Trackball.cpp.

Referenced by rollToTrackball().