Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/ColladaPlugin/include/OgreColladaMaterial.h @ 45

Last change on this file since 45 was 21, checked in by nicolasc, 17 years ago

added ogreode and Colladaplugin

File size: 2.5 KB
Line 
1/**
2 * This source file is part of OgreColladaPlugin
3 * an addon for OGRE (Object-oriented Graphics Rendering Engine)
4 * For the latest info, see http://www.ogre3d.org/
5 *
6 * This program is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU Lesser General Public License as published by the Free Software
8 * Foundation; either version 2 of the License, or (at your option) any later
9 * version.
10
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14
15 * You should have received a copy of the GNU Lesser General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
17 * Place - Suite 330, Boston, MA 02111-1307, USA, or go to
18 * http://www.gnu.org/copyleft/lesser.txt.
19 *
20 * @author      Philipp Hartl
21 * @see         README
22 */
23
24#ifndef __COLLADA_MATERIAL_H__
25#define __COLLADA_MATERIAL_H__
26
27#include "OgreColladaPrerequisites.h"
28#include "OgreColladaEntity.h"
29
30#include "OgreColourValue.h"
31#include "OgreCommon.h"
32
33namespace Ogre
34{
35        struct ColladaMaterialPass;
36
37        typedef std::vector<ColladaMaterialPass *> ColladaMaterialPassPtrVector;
38        typedef std::vector<ColladaTexture *> ColladaTexturePtrVector;
39
40        /**
41         * a material object
42         */
43        class ColladaMaterial : public ColladaEntity
44        {
45        public:
46                ColladaMaterial(ColladaDocument *doc, xmlNode *n);
47                virtual ~ColladaMaterial(void);
48
49                /**
50                 * create and load a ogre material
51                 * with multiple passes
52                 */
53                virtual MovableObject *getOgreInstance(void) const;
54
55                /**
56                 * import the <material> node
57                 *
58                 * @return      true if succeeds
59                 */
60                virtual bool doImport(void);
61
62                virtual EntityTypes getEntityType(void) const { return MATERIAL; }
63
64        private:
65                ColladaMaterialPassPtrVector mPasses;   // all material passes
66               
67                /**
68                 * import rendering pass properties from <pass> node
69                 *
70                 * @param       node    the <pass> node
71                 * @return      a pointer on a material pass structure
72                 */
73                ColladaMaterialPass *importPass(xmlNode *pass);
74        };
75
76        /**
77         * all material properties for one rendering pass
78         * @see collada 1.3.1 specification for details
79         */
80        struct ColladaMaterialPass
81        {
82                ShadeOptions mMode;
83                ColourValue     mAmbient, mDiffuse, mSpecular, mEmission, mTransparent, mReflective;
84                float           mShininess, mTransparency, mReflectivity;               
85                ColladaTexturePtrVector mTextures;              // a texture vector, for multitexturing purpose
86        };
87}
88
89#endif // __COLLADA_MATERIAL_H__
Note: See TracBrowser for help on using the repository browser.