// copyright Min Zhong, cs838 proj2, April, 2000 #ifndef ROTCONVERTER_H #define ROTCONVERTER_H typedef enum { Scalar = 0, XCoord = 1, YCoord = 2, ZCoord = 3 } QUATER_ORDER; typedef enum { MAP_X = 0, MAP_Y = 1, MAP_Z = 2 } EMAP_ORDER; /****** API used in parse to fill quatern array */ void euler3ToQuatern(double zRotDeg, double xRotDeg, double yRotDeg, double* resultQ); /* composes 3 euler rot ez, ex, ey, into a quat resultQ. assume euler rot in the order of Z, X and then Y. ez=(zRotDeg, 0, 0, 1) ex=(xRotDeg, 1, 0, 0) ey=(yRotDeg, 0, 1, 0) ASSUME resultQ[4] has mem alloc before call */ /******* API used in viewer.cpp drawing routine to do a rot */ void quaternToRot(double *q, double &aDeg, double &x, double &y, double &z); /* convert a quater (q[4]) to a rotation about vect(x,y,z) for angle aDeg. */ /******* API used in viewer.cpp drawing routine to do a rot */ /* emap m[3] to UNIT rot axis and rot angle aDeg */ void emapToRot(double *m, double &aDeg, double &x, double &y, double &z); /* converts a quat q[4] to an emap m[3] */ void quatToEmap(double *q, double *m); void emapToQuat(double *m, double *q); void EulerToQuat(double yaw, double pitch, double roll, double *quat); #endif