Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

rotate.h

Go to the documentation of this file.
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 // missing: DIR_RAND4CARD - cardinals (up,down,left,right)
00028 //          DIR_RAND4DIAG - diagonals
00029 //          DIR_RAND8     - cardinals and diagonals
00030 //          DIR_RAND360   - any direction (same as reldir_random360...)
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 // dir_covered
00043 //
00044 // There are times when one direction "covers" another direction.
00045 // For example, a gun is given a direction which "covers"
00046 // the facing of the gun holder. If the gun has direction DIR_UP,
00047 // but the object has facing DIR_LEFT, DIR_UP successfully covers it.
00048 // Suppose the gun had RELDIR_FR, and covered DIR_LEFT; Then the
00049 // result is DIR_UPLEFT.
00050 
00051 #endif // __ROTATE_H

Generated on Sun Mar 2 18:50:27 2003 for eounicorn by doxygen1.3-rc3