(no commit message)
[atyndall/cits2231.git] / globals.c
1 /**
2  * Global Variables File
3  * Contains all of the project's global variables
4  * @author Ashley Tyndall (20915779), Jenna de la Harpe (20367932)
5  */
6
7 #include "types.h"
8 #include "globals.h"
9
10 mesh* meshes[NMESH];   // An array of pointers to the meshes - see getMesh
11 texture* textures[NTEXTURE];   // An array of texture pointers - see getTexture
12
13 // Menu arrays
14 const char *textureMenuEntries[NTEXTURE] = {
15   "1 Plain", "2 Rust", "3 Concrete", "4 Carpet", "5 Beach Sand",
16   "6 Rocky", "7 Brick", "8 Water", "9 Paper", "10 Marble",
17   "11 Wood", "12 Scales", "13 Fur", "14 Denim", "15 Hessian",
18   "16 Orange Peel", "17 Ice Crystals", "18 Grass", "19 Corrugated Iron", "20 Styrofoam",
19   "21 Bubble Wrap", "22 Leather", "23 Camouflage", "24 Asphalt", "25 Scratched Ice",
20   "26 Rattan", "27 Snow", "28 Dry Mud", "29 Old Concrete", "30 Leopard Skin"
21 };
22
23 const char *objectMenuEntries[NMESH] = {
24   "1 Thin Dinosaur","2 Big Dog","3 Saddle Dinosaur", "4 Dragon", "5 Cleopatra",
25   "6 Bone I", "7 Bone II", "8 Rabbit", "9 Long Dragon", "10 Buddha",
26   "11 Sitting Rabbit", "12 Frog", "13 Cow", "14 Monster", "15 Sea Horse",
27   "16 Head", "17 Pelican", "18 Horse", "19 Kneeling Angel", "20 Porsche I",
28   "21 Truck", "22 Statue of Liberty", "23 Sitting Angel", "24 Metal Part", "25 Car",
29   "26 Apatosaurus", "27 Airliner", "28 Motorbike", "29 Dolphin", "30 Spaceman",
30   "31 Winnie the Pooh", "32 Shark", "33 Crocodile", "34 Toddler", "35 Fat Dinosaur",
31   "36 Chihuahua", "37 Sabre-toothed Tiger", "38 Lioness", "39 Fish", "40 Horse (head down)",
32   "41 Horse (head up)", "42 Skull", "43 Fighter Jet I", "44 Toad", "45 Convertible",
33   "46 Porsche II", "47 Hare", "48 Vintage Car", "49 Fighter Jet II", "50 Winged Monkey",
34   "51 Chef", "52 Parasaurolophus", "53 Rooster", "54 T-rex"
35 };
36
37 SceneObject sceneObjs[MAXOBJECTS];  // An array with details of the objects in a scene
38 int nObjects=0;                     // How many objects there are in the scene currently.
39
40 // Directories containing models
41 char *dirDefault1 = "models-textures";
42 char *dirDefault2 = "/cslinux/examples/CITS2231/project-files/models-textures";
43
44 char dataDir[200];  // Stores the directory name for the meshes and textures.
45
46 GLfloat lightColor[] = {1.0, 1.0, 1.0, 1.0}; // White light
47 GLfloat lightPosition[4];
48
49 int moving, startx, starty;
50 int lightMoving = 0, lightStartX, lightStartY;
51
52 /* Time varying or user-controled variables. */
53 float jump = 0.0;
54 float lightAngle = 0.0, lightHeight = 5;
55 GLfloat angle = -150;   /* in degrees */
56 GLfloat angle2 = 30;   /* in degrees */
57
58 /* Near and far parameters - calculates scene size */
59 GLfloat near = -30;
60 GLfloat far = 30;
61
62 /* Near and far clipping planes - calculates clipping planes */
63 GLfloat nearClip = -200;
64 GLfloat farClip = 200;
65
66 /* Recursion level for floor drawing */
67 int drawFloorRecurse = 8;
68
69 /* Size of floor, from -n to n */
70 int floorSize = 200;
71
72 /* Current camera x, y, z coords */
73 GLfloat camx = 0.0, camy = 0.0, camz = 0.0, rot = 0.0;
74
75 /* Length of axis lines */
76 GLfloat lineLength = 5;
77
78 /* Light 0 parameters */
79 GLfloat diffuse0[]={1.0, 0.0, 0.0, 1.0};
80 GLfloat ambient0[]={1.0, 0.0, 0.0, 1.0};
81 GLfloat specular0[]={1.0, 0.0, 0.0, 1.0};
82 GLfloat emission0[] = {0.0, 0.3, 0.3, 1.0};
83
84 GLfloat direction0[] = {0.0, 0.0, 0.0};
85 GLfloat light0_pos[] ={1.0, 1.0, 0,0, 0.5};
86
87 GLfloat shine = 100.0;
88
89 GLfloat glightmodel[] = {0.2,0.2,0.2,1};
90
91 /* Material types */
92 GLfloat ambient[] = {0.2, 0.2, 0.2, 1.0};
93 GLfloat diffuse[] = {1.0, 0.8, 0.0, 1.0};
94 GLfloat specular[] = {1.0, 1.0, 1.0, 1.0};
95
96 /* Zoom and rotate tracking */
97 GLfloat zoomFactor = 0.0, rotateFactor = 0.0;
98
99 /* Beginning width, height */
100 int width = 500, height = 500;

UCC git Repository :: git.ucc.asn.au