Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 3, 2006, 2:37:13 PM (18 years ago)
Author:
bensch
Message:

orxonox/bsp_model: Material should support multiple Textures now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/bsp_model/src/lib/graphics/importer/material.h

    r7465 r7510  
    1414#endif /* HAVE_CONFIG_H */
    1515
    16 #ifndef NULL
    17 #define NULL 0            //!< a pointer to NULL
    18 #endif
     16#include <vector>
     17
    1918
    2019#include "texture.h"
     
    2524class Material : public BaseObject
    2625{
    27  public:
    28   Material (const std::string& mtlName = "");
    29   virtual ~Material ();
     26  public:
     27    Material (const std::string& mtlName = "");
     28    virtual ~Material ();
    3029
    31   Material& operator=(const Material& material);
     30    Material& operator=(const Material& material);
    3231
    33   bool select () const;
    34   bool select0 () const;
    35      
    36   void setIllum (int illum);
    37   void setIllum (char* illum);
    38   int getIllumModel() const { return this->illumModel; };
    39   void setDiffuse (float r, float g, float b);
    40   void setDiffuse (char* rgb);
    41   void setAmbient (float r, float g, float b);
    42   void setAmbient (char* rgb);
    43   void setSpecular (float r, float g, float b);
    44   void setSpecular (char* rgb);
    45   void setShininess (float shini);
    46   void setShininess (char* shini);
    47   void setTransparency (float trans);
    48   void setTransparency (char* trans);
    49   void setBlendFunc(GLenum sFactor, GLenum tFactor) { this->sFactor = sFactor; this->tFactor = tFactor; };
     32    bool select () const;
    5033
    51  // MAPPING //
    52   void setDiffuseMap(const std::string& dMap, GLenum target = GL_TEXTURE_2D);
    53   void setAmbientMap(const std::string& aMap, GLenum target = GL_TEXTURE_2D);
    54   void setSpecularMap(const std::string& sMap, GLenum target = GL_TEXTURE_2D);
    55   void setBump(const std::string& bump);
    56   GLuint getDiffuseTexture() const { return (this->diffuseTexture)? this->diffuseTexture->getTexture() : 0; };
     34    void setIllum (int illum);
     35    int getIllumModel() const { return this->illumModel; };
     36    void setDiffuse (float r, float g, float b);
     37    void setAmbient (float r, float g, float b);
     38    void setSpecular (float r, float g, float b);
     39    void setShininess (float shini);
     40    void setTransparency (float trans);
     41    void setBlendFunc(GLenum sFactor, GLenum tFactor) { this->sFactor = sFactor; this->tFactor = tFactor; };
    5742
    58   static void addTexturePath(const std::string& pathName);
     43
     44    // TODO Move them out of here
     45    void setIllum (char* illum);
     46    void setDiffuse (char* rgb);
     47    void setAmbient (char* rgb);
     48    void setSpecular (char* rgb);
     49    void setShininess (char* shini);
     50    void setTransparency (char* trans);
     51
     52
     53    // MAPPING //
     54    void setDiffuseMap(const std::string& dMap, GLenum target = GL_TEXTURE_2D, unsigned int textureNumber = 0);
     55
     56    void setAmbientMap(const std::string& aMap, GLenum target = GL_TEXTURE_2D);
     57    void setSpecularMap(const std::string& sMap, GLenum target = GL_TEXTURE_2D);
     58    void setBump(const std::string& bump);
     59    GLuint getDiffuseTexture(unsigned int i = 0) const { return (this->textures.size() > i)? this->textures[i]->getTexture() : 0; };
     60
     61    static void addTexturePath(const std::string& pathName);
     62
     63  public:
     64    static const GLenum glTextureArbs[];  //!< The Texture ARB's
     65
     66    static int getMaxTextureUnits();
    5967
    6068  private:
     
    6876    GLenum      tFactor;
    6977
    70     Texture*    diffuseTexture;   //!< The diffuse texture of the Material.
     78    std::vector<Texture*> textures; //!< An Array of Textures.
     79
    7180    Texture*    ambientTexture;   //!< The ambient texture of the Material.
    7281    Texture*    specularTexture;  //!< The specular texture of the Material.
     82
     83
    7384};
    7485#endif
Note: See TracChangeset for help on using the changeset viewer.