• Main Page
  • Classes
  • Files
  • File List

Common/Constants.h

00001 //some useful constants for snook3D Game
00002 
00003 #ifndef CONSTANTS_H 
00004 #define CONSTANTS_H
00005 
00006 #include "GL/gl.h"
00007 #include "Types.h"
00008 #include <utility>
00009 
00010 
00011 /* Physics default constants
00012  *
00013  * Don't use them directly!
00014  * Instead initialize local copies with these values, because we want to modify coefficients during runtime
00015  */
00016 
00017 const real RESTITUTION = 0.995;
00018 const real CUSHION_RESTITUTION = 0.7;
00019 
00020 
00021 /* Real world dimensions in meters*/
00022 
00023 const GLdouble TABLEWIDTH = 1.778;
00024 const GLdouble TABLELENGTH = 3.569;
00025 /*don't confuse following one with length, that is literally a height - means distance between ground and a playing*/
00026 const GLdouble TABLEHEIGHT = 0.860;
00027 const GLdouble BALLRADIUS = 0.02625;
00028 const GLdouble DRADIUS = 0.292;
00029 const GLdouble POCKETSIZE = 0.05;
00030 
00031 
00032 const real CUSHIONSIZE = 0.2;
00033 const real CUSHIONHEIGHT = BALLRADIUS*1.4;
00034 
00035 /*following dimensions are relative to the center of the table*/
00036 const GLdouble BAULK = -TABLELENGTH/2.0+0.737;
00037 const std::pair<GLdouble,GLdouble> BLACKSPOT = std::pair<GLdouble,GLdouble>(0.0,TABLELENGTH/2-0.324);
00038 const std::pair<GLdouble,GLdouble> BLUESPOT = std::pair<GLdouble,GLdouble>(0.0,0.0);
00039 const std::pair<GLdouble,GLdouble> PINKSPOT = std::pair<GLdouble,GLdouble>(0.0,TABLELENGTH/4.0);
00040 const std::pair<GLdouble,GLdouble> BROWNSPOT = std::pair<GLdouble,GLdouble>(0.0,BAULK);
00041 const std::pair<GLdouble,GLdouble> YELLOWSPOT = std::pair<GLdouble,GLdouble>(-DRADIUS,BAULK);
00042 const std::pair<GLdouble,GLdouble> GREENSPOT = std::pair<GLdouble,GLdouble>(DRADIUS,BAULK);
00043 
00044 
00045 const GLdouble SCENEWIDTH = 10;
00046 const GLdouble SCENELENGTH = 10;
00047 const GLdouble SCENEHEIGHT = 10;
00048 
00049 enum Color { WHITE=0, RED, YELLOW, GREEN, BROWN, BLUE, PINK, BLACK };
00050 
00051 const GLfloat mat[8][3] = {{1.0f,1.0f,0.95f},{1.0f,0.0f,0.0f}, {0.95f,0.8f,0.0f},{0.0f,0.39f,0.0f},{0.55f,0.27f,0.008f},{0.0f,0.0f,0.8f},{0.98f,0.62f,0.66f},{0.1f,0.1f,0.1f}};
00052 
00053 #endif

Generated on Sun Dec 5 2010 19:03:32 for Snook3d by  doxygen 1.7.2