Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/textEngine/src/lib/graphics/importer/material.h @ 3780

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

orxonox/branches/textEngine: blening of Materials enabled

File size: 2.2 KB
Line 
1/*!
2  \file material.h
3  \brief Contains the Material Class that handles Material for 3D-Objects.
4  \todo free SDL-surface when deleting Material.
5  \todo delete imgNameWithPath after use creation.
6*/
7
8#ifndef _MATERIAL_H
9#define _MATERIAL_H
10
11
12#if HAVE_CONFIG_H
13#include <config.h> 
14#endif /* HAVE_CONFIG_H */
15
16// FORWARD DEFINITIONS //
17class Texture;
18
19
20//! Class to handle Materials.
21class Material
22{
23 public:
24  Material (char* mtlName = "");
25  Material* addMaterial(char* mtlName);
26  ~Material ();
27
28  Material* search(char* mtlName);
29  bool select (void);
30
31  void setName (char* mtlName);
32  char* getName (void);
33  void setIllum (int illum);
34  void setIllum (char* illum);
35  void setDiffuse (float r, float g, float b);
36  void setDiffuse (char* rgb);
37  void setAmbient (float r, float g, float b);
38  void setAmbient (char* rgb);
39  void setSpecular (float r, float g, float b);
40  void setSpecular (char* rgb);
41  void setShininess (float shini);
42  void setShininess (char* shini);
43  void setTransparency (float trans);
44  void setTransparency (char* trans);
45
46
47 
48  void addTexturePath(char* pathName);
49 // MAPPING //
50  void setDiffuseMap(char* dMap);
51  void setAmbientMap(char* aMap);
52  void setSpecularMap(char* sMap);
53  void setBump(char* bump);
54
55 private:
56  char* name;        //!< The Name of the Material.
57  int illumModel;    //!< The IlluminationModel is either flat or smooth.
58  float diffuse [4]; //!< The diffuse color of the Material.
59  float ambient [4]; //!< The ambient color of the Material.
60  float specular [4];//!< The specular color of the Material.
61  float shininess;   //!< The shininess of the Material.
62  float transparency;//!< The transperency of the Material.
63
64  Texture* diffuseTexture; //!< The diffuse texture of the Material.
65  Texture* ambientTexture; //!< The ambient texture of the Material.
66  Texture* specularTexture;//!< The specular texture of the Material.
67 
68  bool diffuseTextureSet; //!< Chekcs if the diffuse texture is Set.
69  bool ambientTextureSet; //!< Chekcs if the ambient texture is Set.
70  bool specularTextureSet;//!< Chekcs if the specular texture is Set.
71
72  Material* nextMat; //!< pointer to the Next Material of the List. NULL if no next exists.
73
74
75};
76#endif
Note: See TracBrowser for help on using the repository browser.