00001 #ifndef ME_H_
00002 #define ME_H_
00003
00004 #include "../../EffectorSet.h"
00005 #include "../../PerceptorSet.h"
00006 #include "me/ForceResistance2.h"
00007 #include "me/Hear2.h"
00008 #include "me/HingeJoint2.h"
00009 #include "me/NextState.h"
00010
00011 #define HEAD1 0
00012 #define HEAD2 1
00013 #define RIGHTARM1 2
00014 #define RIGHTARM2 3
00015 #define RIGHTARM3 4
00016 #define RIGHTARM4 5
00017 #define RIGHTLEG1 6
00018 #define RIGHTLEG2 7
00019 #define RIGHTLEG3 8
00020 #define RIGHTLEG4 9
00021 #define RIGHTLEG5 10
00022 #define RIGHTLEG6 11
00023 #define LEFTARM1 12
00024 #define LEFTARM2 13
00025 #define LEFTARM3 14
00026 #define LEFTARM4 15
00027 #define LEFTLEG1 16
00028 #define LEFTLEG2 17
00029 #define LEFTLEG3 18
00030 #define LEFTLEG4 19
00031 #define LEFTLEG5 20
00032 #define LEFTLEG6 21
00033
00040 class Me
00041 {
00042 private:
00043 char team[100];
00044 int id;
00045 char side[100];
00046 float playGroundLength;
00047 float playGroundWidth;
00048 float goalWidth;
00049 float goalHeight;
00050 float *f1r;
00051 float *g1r;
00052 float *g2r;
00053 float *f2r;
00054 float *f2l;
00055 float *g2l;
00056 float *g1l;
00057 float *f1l;
00058 float position[3];
00059 float rotationMatrix[3][3];
00060 float beam[3];
00061 bool beamChanged;
00062 HingeJoint2 *hingeJoint2;
00063 int forceResistance2Count;
00064 ForceResistance2 *forceResistance2;
00065 int hear2Count;
00066 Hear2 *hear2;
00067 char say[100];
00068 bool sayChanged;
00069 NextState *nextState;
00070 void getPosition(float object0[3], float distanceFromObject0, float object1[3], float distanceFromObject1, float object2[3], float distanceFromObject2, float position0[2], float position1[2], float position2[2]);
00071 void getObject(float distance, float angle1, float angle2, float object[3]);
00072 void getSolution(float a00, float a01, float a02, float b0, float a10, float a11, float a12, float b1, float a20, float a21, float a22, float b2, float solution[3]);
00073 void getRotationMatrix(float object00[3], float object01[3], float object10[3], float object11[3], float object20[3], float object21[3], float rotationMatrix[3][3]);
00074 public:
00075 Me(char *team, int id, float playGroundLength, float playGroundWidth, float goalWidth, float goalHeight, float f1r[3], float g1r[3], float g2r[3], float f2r[3], float f2l[3], float g2l[3], float g1l[3], float f1l[3]);
00076 void transform(PerceptorSet *perceptorSet);
00077 void reverseTransform(EffectorSet *effectorSet);
00078 char *getTeam();
00079 int getId();
00080 char *getSide();
00081 float *getPosition();
00082 float (*getRotationMatrix())[3];
00083 void setPositionAndRotation(float x, float y, float rotation);
00084 HingeJoint2 *getHingeJoint2(int index);
00085 int getForceResistance2Count();
00086 ForceResistance2 *getForceResistance2(int index);
00087 int getHear2Count();
00088 Hear2 *getHear2(int index);
00089 void setSay(char *message);
00090 NextState *getNextState();
00091 virtual ~Me();
00092 };
00093
00094 #endif