arcball.h 908 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#ifndef __ARCBALL_H__
#define __ARCBALL_H__

typedef struct
{
  double x, y, z, w;
} Quat;

enum QuatPart
{
  X,
  Y,
  Z,
  W,
  QuatLen
};
17 18

typedef Quat HVect;
19

20 21
typedef double HMatrix[QuatLen][QuatLen];

22 23 24 25 26 27 28 29 30
typedef enum AxisSet
{
  NoAxes,
  CameraAxes,
  BodyAxes,
  OtherAxes,
  NSets
} AxisSet;

31 32 33 34
typedef double *ConstraintSet;

extern Quat qOne;

35 36
void ArcBall_Init      (void);
void ArcBall_Place     (HVect    Center,
37
                        double   Radius);
38 39 40 41
void ArcBall_UseSet    (AxisSet  axis_Set);
void ArcBall_Update    (void);
void ArcBall_Value     (HMatrix  m_Now);
void ArcBall_Values    (double  *alpha,
42 43
                        double  *beta,
                        double  *gamma);
44 45 46 47
void ArcBall_BeginDrag (void);
void ArcBall_EndDrag   (void);
void ArcBall_Mouse     (HVect    v_Now);
void ArcBall_CopyMat   (HMatrix  inm,
48
                        HMatrix  outm);
49 50

#endif /* __ARCBALL_H__ */