00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef CAL_COREMATERIAL_H
00012 #define CAL_COREMATERIAL_H
00013
00014
00015 #include "cal3d/global.h"
00016
00017
00018 class CAL3D_API CalCoreMaterial
00019 {
00020 public:
00021 struct Color
00022 {
00023 unsigned char red;
00024 unsigned char green;
00025 unsigned char blue;
00026 unsigned char alpha;
00027 };
00028
00029 struct Map
00030 {
00031 std::string strFilename;
00032 Cal::UserData userData;
00033 };
00034
00035 public:
00036 CalCoreMaterial();
00037 ~CalCoreMaterial() { }
00038
00039 Color& getAmbientColor();
00040 Color& getDiffuseColor();
00041 int getMapCount();
00042 const std::string& getMapFilename(int mapId);
00043 Cal::UserData getMapUserData(int mapId);
00044 float getShininess();
00045 Color& getSpecularColor();
00046 Cal::UserData getUserData();
00047 std::vector<Map>& getVectorMap();
00048 bool reserve(int mapCount);
00049 void setAmbientColor(const Color& ambientColor);
00050 void setDiffuseColor(const Color& diffuseColor);
00051 bool setMap(int mapId, const Map& map);
00052 bool setMapUserData(int mapId, Cal::UserData userData);
00053 void setShininess(float shininess);
00054 void setSpecularColor(const Color& specularColor);
00055 void setFilename(const std::string& filename);
00056 const std::string& getFilename(void);
00057 void setName(const std::string& name);
00058 const std::string& getName(void);
00059 void setUserData(Cal::UserData userData);
00060 void incRef();
00061 bool decRef();
00062
00063 private:
00064 Color m_ambientColor;
00065 Color m_diffuseColor;
00066 Color m_specularColor;
00067 float m_shininess;
00068 std::vector<Map> m_vectorMap;
00069 Cal::UserData m_userData;
00070 std::string m_name;
00071 std::string m_filename;
00072
00073 int m_referenceCount;
00074 };
00075
00076 #endif
00077
00078