Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/images/importer/material.h @ 3085

Last change on this file since 3085 was 3085, checked in by bensch, 19 years ago

orxonox/branches/images: bring order to Chaos

File size: 1.7 KB
Line 
1/*!
2  \file material.h
3  \brief Contains the Material Class that handles Material for 3D-Objects.
4*/
5
6#ifndef _MATERIAL_H
7#define _MATERIAL_H
8
9extern int verbose; //!< will be obsolete soon.
10
11#include <GL/gl.h>
12#include <GL/glu.h>
13#include <SDL/SDL.h>
14#include <stdlib.h>
15#include <fstream>
16
17// IMAGE LIBS //
18#include <jpeglib.h>
19
20//! Class to handle Materials.
21class Material
22{
23 public:
24  Material ();
25  Material (char* mtlName);
26  Material* addMaterial(char* mtlName);
27  ~Material ();
28  void init(void);
29
30  Material* search (char* mtlName);
31  bool select (void);
32
33  GLuint diffuseTexture;
34  GLuint ambientTexture;
35  GLuint specularTexture;
36 
37  bool diffuseTextureSet;
38  bool ambientTextureSet;
39  bool specularTextureSet;
40
41  void setName (char* mtlName);
42  char* getName (void);
43  void setIllum (int illum);
44  void setIllum (char* illum);
45  void setDiffuse (float r, float g, float b);
46  void setDiffuse (char* rgb);
47  void setAmbient (float r, float g, float b);
48  void setAmbient (char* rgb);
49  void setSpecular (float r, float g, float b);
50  void setSpecular (char* rgb);
51  void setShininess (float shini);
52  void setShininess (char* shini);
53  void setTransparency (float trans);
54  void setTransparency (char* trans);
55
56
57
58
59  // MAPPING //
60  void setDiffuseMap(char* dMap);
61  void setAmbientMap(char* aMap);
62  void setSpecularMap(char* sMap);
63  void setBump(char* bump);
64
65  // TEXTURING
66  bool loadBMP (char* bmpName, GLuint* texture);
67
68 private:
69  char* name;
70  int illumModel;
71  float diffuse [4];
72  float ambient [4];
73  float specular [4];
74  float shininess;
75  float transparency;
76  Material* nextMat; //!< pointer to the Next Material of the List. NULL if no next exists.
77
78};
79#endif
Note: See TracBrowser for help on using the repository browser.