PixelLightAPI  .
SNLight.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: SNLight.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_LIGHT_H__
00024 #define __PLSCENE_LIGHT_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include <PLGraphics/Color/Color3.h>
00032 #include "PLScene/Scene/SceneNode.h"
00033 
00034 
00035 //[-------------------------------------------------------]
00036 //[ Namespace                                             ]
00037 //[-------------------------------------------------------]
00038 namespace PLScene {
00039 
00040 
00041 //[-------------------------------------------------------]
00042 //[ Classes                                               ]
00043 //[-------------------------------------------------------]
00044 /**
00045 *  @brief
00046 *    Abstract light scene node base class
00047 *
00048 *  @note
00049 *    - Scene node scale is ignored
00050 */
00051 class SNLight : public SceneNode {
00052 
00053 
00054     //[-------------------------------------------------------]
00055     //[ Public definitions                                    ]
00056     //[-------------------------------------------------------]
00057     public:
00058         /**
00059         *  @brief
00060         *    Scene node flags (SceneNode flags extension)
00061         */
00062         enum EFlags {
00063             Flares = 1<<10, /**< Lens flares */
00064             Corona = 1<<11, /**< Corona around the light */
00065             Blend  = 1<<12  /**< Brighten the screen (blend effect) */
00066         };
00067         pl_enum(EFlags)
00068             pl_enum_base(SceneNode::EFlags)
00069             pl_enum_value(Flares,   "Lens flares")
00070             pl_enum_value(Corona,   "Corona around the light")
00071             pl_enum_value(Blend,    "Brighten the screen (blend effect)")
00072         pl_enum_end
00073 
00074 
00075     //[-------------------------------------------------------]
00076     //[ RTTI interface                                        ]
00077     //[-------------------------------------------------------]
00078     pl_class(PLS_RTTI_EXPORT, SNLight, "PLScene", PLScene::SceneNode, "Abstract light scene node base class")
00079         // Properties
00080         pl_properties
00081             pl_property("Icon", "Data/Textures/IconLight.dds")
00082         pl_properties_end
00083         // Attributes
00084         pl_attribute(Color,             PLGraphics::Color3,     PLGraphics::Color3(1.0f, 1.0f, 1.0f),   ReadWrite,  DirectValue,    "Light color (r/g/b)",  "")
00085         pl_attribute(CoronaSize,        float,                  0.2f,                                   ReadWrite,  DirectValue,    "Corona size",          "")
00086         pl_attribute(FlareSize,         float,                  0.1f,                                   ReadWrite,  DirectValue,    "Lens flare size",      "")
00087         pl_attribute(ScreenBrighten,    float,                  0.3f,                                   ReadWrite,  DirectValue,    "Screen brighten",      "")
00088             // Overwritten SceneNode attributes
00089         pl_attribute(Flags,             pl_flag_type(EFlags),   0,                                      ReadWrite,  GetSet,         "Flags",                "")
00090         #ifdef PLSCENE_EXPORTS  // The following is only required when compiling PLScene
00091             // Methods
00092             pl_method_0(IsRenderLight,          pl_ret_type(bool),  "Returns whether this is a render light or not. Returns 'true' if this is a render light, else 'false'.",                                                                       "")
00093             pl_method_0(IsEffectLight,          pl_ret_type(bool),  "Returns whether this scene node is a effect light (SNEffectLight) or not. Returns 'true' if this scene node is a effect light, else 'false'.",                                 "")
00094             pl_method_0(IsPointLight,           pl_ret_type(bool),  "Returns whether this scene node is a point light (SNPointLight) or not. Returns 'true' if this scene node is a point light, else 'false'.",                                    "")
00095             pl_method_0(IsProjectivePointLight, pl_ret_type(bool),  "Returns whether this scene node is a projective point light (SNProjectivePointLight) or not. Returns 'true' if this scene node is a projective point light, else 'false'.",    "")
00096             pl_method_0(IsSpotLight,            pl_ret_type(bool),  "Returns whether this scene node is a spot light (SNSpotLight) or not. Returns 'true' if this scene node is a spot light, else 'false'.",                                       "")
00097             pl_method_0(IsProjectiveSpotLight,  pl_ret_type(bool),  "Returns whether this scene node is a projective spot light (SNProjectiveSpotLight) or not. Returns 'true' if this scene node is a projective spot light, else 'false'.",       "")
00098             pl_method_0(IsDirectionalLight,     pl_ret_type(bool),  "Returns whether this scene node is a directional light (SNDirectionalLight) or not. Returns 'true' if this scene node is a directional light, else 'false'.",                  "")
00099         #endif
00100     pl_class_end
00101 
00102 
00103     //[-------------------------------------------------------]
00104     //[ Public virtual SNLight functions                      ]
00105     //[-------------------------------------------------------]
00106     public:
00107         /**
00108         *  @brief
00109         *    Returns whether this is a render light or not
00110         *
00111         *  @return
00112         *    'true' if this is a render light, else 'false'
00113         */
00114         PLS_API virtual bool IsRenderLight() const;
00115 
00116         /**
00117         *  @brief
00118         *    Returns whether this scene node is a effect light (SNEffectLight) or not
00119         *
00120         *  @return
00121         *    'true' if this scene node is a effect light, else 'false'
00122         *
00123         *  @note
00124         *    - More performant than IsInstanceOf("PLScene::SNEffectLight")
00125         */
00126         PLS_API virtual bool IsEffectLight() const;
00127 
00128         /**
00129         *  @brief
00130         *    Returns whether this scene node is a point light (SNPointLight) or not
00131         *
00132         *  @return
00133         *    'true' if this scene node is a point light, else 'false'
00134         *
00135         *  @note
00136         *    - More performant than IsInstanceOf("PLScene::SNPointLight")
00137         */
00138         PLS_API virtual bool IsPointLight() const;
00139 
00140         /**
00141         *  @brief
00142         *    Returns whether this scene node is a projective point light (SNProjectivePointLight) or not
00143         *
00144         *  @return
00145         *    'true' if this scene node is a projective point light, else 'false'
00146         *
00147         *  @note
00148         *    - More performant than IsInstanceOf("PLScene::SNProjectivePointLight")
00149         */
00150         PLS_API virtual bool IsProjectivePointLight() const;
00151 
00152         /**
00153         *  @brief
00154         *    Returns whether this scene node is a spot light (SNSpotLight) or not
00155         *
00156         *  @return
00157         *    'true' if this scene node is a spot light, else 'false'
00158         *
00159         *  @note
00160         *    - More performant than IsInstanceOf("PLScene::SNSpotLight")
00161         */
00162         PLS_API virtual bool IsSpotLight() const;
00163 
00164         /**
00165         *  @brief
00166         *    Returns whether this scene node is a projective spot light (SNProjectiveSpotLight) or not
00167         *
00168         *  @return
00169         *    'true' if this scene node is a projective spot light, else 'false'
00170         *
00171         *  @note
00172         *    - More performant than IsInstanceOf("PLScene::SNProjectiveSpotLight")
00173         */
00174         PLS_API virtual bool IsProjectiveSpotLight() const;
00175 
00176         /**
00177         *  @brief
00178         *    Returns whether this scene node is a directional light (SNDirectionalLight) or not
00179         *
00180         *  @return
00181         *    'true' if this scene node is a directional light, else 'false'
00182         *
00183         *  @note
00184         *    - More performant than IsInstanceOf("PLScene::SNDirectionalLight")
00185         */
00186         PLS_API virtual bool IsDirectionalLight() const;
00187 
00188 
00189     //[-------------------------------------------------------]
00190     //[ Protected functions                                   ]
00191     //[-------------------------------------------------------]
00192     protected:
00193         /**
00194         *  @brief
00195         *    Default constructor
00196         */
00197         PLS_API SNLight();
00198 
00199         /**
00200         *  @brief
00201         *    Destructor
00202         */
00203         PLS_API virtual ~SNLight();
00204 
00205 
00206 };
00207 
00208 
00209 //[-------------------------------------------------------]
00210 //[ Namespace                                             ]
00211 //[-------------------------------------------------------]
00212 } // PLScene
00213 
00214 
00215 #endif // __PLSCENE_LIGHT_H__


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:02
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported