+void Object::handleRot(int divide)
+{
+ messedwith -= multiplier;
+ if (rotxvel || rotx) {
+ if (rotx > 0) {
+ rotxvel -= multiplier * 8 * fabs(rotx);
+ }
+ if (rotx < 0) {
+ rotxvel += multiplier * 8 * fabs(rotx);
+ }
+ if (rotx > 0) {
+ rotxvel -= multiplier * 4;
+ }
+ if (rotx < 0) {
+ rotxvel += multiplier * 4;
+ }
+ if (rotxvel > 0) {
+ rotxvel -= multiplier * 4;
+ }
+ if (rotxvel < 0) {
+ rotxvel += multiplier * 4;
+ }
+ if (fabs(rotx) < multiplier * 4) {
+ rotx = 0;
+ }
+ if (fabs(rotxvel) < multiplier * 4) {
+ rotxvel = 0;
+ }
+
+ rotx += rotxvel * multiplier * 4;
+ }
+ if (rotyvel || roty) {
+ if (roty > 0) {
+ rotyvel -= multiplier * 8 * fabs(roty);
+ }
+ if (roty < 0) {
+ rotyvel += multiplier * 8 * fabs(roty);
+ }
+ if (roty > 0) {
+ rotyvel -= multiplier * 4;
+ }
+ if (roty < 0) {
+ rotyvel += multiplier * 4;
+ }
+ if (rotyvel > 0) {
+ rotyvel -= multiplier * 4;
+ }
+ if (rotyvel < 0) {
+ rotyvel += multiplier * 4;
+ }
+ if (fabs(roty) < multiplier * 4) {
+ roty = 0;
+ }
+ if (fabs(rotyvel) < multiplier * 4) {
+ rotyvel = 0;
+ }
+
+ roty += rotyvel * multiplier * 4;
+ }
+ if (roty) {
+ glRotatef(roty / divide, 1, 0, 0);
+ }
+ if (rotx) {
+ glRotatef(-rotx / divide, 0, 0, 1);
+ }
+ if (rotx > 10) {
+ rotx = 10;
+ }
+ if (rotx < -10) {
+ rotx = -10;
+ }
+ if (roty > 10) {
+ roty = 10;
+ }
+ if (roty < -10) {
+ roty = -10;
+ }
+}
+