/** * This source file is part of OgreColladaPlugin * an addon for OGRE (Object-oriented Graphics Rendering Engine) * For the latest info, see http://www.ogre3d.org/ * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA, or go to * http://www.gnu.org/copyleft/lesser.txt. * * @author Philipp Hartl * @see README */ #ifndef __COLLADA_LIGHT_H__ #define __COLLADA_LIGHT_H__ #include "OgreColladaPrerequisites.h" #include "OgreColladaEntity.h" #include "OgreColourValue.h" namespace Ogre { /** * light specific types */ namespace ColladaLightSpecific { enum Type { AMBIENT = 0, DIRECTIONAL, POINT, SPOT, UNKNOWN = -1 }; enum Function { CONSTANT = 0, LINEAR, QUADRATIC }; /** * compare the string with collada syntax * * @param s the type string we've parsed * @return the corresponding light type */ Type getType(const String &s); /** * return the right function in case of given string * * @param s the function string * @return the corresponding function type */ Function getFunction(const String &s); } class ColladaLight : public ColladaEntity { public: ColladaLight(ColladaDocument *d, xmlNode *n); virtual ~ColladaLight(void); /** * create ogre light * * @see base class */ virtual MovableObject *getOgreInstance(void) const; /** * import * * @param none * @return true if succeeds, false otherwise */ virtual bool doImport(void); virtual EntityTypes getEntityType(void) const { return LIGHT; } private: // for all light types ColladaLightSpecific::Type mType; ColourValue mColour; // point light specific float mAttenuationScale; ColladaLightSpecific::Function mAttenuation; // spot light specific float mAngle; float mFalloffScale; ColladaLightSpecific::Function mFalloff; }; } #endif // __COLLADA_LIGHT_H__