1 #ifndef __ARCBALL_H__ 2 #define __ARCBALL_H__ 3 4 typedef struct 5 { 6 double x, y, z, w; 7 } Quat; 8 9 enum QuatPart 10 { 11 X, 12 Y, 13 Z, 14 W, 15 QuatLen 16 }; 17 18 typedef Quat HVect; 19 20 typedef double HMatrix[QuatLen][QuatLen]; 21 22 typedef enum AxisSet 23 { 24 NoAxes, 25 CameraAxes, 26 BodyAxes, 27 OtherAxes, 28 NSets 29 } AxisSet; 30 31 typedef double *ConstraintSet; 32 33 extern Quat qOne; 34 35 void ArcBall_Init (void); 36 void ArcBall_Place (HVect Center, 37 double Radius); 38 void ArcBall_UseSet (AxisSet axis_Set); 39 void ArcBall_Update (void); 40 void ArcBall_Value (HMatrix m_Now); 41 void ArcBall_Values (double *alpha, 42 double *beta, 43 double *gamma); 44 void ArcBall_BeginDrag (void); 45 void ArcBall_EndDrag (void); 46 void ArcBall_Mouse (HVect v_Now); 47 void ArcBall_CopyMat (HMatrix inm, 48 HMatrix outm); 49 50 #endif /* __ARCBALL_H__ */ 51