Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/lib/graphics/importer/material.h @ 3836

Last change on this file since 3836 was 3803, checked in by bensch, 20 years ago

orxonox/trunk: SkyBox even better,

world-entity implements a draw function of its own

some other minor stuff

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(const char* dMap);
51  void setAmbientMap(const char* aMap);
52  void setSpecularMap(const char* sMap);
53  void setBump(const 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.