00001 #ifndef __ROTATE_H
00002
00003 #define __ROTATE_H
00004
00005 #define DIAGONAL_SCALING 0.707
00006
00007 #define DIR_UP 0
00008 #define DIR_UPRIGHT 1
00009 #define DIR_RIGHT 2
00010 #define DIR_DOWNRIGHT 3
00011 #define DIR_DOWN 4
00012 #define DIR_DOWNLEFT 5
00013 #define DIR_LEFT 6
00014 #define DIR_UPLEFT 7
00015 #define DIR_SIZE 8
00016
00017 #define RELDIR_FORWARD 8
00018 #define RELDIR_BACKWARD 9
00019 #define RELDIR_LEFT 10
00020 #define RELDIR_RIGHT 11
00021 #define RELDIR_FR 12
00022 #define RELDIR_BR 13
00023 #define RELDIR_BL 14
00024 #define RELDIR_FL 15
00025 #define RELDIR_RANDOM4 16 // not implemented
00026 #define RELDIR_RANDOM360 17 // not implemented
00027
00028
00029
00030
00031
00032 void rotate_setup();
00033 void xy_scaling( int dir, float* x, float* y );
00034 void xy_components( int dir, float speed, float* x, float* y );
00035 int dir_opposite( int dir );
00036 int dir_cwise( int dir );
00037 int dir_ccwise( int dir );
00038 int dir_after_rotations( int dir, int rot );
00039 int dir_covered( int dir, int otherdir );
00040 int xy_to_dir( float x, float y );
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 #endif // __ROTATE_H