- Cal3D 0.11 API Reference -

corematerial.h
1//****************************************************************************//
2// corematerial.h //
3// Copyright (C) 2001, 2002 Bruno 'Beosil' Heidelberger //
4//****************************************************************************//
5// This library is free software; you can redistribute it and/or modify it //
6// under the terms of the GNU Lesser General Public License as published by //
7// the Free Software Foundation; either version 2.1 of the License, or (at //
8// your option) any later version. //
9//****************************************************************************//
10
11#ifndef CAL_COREMATERIAL_H
12#define CAL_COREMATERIAL_H
13
14
15#include "cal3d/global.h"
16#include "cal3d/refcounted.h"
17#include "cal3d/refptr.h"
18
19
20// Maximum length of mapType string buffer, including terminating zero.
21#define CalCoreMaterialMapTypeLengthMax ( 128 )
22class CAL3D_API CalCoreMaterial : public cal3d::RefCounted
23{
24public:
25 struct Color
26 {
27 unsigned char red;
28 unsigned char green;
29 unsigned char blue;
30 unsigned char alpha;
31 };
32
33 struct Map
34 {
35 std::string strFilename;
36 std::string mapType;
37 Cal::UserData userData;
38 };
39
41 CalCoreMaterial( const CalCoreMaterial& inOther );
42
43protected:
45
46public:
47 const Color& getAmbientColor() const;
48 const Color& getDiffuseColor() const;
49 int getMapCount() const;
50 const std::string& getMapFilename(int mapId) const;
51 const std::string& getMapType(int mapId);
52 Cal::UserData getMapUserData(int mapId);
53 const Cal::UserData getMapUserData(int mapId) const;
54 float getShininess() const;
55 const Color& getSpecularColor() const;
56 Cal::UserData getUserData();
57 const Cal::UserData getUserData() const;
58 std::vector<Map>& getVectorMap();
59 const std::vector<Map>& getVectorMap() const;
60 bool reserve(int mapCount);
61 void setAmbientColor(const Color& ambientColor);
62 void setDiffuseColor(const Color& diffuseColor);
63 bool setMap(int mapId, const Map& map);
64 bool setMapUserData(int mapId, Cal::UserData userData);
65 void setShininess(float shininess);
66 void setSpecularColor(const Color& specularColor);
67 void setFilename(const std::string& filename);
68 const std::string& getFilename(void) const;
69 void setName(const std::string& name);
70 const std::string& getName(void) const;
71 void setUserData(Cal::UserData userData);
72 bool getAlphaBlending() { return false; } // No check box available in max.
73 bool getTwoSided() { return getMapCount() > 1; } // Should come from check box.
74 bool getSelfIllumination() { return false; } // Should come from check box.
75
76private:
77 Color m_ambientColor;
78 Color m_diffuseColor;
79 Color m_specularColor;
80 float m_shininess;
81 std::vector<Map> m_vectorMap;
82 Cal::UserData m_userData;
83 std::string m_name;
84 std::string m_filename;
85};
87
88#endif
89
90//****************************************************************************//
Definition corematerial.h:23
Derive from RefCounted to make your class have reference-counted lifetime semantics.
Definition refcounted.h:29
A container-safe smart pointer used for refcounted classes.
Definition refptr.h:11
Definition corematerial.h:26
Definition corematerial.h:34

Generated by The Cal3D Team with Doxygen 1.10.0