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_LIGHTIPOSGCONTROLLER_H 00033 #define KX_LIGHTIPOSGCONTROLLER_H 00034 00035 #include "SG_Controller.h" 00036 #include "SG_Spatial.h" 00037 00038 #include "KX_IInterpolator.h" 00039 00040 struct RAS_LightObject; 00041 00042 class KX_LightIpoSGController : public SG_Controller 00043 { 00044 public: 00045 MT_Scalar m_energy; 00046 MT_Scalar m_col_rgb[3]; 00047 MT_Scalar m_dist; 00048 00049 private: 00050 T_InterpolatorList m_interpolators; 00051 unsigned short m_modify_energy : 1; 00052 unsigned short m_modify_color : 1; 00053 unsigned short m_modify_dist : 1; 00054 bool m_modified; 00055 00056 double m_ipotime; 00057 public: 00058 KX_LightIpoSGController() : 00059 m_modify_energy(false), 00060 m_modify_color(false), 00061 m_modify_dist(false), 00062 m_modified(true), 00063 m_ipotime(0.0) 00064 {} 00065 00066 virtual ~KX_LightIpoSGController(); 00067 00068 virtual SG_Controller* GetReplica(class SG_Node* destnode); 00069 00070 virtual bool Update(double time); 00071 00072 virtual void SetSimulatedTime(double time) { 00073 m_ipotime = time; 00074 m_modified = true; 00075 } 00076 00077 void SetModifyEnergy(bool modify) { 00078 m_modify_energy = modify; 00079 } 00080 00081 void SetModifyColor(bool modify) { 00082 m_modify_color = modify; 00083 } 00084 00085 void SetModifyDist(bool modify) { 00086 m_modify_dist = modify; 00087 } 00088 00089 void 00090 SetOption( 00091 int option, 00092 int value 00093 ){ 00094 // intentionally empty 00095 }; 00096 00097 void AddInterpolator(KX_IInterpolator* interp); 00098 00099 00100 #ifdef WITH_CXX_GUARDEDALLOC 00101 public: 00102 void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_LightIpoSGController"); } 00103 void operator delete( void *mem ) { MEM_freeN(mem); } 00104 #endif 00105 }; 00106 00107 #endif // KX_LIGHTIPOSGCONTROLLER_H 00108