PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: SNProjectiveSpotLight.h * 00003 * 00004 * Copyright (C) 2002-2011 The PixelLight Team (http://www.pixellight.org/) 00005 * 00006 * This file is part of PixelLight. 00007 * 00008 * PixelLight is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License as published by 00010 * the Free Software Foundation, either version 3 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * PixelLight is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public License 00019 * along with PixelLight. If not, see <http://www.gnu.org/licenses/>. 00020 \*********************************************************/ 00021 00022 00023 #ifndef __PLSCENE_PROJECTIVESPOTLIGHT_H__ 00024 #define __PLSCENE_PROJECTIVESPOTLIGHT_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include <PLRenderer/Material/MaterialHandler.h> 00032 #include <PLRenderer/Material/MaterialManager.h> 00033 #include "PLScene/Scene/SNSpotLight.h" 00034 00035 00036 //[-------------------------------------------------------] 00037 //[ Namespace ] 00038 //[-------------------------------------------------------] 00039 namespace PLScene { 00040 00041 00042 //[-------------------------------------------------------] 00043 //[ Classes ] 00044 //[-------------------------------------------------------] 00045 /** 00046 * @brief 00047 * Projective spot light scene node 00048 * 00049 * @note 00050 * - By default, the 'NoCone' flag is set meaning that the given outer and inner angles are 00051 * not used for lighting 00052 */ 00053 class SNProjectiveSpotLight : public SNSpotLight { 00054 00055 00056 //[-------------------------------------------------------] 00057 //[ Public definitions ] 00058 //[-------------------------------------------------------] 00059 public: 00060 /** 00061 * @brief 00062 * Scene node flags (SceneNode flags extension) 00063 */ 00064 enum EFlags { 00065 NoProjection = 1<<14 /**< Disable texture projection */ 00066 }; 00067 pl_enum(EFlags) 00068 pl_enum_base(SNSpotLight::EFlags) 00069 pl_enum_value(NoProjection, "Disable texture projection") 00070 pl_enum_end 00071 00072 00073 //[-------------------------------------------------------] 00074 //[ RTTI interface ] 00075 //[-------------------------------------------------------] 00076 pl_class(PLS_RTTI_EXPORT, SNProjectiveSpotLight, "PLScene", PLScene::SNSpotLight, "Projective spot light scene node") 00077 // Attributes 00078 pl_attribute(ProjectedMaterial, PLCore::String, "Data/Textures/PLLogo.dds", ReadWrite, GetSet, "Projected material", "Type='Material Effect Image TextureAni'") 00079 // Overwritten SceneNode attributes 00080 pl_attribute(Flags, pl_flag_type(EFlags), NoCone, ReadWrite, GetSet, "Flags", "") 00081 // Constructors 00082 pl_constructor_0(DefaultConstructor, "Default constructor", "") 00083 pl_class_end 00084 00085 00086 //[-------------------------------------------------------] 00087 //[ Public RTTI get/set functions ] 00088 //[-------------------------------------------------------] 00089 public: 00090 PLS_API PLCore::String GetProjectedMaterial() const; 00091 PLS_API void SetProjectedMaterial(const PLCore::String &sValue); 00092 00093 00094 //[-------------------------------------------------------] 00095 //[ Public functions ] 00096 //[-------------------------------------------------------] 00097 public: 00098 /** 00099 * @brief 00100 * Default constructor 00101 */ 00102 PLS_API SNProjectiveSpotLight(); 00103 00104 /** 00105 * @brief 00106 * Destructor 00107 */ 00108 PLS_API virtual ~SNProjectiveSpotLight(); 00109 00110 /** 00111 * @brief 00112 * Returns the handler of the projected material 00113 * 00114 * @return 00115 * Handler of the projected material 00116 */ 00117 PLS_API const PLRenderer::MaterialHandler &GetProjectedMaterialHandler(); 00118 00119 00120 //[-------------------------------------------------------] 00121 //[ Private data ] 00122 //[-------------------------------------------------------] 00123 private: 00124 PLCore::String m_sProjectedMaterial; /**< Projected material */ 00125 bool m_bProjectedMaterial; /**< Projected material loaded? */ 00126 PLRenderer::MaterialHandler m_cProjectedMaterial; /**< Projected material */ 00127 00128 00129 //[-------------------------------------------------------] 00130 //[ Public virtual SNLight functions ] 00131 //[-------------------------------------------------------] 00132 public: 00133 PLS_API virtual bool IsProjectiveSpotLight() const override; 00134 00135 00136 }; 00137 00138 00139 //[-------------------------------------------------------] 00140 //[ Namespace ] 00141 //[-------------------------------------------------------] 00142 } // PLScene 00143 00144 00145 #endif // __PLSCENE_PROJECTIVESPOTLIGHT_H__
|