papyrus logo

trackball.c File Reference

#include <math.h>
#include "trackball.h"

Include dependency graph for trackball.c:


Defines

#define TRACKBALLSIZE   (0.8)
#define RENORMCOUNT   97

Functions

static float tb_project_to_sphere (float, float, float)
static void normalize_quat (float[4])
void vzero (float *v)
void vset (float *v, float x, float y, float z)
void vsub (const float *src1, const float *src2, float *dst)
void vcopy (const float *v1, float *v2)
void vcross (const float *v1, const float *v2, float *cross)
float vlength (const float *v)
void vscale (float *v, float div)
void vnormal (float *v)
float vdot (const float *v1, const float *v2)
void vadd (const float *src1, const float *src2, float *dst)
void trackball (float q[4], float p1x, float p1y, float p2x, float p2y)
void axis_to_quat (float a[3], float phi, float q[4])
void add_quats (float q1[4], float q2[4], float dest[4])
void build_rotmatrix (float m[4][4], float q[4])

Define Documentation

#define RENORMCOUNT   97

Referenced by add_quats().

#define TRACKBALLSIZE   (0.8)

Referenced by trackball().


Function Documentation

void add_quats ( float  q1[4],
float  q2[4],
float  dest[4] 
)

void axis_to_quat ( float  a[3],
float  phi,
float  q[4] 
)

References vcopy(), vnormal(), and vscale().

Referenced by trackball().

void build_rotmatrix ( float  m[4][4],
float  q[4] 
)

static void normalize_quat ( float  q[4]  )  [static]

Referenced by add_quats().

static float tb_project_to_sphere ( float  r,
float  x,
float  y 
) [static]

Referenced by trackball().

void trackball ( float  q[4],
float  p1x,
float  p1y,
float  p2x,
float  p2y 
)

void vadd ( const float *  src1,
const float *  src2,
float *  dst 
)

Referenced by add_quats().

void vcopy ( const float *  v1,
float *  v2 
)

Referenced by add_quats(), axis_to_quat(), and vcross().

void vcross ( const float *  v1,
const float *  v2,
float *  cross 
)

References vcopy().

Referenced by add_quats(), and trackball().

float vdot ( const float *  v1,
const float *  v2 
)

Referenced by add_quats().

float vlength ( const float *  v  ) 

Referenced by trackball(), and vnormal().

void vnormal ( float *  v  ) 

References vlength(), and vscale().

Referenced by axis_to_quat().

void vscale ( float *  v,
float  div 
)

Referenced by add_quats(), axis_to_quat(), and vnormal().

void vset ( float *  v,
float  x,
float  y,
float  z 
)

Referenced by trackball().

void vsub ( const float *  src1,
const float *  src2,
float *  dst 
)

Referenced by trackball().

void vzero ( float *  v  ) 

Referenced by trackball().


Generated on Wed Mar 18 12:34:48 2009 for papyrus by doxygen 1.5.7.1