Blender V2.61 - r43446
|
00001 /* 00002 * ***** BEGIN GPL LICENSE BLOCK ***** 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software Foundation, 00016 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 * 00018 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. 00019 * All rights reserved. 00020 * 00021 * The Original Code is: all of this file. 00022 * 00023 * Contributor(s): none yet. 00024 * 00025 * ***** END GPL LICENSE BLOCK ***** 00026 */ 00027 00032 #ifndef __KX_LIGHT 00033 #define __KX_LIGHT 00034 00035 #include "RAS_LightObject.h" 00036 #include "KX_GameObject.h" 00037 00038 struct GPULamp; 00039 struct Scene; 00040 class KX_Camera; 00041 class RAS_IRasterizer; 00042 class RAS_IRenderTools; 00043 class MT_Transform; 00044 00045 class KX_LightObject : public KX_GameObject 00046 { 00047 Py_Header 00048 protected: 00049 RAS_LightObject m_lightobj; 00050 class RAS_IRenderTools* m_rendertools; //needed for registering and replication of lightobj 00051 bool m_glsl; 00052 Scene* m_blenderscene; 00053 00054 public: 00055 KX_LightObject(void* sgReplicationInfo,SG_Callbacks callbacks,class RAS_IRenderTools* rendertools,const struct RAS_LightObject& lightobj, bool glsl); 00056 virtual ~KX_LightObject(); 00057 virtual CValue* GetReplica(); 00058 RAS_LightObject* GetLightData() { return &m_lightobj;} 00059 00060 /* OpenGL Light */ 00061 bool ApplyLight(KX_Scene *kxscene, int oblayer, int slot); 00062 00063 /* GLSL Light */ 00064 struct GPULamp *GetGPULamp(); 00065 bool HasShadowBuffer(); 00066 int GetShadowLayer(); 00067 void BindShadowBuffer(class RAS_IRasterizer *ras, class KX_Camera *cam, class MT_Transform& camtrans); 00068 void UnbindShadowBuffer(class RAS_IRasterizer *ras); 00069 void Update(); 00070 00071 void UpdateScene(class KX_Scene *kxscene) {m_lightobj.m_scene = (void*)kxscene;} 00072 00073 virtual int GetGameObjectType() { return OBJ_LIGHT; } 00074 00075 #ifdef WITH_PYTHON 00076 /* attributes */ 00077 static PyObject* pyattr_get_color(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); 00078 static int pyattr_set_color(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject* value); 00079 static PyObject* pyattr_get_typeconst(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); 00080 static PyObject* pyattr_get_type(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); 00081 static int pyattr_set_type(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject* value); 00082 #endif 00083 }; 00084 00085 #endif //__KX_LIGHT 00086