#ifndef SPIDERDATA_H #define SPIDERDATA_H 1 class SpiderData; class SpiderData { public: SpiderData( int speed, int leg_rt, int delay, float newx, float newy, float newz, float newsx, float newsy, float newsz ) { walk_speed = speed; leg_rt_amt = leg_rt; leg_delay = delay; //printf(">>>>>>>>>>>>>>>>>>>>>>>Spiderdata:\n"); //printf("newstuff %f %f %f\n", newx, newy, newz); data_x = newx; data_y = newy; data_z = newz; //printf("newstuff %f %f %f\n", data_x, data_y, data_z); data_sx = newsx; data_sy = newsy; data_sz = newsz; dest_x = data_x; dest_y = data_y; dest_z = data_z; rot_x = 0; rot_y = 0; rot_z = 0; } void setLoc( float newx, float newy, float newz) { data_x = newx; data_y = newy; data_z = newz; } float getx() { return data_x; } float gety() { return data_y; } float getz() { return data_z; } float getsx() { return data_sx; } float getsy() { return data_sy; } float getsz() { return data_sz; } void setLegDelay( float newdelay ) { leg_delay = newdelay; } float getwalk_speed() { return walk_speed; } float getleg_rt_amt() { return leg_rt_amt; } float getleg_delay() { return leg_delay; } void printInfo() { //printf("SpiderData: printInfo: You have reached printInfo()!!!\n"); //printf("SpiderData: printInfo: z: %f\n", data_z); //printf("SpiderData: printInfo: y: %f\n", data_y); //printf("SpiderData: printInfo: x: %f\n", data_x); } void setDest( float newx, float newy, float newz ) { dest_x = newx; dest_y = newy; dest_z = newz; doRot(); } void setDestx( float newx ) { dest_x = newx; doRot(); } void setDesty( float newy ) { dest_y = newy; doRot(); } void setDestz( float newz ) { dest_z = newz; doRot(); } void doRot() { rot_z = pfArcTan2(-1 * dest_x, dest_y); //rot_z += 90; //printf("dest_x: %f dest_y: %f rot: %f\n", // dest_x, dest_y, rot_z); } float getRotX() { return rot_x; } float getRotY() { return rot_y; } float getRotZ() { return rot_z; } // for testing only void setRot( float newrot ) { rot_z = newrot; //printf("rot_z is now: %f\n", rot_z); } float getDestx() { return dest_x; } float getDesty() { return dest_y; } float getDestz() { return dest_z; } private: SpiderData(); float walk_speed; float leg_rt_amt; float leg_delay; float data_x,data_y,data_z; float data_sx,data_sy,data_sz; float dest_x,dest_y,dest_z; float rot_x, rot_y, rot_z; }; #endif