X-Git-Url: https://git.ucc.asn.au/?p=atyndall%2Fcits2231.git;a=blobdiff_plain;f=globals.h;h=a849e05ea9178b03f7693c4f483fd348c2586bb4;hp=b3d0d6bb260dbd488ffe0707e15559fb94a1ef29;hb=7fa1021e8712a2d60f4485dd60f73d99e9602bf2;hpb=893757ee1bb56fd26df3f84fb66403d17f27a801 diff --git a/globals.h b/globals.h index b3d0d6b..a849e05 100644 --- a/globals.h +++ b/globals.h @@ -9,10 +9,16 @@ #define GLOBALS_H // Defined values -#define NMESH 54 // The number of meshes (in the models-textures dir) +#define NMESH 54 // The number of meshes (in the models-textures dir) #define NTEXTURE 30 // The number of textures (in the models-textures dir) #define MAXOBJECTS 256 +#define LIGHTS 2 // Number of lights in program + +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + // Meshes and textures arrays extern mesh* meshes[]; extern texture* textures[]; @@ -24,6 +30,33 @@ extern const char *objectMenuEntries[]; // Scene object arrays extern SceneObject sceneObjs[]; extern int nObjects; +extern int curObject; +extern int buttonSelected; +extern int manipulateState; + +/* Light object arrays and default values */ +extern LightObject lightObjs[]; + +extern GLfloat defaultPosition[]; + +extern GLfloat defaultAmbient[]; +extern GLfloat defaultDiffuse[]; +extern GLfloat defaultSpecular[]; +extern GLfloat defaultDirection[]; + +extern GLfloat defaultCutoff; +extern GLfloat defaultExponent; + +/* Material types */ +extern GLfloat materialAmbient[]; +extern GLfloat materialDiffuse[]; +extern GLfloat materialSpecular[]; + +/* Light parameters */ +extern GLfloat lightShine; +extern GLfloat lightGlobalModel[]; +extern GLfloat lightGlobalEmission[]; +extern GLfloat lightBallSize; // Directories containing models extern char *dirDefault1; @@ -32,10 +65,7 @@ extern char *dirDefault2; // Stores the directory name for the meshes and textures. extern char dataDir[]; -extern int moving, startx, starty; - -/* Recursion level for floor drawing */ -extern int drawFloorRecurse; +extern int startx, starty; /* Size of floor, from -n to n */ extern int floorSize; @@ -48,42 +78,13 @@ extern GLfloat factor; /* Length of axis lines */ extern GLfloat lineLength; -/* Light 0 parameters */ -extern GLfloat diffuse0[]; -extern GLfloat ambient0[]; -extern GLfloat specular0[]; -extern GLfloat direction0[]; - -extern GLfloat lightPosition0[]; - -extern float lightAngle0, lightHeight0; -extern int lightMoving0, lightStartX0, lightStartY0; - -/* Light 1 parameters */ -extern GLfloat diffuse1[]; -extern GLfloat ambient1[]; -extern GLfloat specular1[]; -extern GLfloat direction1[]; - -extern GLfloat lightPosition1[]; - -extern float lightAngle1, lightHeight1; -extern int lightMoving1, lightStartX1, lightStartY1; - -/* Material types */ -extern GLfloat ambient[]; -extern GLfloat diffuse[]; -extern GLfloat specular[]; -extern GLfloat shine; -extern GLfloat glightmodel[]; -extern GLfloat emission[]; - /* Beginning width, height */ extern int width, height; /* Zoom and rotate tracking */ -extern GLfloat zoom, rotate; -extern GLfloat zoomFactor, rotateFactor; +extern GLfloat zoom, rotate, camAngle; +extern GLfloat zoomFactor, camRotateFactor, camAngleFactor; +extern GLfloat leftrightFactor, nearfarFactor, bigsmallFactor, updownFactor, rotateFactor, texscaleFactor; /* Texture state tracking */ extern int currentGroundTexture, currentMeshTexture;